Author: kevlo
Date: Mon Oct 25 06:16:27 2010
New Revision: 214316
URL: http://svn.freebsd.org/changeset/base/214316

Log:
  MFC r214001:
  Fix a possible, but very unlikely race where the directory dirent is
  moved to the location that was used by ".." entry.

Modified:
  stable/8/sys/fs/msdosfs/msdosfs_lookup.c

Modified: stable/8/sys/fs/msdosfs/msdosfs_lookup.c
==============================================================================
--- stable/8/sys/fs/msdosfs/msdosfs_lookup.c    Mon Oct 25 05:37:12 2010        
(r214315)
+++ stable/8/sys/fs/msdosfs/msdosfs_lookup.c    Mon Oct 25 06:16:27 2010        
(r214316)
@@ -594,10 +594,15 @@ msdosfs_deget_dotdot(struct vnode *vp, u
        vfs_unbusy(mp);
        if (error == 0)
                *rvp = DETOV(rdp);
-       vn_lock(vp, ltype | LK_RETRY);
+       if (*rvp != vp)
+               vn_lock(vp, ltype | LK_RETRY);
        if (vp->v_iflag & VI_DOOMED) {
-               if (error == 0)
-                       vput(*rvp);
+               if (error == 0) {
+                       if (*rvp == vp)
+                               vunref(*rvp);
+                       else
+                               vput(*rvp);
+               }
                error = ENOENT;
        }
        return (error);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to