if (rc == 0)
ll_update_times(request, parent);
- body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
- if (body == NULL)
- GOTO(out_free, rc = -EPROTO);
-
- /* If the server does release layout lock, then we cleanup
- * the client och here, otherwise release it in out_free: */
- if (och != NULL && body->mbo_valid & OBD_MD_CLOSE_INTENT_EXECED) {
- obd_mod_put(och->och_mod);
- md_clear_open_replay_data(ll_i2sbi(parent)->ll_md_exp, och);
- och->och_fh.cookie = DEAD_HANDLE_MAGIC;
- OBD_FREE_PTR(och);
- och = NULL;
+ if (request != NULL) {
+ body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
+ if (body == NULL) {
+ ptlrpc_req_finished(request);
+ GOTO(out_free, rc = -EPROTO);
+ }
+
+ /* If the server does release layout lock, then we cleanup
+ * the client och here, otherwise release it in out_free: */
+ if (och != NULL &&
+ body->mbo_valid & OBD_MD_CLOSE_INTENT_EXECED) {
+ obd_mod_put(och->och_mod);
+ md_clear_open_replay_data(ll_i2sbi(parent)->ll_md_exp,
+ och);
+ och->och_fh.cookie = DEAD_HANDLE_MAGIC;
+ OBD_FREE_PTR(och);
+ och = NULL;
+ }
+ ptlrpc_req_finished(request);
}
- ptlrpc_req_finished(request);
/* Try again if the file layout has changed. */
- if (rc == -EAGAIN && S_ISREG(child_inode->i_mode))
+ if (rc == -EAGAIN && S_ISREG(child_inode->i_mode)) {
+ request = NULL;
goto again;
+ }
out_free:
if (child_inode != NULL) {
if (och != NULL) /* close the file */
}
run_test 230f "migrate mulitple remote link files"
+test_230g() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ mkdir -p $DIR/$tdir/migrate_dir
+
+ $LFS migrate -m 1000 $DIR/$tdir/migrate_dir &&
+ error "migrating dir to non-exist MDT succeeds"
+ true
+}
+run_test 230g "migrate dir to non-exist MDT"
+
test_231a()
{
# For simplicity this test assumes that max_pages_per_rpc