Whamcloud - gitweb
b=6379
authoralex <alex>
Tue, 31 May 2005 11:20:31 +0000 (11:20 +0000)
committeralex <alex>
Tue, 31 May 2005 11:20:31 +0000 (11:20 +0000)
 - even a simpler fix: just skip removal if orphan is already unlinked
   semaphore on pending dir should be enough

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

index 645d2aa..668cd75 100644 (file)
@@ -1434,8 +1434,6 @@ 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" */
@@ -1475,7 +1473,10 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,
                                                idlen);
                 if (IS_ERR(pending_child))
                         GOTO(cleanup, rc = PTR_ERR(pending_child));
-                LASSERT(pending_child->d_inode != NULL);
+                if (pending_child->d_inode == NULL) {
+                        CERROR("orphan %s has been removed\n", idname);
+                        GOTO(cleanup, rc = 0);
+                }
 
                 cleanup_phase = 2; /* dput(pending_child) when finished */
                 if (S_ISDIR(pending_child->d_inode->i_mode)) {
index 28fe66d..b1a171e 100644 (file)
@@ -241,12 +241,6 @@ int mds_cleanup_orphans(struct obd_device *obd)
                         CWARN("orphan %s re-opened during recovery\n", d_name);
                         GOTO(next, rc = 0);
                 }
-                if (!mds_inode_is_orphan(child_inode)) {
-                        UP_READ_I_ALLOC_SEM(child_inode);
-                        CWARN("orphan %s has been removed by CLOSE\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) {