From: Oleg Drokin Date: Wed, 5 May 2010 23:35:58 +0000 (-0400) Subject: b=22522 do not remove from res_list without locks X-Git-Tag: 1.10.0.42~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=33b43d1fea4ef3b603ab6952b6965171e948ef73 b=22522 do not remove from res_list without locks Patch in bug 21501 moved list manipulation of res_list outside or res_lock introducing a race window in flock code. Move it back under the lock. i=rread i=adilger --- diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 914ed4e..8e17167 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -605,10 +605,10 @@ granted: cfs_list_del_init(&lock->l_flock_waitq); cfs_spin_unlock(&ldlm_flock_waitq_lock); + lock_res_and_lock(lock); /* ldlm_lock_enqueue() has already placed lock on the granted list. */ cfs_list_del_init(&lock->l_res_link); - lock_res_and_lock(lock); if (flags & LDLM_FL_TEST_LOCK) { /* fcntl(F_GETLK) request */ /* The old mode was saved in getlk->fl_type so that if the mode