[Libsysio-commit] strided-io: libsysio/src namei.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-01-28 01:04:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22917/src Modified Files: Tag: strided-io namei.c Log Message: Fixed two issues; 1) When following a symlink target that ends with a directory with the VTX mode bit set but no .mount or a failed automount the caller would redundantly try the automount again. 2) The reference to the pnode for a non-existent (negative) .mount entry or a failed mount with one that exists was not being dropped. This would leave the path node alias stuck in the system. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.8.6.1 retrieving revision 1.8.6.2 diff -u -w -b -B -p -r1.8.6.1 -r1.8.6.2 --- namei.c 26 Jan 2004 16:27:48 -0000 1.8.6.1 +++ namei.c 28 Jan 2004 01:03:00 -0000 1.8.6.2 @@ -244,20 +244,19 @@ _sysio_path_walk(struct pnode *parent, s nd->nd_pno = nameidata.nd_pno; ino = nd->nd_pno->p_base->pb_ino; } - #ifdef AUTOMOUNT_FILE_NAME - /* - * We're committed to a lookup. It's time to see if we're - * going to do it in an automount-point and arrange the - * mount if so. - */ - if (ino && + else if (ino && S_ISDIR(ino->i_mode) && (nd->nd_pno->p_mount->mnt_flags & MOUNT_F_AUTO) && nd->nd_amcnt < MAX_MOUNT_DEPTH && ino->i_mode & S_ISVTX) { struct pnode *pno; + /* + * We're committed to a lookup. It's time to see if + * we're going to do it in an automount-point and + * arrange the mount if so. + */ assert(!nd->nd_pno->p_cover); err = lookup(nd->nd_pno, @@ -265,6 +264,8 @@ _sysio_path_walk(struct pnode *parent, s &pno, NULL, NULL); + if (pno) + P_RELE(pno); if (!err && _sysio_automount(pno) == 0) { struct pnode *root; @@ -285,7 +286,9 @@ _sysio_path_walk(struct pnode *parent, s assert(root); P_RELE(nd->nd_pno); nd->nd_pno = root; +#if 0 P_REF(nd->nd_pno); +#endif ino = nd->nd_pno->p_base->pb_ino; assert(ino); @@ -293,13 +296,11 @@ _sysio_path_walk(struct pnode *parent, s * Must send the intent-path again. */ path = nd->nd_path; - } - if (!err) { - P_RELE(pno); nd->nd_amcnt++; + /* * Must go back top and retry with this - * new pnode. + * new pnode as parent. */ continue; } @@ -426,7 +427,7 @@ _sysio_path_walk(struct pnode *parent, s * On error, we will want to drop our reference to the current * path node if at end. */ - if (err) { + if (err && nd->nd_pno) { P_RELE(nd->nd_pno); nd->nd_pno = NULL; } |