if (req)
ptlrpc_req_finished(req);
- spin_lock(&d->opd_pre_lock);
- d->opd_pre_recovering = 0;
- spin_unlock(&d->opd_pre_lock);
-
/*
* If rc is zero, the pre-creation window should have been emptied.
* Since waking up the herd would be useless without pre-created
} else {
wake_up(&d->opd_pre_user_waitq);
}
+ } else {
+ spin_lock(&d->opd_pre_lock);
+ d->opd_pre_recovering = 0;
+ spin_unlock(&d->opd_pre_lock);
}
RETURN(rc);
* need to be connected to OST
*/
while (osp_precreate_running(d)) {
+ if (d->opd_pre_recovering &&
+ d->opd_imp_connected)
+ break;
l_wait_event(d->opd_pre_waitq,
!osp_precreate_running(d) ||
d->opd_new_connection,
* Clean up orphans or recreate missing objects.
*/
rc = osp_precreate_cleanup_orphans(&env, d);
- if (rc != 0)
+ if (rc != 0) {
+ schedule_timeout_interruptible(cfs_time_seconds(1));
continue;
+ }
/*
* connected, can handle precreates now
*/
}
run_test 100 "check lshowmount lists MGS, MDT, OST and 0@lo"
+test_101() {
+ local createmany_oid
+ local dev=$FSNAME-OST0000-osc-MDT0000
+ setup
+
+ createmany -o $DIR1/$tfile-%d 50000 &
+ createmany_oid=$!
+ # MDT->OST reconnection causes MDT<->OST last_id synchornisation
+ # via osp_precreate_cleanup_orphans.
+ for ((i = 0; i < 100; i++)); do
+ for ((k = 0; k < 10; k++)); do
+ do_facet $SINGLEMDS "$LCTL --device $dev deactivate;" \
+ "$LCTL --device $dev activate"
+ done
+
+ ls -asl $MOUNT | grep '???' &&
+ (kill -9 $createmany_oid &>/dev/null; \
+ error "File hasn't object on OST")
+
+ kill -s 0 $createmany_oid || break
+ done
+ wait $createmany_oid
+ cleanup
+}
+run_test 101 "Race MDT->OST reconnection with create"
+
if ! combined_mgs_mds ; then
stop mgs
fi