ll_migrate() should check reply status before trying to read
reply buffer, checking if request is NULL doesn't make sense.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I585844e0c1118fad23f19791dc95e34bc0d6e38a
Reviewed-on: https://review.whamcloud.com/23666
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
op_data->op_cli_flags = CLI_MIGRATE;
rc = md_rename(ll_i2sbi(parent)->ll_md_exp, op_data, name,
namelen, name, namelen, &request);
op_data->op_cli_flags = CLI_MIGRATE;
rc = md_rename(ll_i2sbi(parent)->ll_md_exp, op_data, name,
namelen, name, namelen, &request);
+ if (rc == 0) {
+ LASSERT(request != NULL);
ll_update_times(request, parent);
ll_update_times(request, parent);
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
- if (body == NULL) {
- ptlrpc_req_finished(request);
- GOTO(out_close, rc = -EPROTO);
- }
/* If the server does release layout lock, then we cleanup
* the client och here, otherwise release it in out_close: */
/* If the server does release layout lock, then we cleanup
* the client och here, otherwise release it in out_close: */
OBD_FREE_PTR(och);
och = NULL;
}
OBD_FREE_PTR(och);
och = NULL;
}
+ }
+
+ if (request != NULL) {
ptlrpc_req_finished(request);
ptlrpc_req_finished(request);
}
/* Try again if the file layout has changed. */
}
/* Try again if the file layout has changed. */
- if (rc == -EAGAIN && S_ISREG(child_inode->i_mode)) {
- request = NULL;
+ if (rc == -EAGAIN && S_ISREG(child_inode->i_mode))
out_close:
if (och != NULL) /* close the file */
ll_lease_close(och, child_inode, NULL);
out_close:
if (och != NULL) /* close the file */
ll_lease_close(och, child_inode, NULL);