From: alex Date: Tue, 31 May 2005 11:20:31 +0000 (+0000) Subject: b=6379 X-Git-Tag: v1_7_100~1242 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=edeae493adff6d1ff47497f4d8e28b3baf06dd62 b=6379 - even a simpler fix: just skip removal if orphan is already unlinked semaphore on pending dir should be enough --- diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 645d2aa..668cd75 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -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)) { diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index 28fe66d..b1a171e 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -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) {