Whamcloud - gitweb
b=6379
authoralex <alex>
Sun, 29 May 2005 21:03:52 +0000 (21:03 +0000)
committeralex <alex>
Sun, 29 May 2005 21:03:52 +0000 (21:03 +0000)
 - drop orphan flag to prevent a race between mds_cleanup_orphans() and
   mds_mfd_close() when the both try to unlink the same orphan

lustre/mds/mds_open.c
lustre/mds/mds_unlink_open.c

index 57256fe..645d2aa 100644 (file)
@@ -1434,6 +1434,8 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,
 
         last_orphan = mds_orphan_open_dec_test(inode) &&
                 mds_inode_is_orphan(inode);
+        if (last_orphan && unlink_orphan)
+                mds_inode_unset_orphan(inode);
         UP_WRITE_I_ALLOC_SEM(inode);
 
         /* this is half of the actual "close" */
index 0e361b5..a3d8837 100644 (file)
@@ -242,6 +242,7 @@ int mds_cleanup_orphans(struct obd_device *obd)
                         CWARN("orphan %s re-opened during recovery\n", d_name);
                         GOTO(next, rc = 0);
                 }
+                mds_inode_unset_orphan(child_inode);
                 UP_READ_I_ALLOC_SEM(child_inode);
                 rc = mds_unlink_orphan(obd, dchild, child_inode, pending_dir);
                 if (rc == 0) {