Commit de51919c authored by Niu Yawei's avatar Niu Yawei Committed by Greg Kroah-Hartman

staging: lustre: llite: check reply status in ll_migrate()

ll_migrate() should check reply status before trying to read
reply buffer, checking if request is NULL doesn't make sense.
Signed-off-by: default avatarNiu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8807
Reviewed-on: https://review.whamcloud.com/23666Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa2f4a3f
...@@ -2664,15 +2664,12 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, ...@@ -2664,15 +2664,12 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
op_data->op_cli_flags = CLI_MIGRATE; op_data->op_cli_flags = CLI_MIGRATE;
rc = md_rename(ll_i2sbi(parent)->ll_md_exp, op_data, name, rc = md_rename(ll_i2sbi(parent)->ll_md_exp, op_data, name,
namelen, name, namelen, &request); namelen, name, namelen, &request);
if (!rc) if (!rc) {
LASSERT(request);
ll_update_times(request, parent); ll_update_times(request, parent);
if (request) {
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY); body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
if (!body) { LASSERT(body);
rc = -EPROTO;
goto out_close;
}
/* /*
* If the server does release layout lock, then we cleanup * If the server does release layout lock, then we cleanup
...@@ -2686,14 +2683,17 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, ...@@ -2686,14 +2683,17 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
kfree(och); kfree(och);
och = NULL; och = NULL;
} }
}
if (request) {
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
request = NULL;
} }
/* 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)) { if (rc == -EAGAIN && S_ISREG(child_inode->i_mode))
request = NULL;
goto again; goto again;
}
out_close: out_close:
if (och) /* close the file */ if (och) /* close the file */
ll_lease_close(och, child_inode, NULL); ll_lease_close(och, child_inode, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment