From 25aa42fd349e64d3806cb009be65301977657577 Mon Sep 17 00:00:00 2001 From: anserper Date: Thu, 28 Aug 2008 14:26:51 +0000 Subject: [PATCH] Branch b1_8_gate b=16676 i=Johann Lombardi (johann@sun.com) i=Zhenyu Xu (zhenyu.xu@sun.com) add inode locking around vfs-calling critical sections --- lustre/mds/mds_open.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 6c40f13..4c26413 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -1095,7 +1095,9 @@ int mds_open(struct mds_update_record *rec, int offset, dp.ldp_ptr = req; dp.ldp_inum = ino; + LOCK_INODE_MUTEX(dparent->d_inode); rc = ll_vfs_create(dparent->d_inode, dchild, rec->ur_mode,NULL); + UNLOCK_INODE_MUTEX(dparent->d_inode); if (dchild->d_fsdata == (void *)(unsigned long)ino) dchild->d_fsdata = NULL; @@ -1272,8 +1274,11 @@ found_child: ldlm_lock_decref(child_lockh, child_mode); case 2: if (rc && created) { - int err = ll_vfs_unlink(dparent->d_inode, dchild, - mds->mds_vfsmnt); + int err; + LOCK_INODE_MUTEX(dparent->d_inode); + err = ll_vfs_unlink(dparent->d_inode, dchild, + mds->mds_vfsmnt); + UNLOCK_INODE_MUTEX(dparent->d_inode); if (err) { CERROR("unlink(%.*s) in error path: %d\n", dchild->d_name.len, dchild->d_name.name, -- 1.8.3.1