From fa83c88938a87f6bb90419a13aa407be79c6ee14 Mon Sep 17 00:00:00 2001 From: wangdi Date: Wed, 9 Mar 2005 08:01:06 +0000 Subject: [PATCH] Branch: HEAD Log: we should lock the ino not fid in mds_lock_new_child, for protect ino being reused after unlink. b:5843 r:alex --- lustre/mds/mds_open.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 3a8fd77..9d947a1 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -789,24 +789,11 @@ int mds_pin(struct ptlrpc_request *req, int offset) int mds_lock_new_child(struct obd_device *obd, struct inode *inode, struct lustre_handle *child_lockh) { - struct ldlm_res_id child_res_id = { .name = { 0, 0, 0, 0 } }; + struct ldlm_res_id child_res_id = { .name = { inode->i_ino, 0, 1, 0 } }; struct lustre_handle lockh; - struct lustre_id sid; int lock_flags = 0; int rc; - down(&inode->i_sem); - rc = mds_read_inode_sid(obd, inode, &sid); - up(&inode->i_sem); - if (rc) { - CERROR("Can't read inode self id, err = %d\n", rc); - RETURN(rc); - } - - child_res_id.name[0] = id_fid(&sid); - child_res_id.name[1] = id_group(&sid); - child_res_id.name[2] = 1; - if (child_lockh == NULL) child_lockh = &lockh; -- 1.8.3.1