#define OBD_FAIL_LLITE_PCC_ATTACH_PAUSE 0x1414
#define OBD_FAIL_LLITE_SHORT_COMMIT 0x1415
#define OBD_FAIL_LLITE_CREATE_FILE_PAUSE2 0x1416
+#define OBD_FAIL_LLITE_RACE_MOUNT 0x1417
#define OBD_FAIL_FID_INDIR 0x1501
#define OBD_FAIL_FID_INLMA 0x1502
CDEBUG(D_VFSTRACE, "VFS Op: cfg_instance %s-%016lx (sb %p)\n",
profilenm, cfg_instance, sb);
+ OBD_RACE(OBD_FAIL_LLITE_RACE_MOUNT);
+
OBD_ALLOC_PTR(cfg);
if (cfg == NULL)
GOTO(out_free_cfg, err = -ENOMEM);
EXPORT_SYMBOL(cl_lvb2attr);
static struct cl_env cl_env_percpu[NR_CPUS];
+static DEFINE_MUTEX(cl_env_percpu_mutex);
static int cl_env_percpu_init(void)
{
{
int i;
+ mutex_lock(&cl_env_percpu_mutex);
for_each_possible_cpu(i)
lu_env_refill(&cl_env_percpu[i].ce_lu);
+ mutex_unlock(&cl_env_percpu_mutex);
}
void cl_env_percpu_put(struct lu_env *env)
}
run_test 108a "lseek: parallel updates"
+# LU-14110
+test_109() {
+ local i
+ local pid1 pid2
+
+ umount_client $MOUNT
+ umount_client $MOUNT2
+
+ echo "Starting race between client mount instances (50 iterations):"
+ for i in {1..50}; do
+ log "Iteration $i"
+
+#define OBD_FAIL_ONCE|OBD_FAIL_LLITE_RACE_MOUNT 0x80001417
+ $LCTL set_param -n fail_loc=0x80001417
+
+ mount_client $MOUNT & pid1=$!
+ mount_client $MOUNT2 & pid2=$!
+ wait $pid1 || error "Mount $MOUNT fails with $?"
+ wait $pid2 || error "Mount $MOUNT2 fails with $?"
+
+ umount_client $MOUNT & pid1=$!
+ umount_client $MOUNT2 & pid2=$!
+ wait $pid1 || error "Umount $MOUNT fails with $?"
+ wait $pid2 || error "Umount $MOUNT2 fails with $?"
+
+ $LUSTRE_RMMOD || error "Fail to remove lustre modules"
+ load_modules
+ echo
+ done
+
+ mount_client $MOUNT
+ mount_client $MOUNT2
+}
+
+run_test 109 "Race with several mount instances on 1 node"
+
log "cleanup: ======================================================"
# kill and wait in each test only guarentee script finish, but command in script