Ok. Signed-off-by: Hugh Greenberg <[EMAIL PROTECTED]>
On Wed, 2008-09-24 at 13:58 -0600, Latchesar Ionkov wrote: > Can you please change the walk function to check if fs->root is NULL. > I don't want to spill the knowledge that fs has a field named fd > outside fsys.c. Some day (hopefully soon) we'll have transports other > than file descriptors/sockets and changing only fsys.c will make the > redesign easier. > > Thanks, > Lucho > > On Sep 24, 2008, at 1:53 PM, Hugh Greenberg wrote: > > > > > Yes, it does. However, in walk the line: > > > > nfid = fs->root->fid > > > > takes place before spc_rpc is called and this causes a segfault. > > > > On Wed, 2008-09-24 at 13:41 -0600, Latchesar Ionkov wrote: > >> But walk calls spc_rpc too, doesn't it? > >> > >> On Sep 24, 2008, at 1:43 PM, Hugh Greenberg wrote: > >> > >>> Ok, here is a patch that puts the fix in spc_rpc and spc_walk. I > >>> need > >>> the fix in spc_walk also since spc_open calls spc_walk before it > >>> calls > >>> spc_rpc. > >>> > >>> Signed-off-by: Hugh Greenberg <[EMAIL PROTECTED]> > >>> > >>> On Wed, 2008-09-24 at 12:18 -0600, Latchesar Ionkov wrote: > >>>> It doesn't seem like the right solution to me. I think it the fix > >>>> should be in spc_rpc. > >>>> > >>>> Thanks, > >>>> Lucho > >>>> > >>>> On Sep 24, 2008, at 12:18 PM, Hugh Greenberg wrote: > >>>> > >>>>> This patch prevents a segfault caused by spc_open and spc_clunk if > >>>>> the > >>>>> filesystem was previously disconnected by spc_disconnect_fsys . > >>>>> > >>>>> Signed-off-by: Hugh Greenberg <[EMAIL PROTECTED]> > >>>>> > >>>>> <open.patch> > >>>> > >>> <all.patch> > >> > > >
Index: walk.c =================================================================== --- walk.c (revision 695) +++ walk.c (working copy) @@ -39,6 +39,9 @@ Spfcall *tc, *rc; Spcfid *fid; + if (!fs->root) + return NULL; + while (*path == '/') path++; Index: fsys.c =================================================================== --- fsys.c (revision 695) +++ fsys.c (working copy) @@ -566,6 +566,9 @@ char *ename; Spcrpc r; + if (fs->fd < 0) + return -1; + if (rc) *rc = NULL;
