This patch fixes the sanityn test_41i OBD_FAIL_MDS_REINT_OPEN2 race
scenario.
With the "LU-15546 mdt: mdt_reint_open lookup before locking" patch,
we have to force taking a LCK_PR for OBD_FAIL_MDS_REINT_OPEN2 to test
the full lock cycle:
- take PR parent lock
- lockup child (do not exist)
- take PW parent lock
- re-lookup
- create child
Otherwise cfs_race() timeouts because PW lock requests from the 2
threads conflict with each other.
Fixes: f14090e ("LU-15546 mdt: mdt_reint_open lookup before locking")
Test-Parameters: trivial testlist=sanityn
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: Ifb9a44dcad610281c9d7d2a90bb8704420379819
if (!(open_flags & MDS_OPEN_CREAT))
return LCK_PR;
+ /* Force a full lock cycle: LCK_PR -> LCK_PW */
+ if (OBD_FAIL_PRECHECK(OBD_FAIL_MDS_REINT_OPEN2))
+ return LCK_PR;
+
result = mdo_lookup(info->mti_env, mdt_object_child(p), name, &fid,
&info->mti_spec);