diff options
author | Niu Yawei <yawei.niu@intel.com> | 2017-02-11 12:12:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-12 13:13:06 +0100 |
commit | de51919c9a0297345d520de0ec2baee4bf5ddc87 (patch) | |
tree | 0562779d0e053a556b173e82b5756c9d19a28424 /drivers/staging/lustre | |
parent | staging: lustre: llite: root inode checking for migration (diff) | |
download | linux-de51919c9a0297345d520de0ec2baee4bf5ddc87.tar.gz linux-de51919c9a0297345d520de0ec2baee4bf5ddc87.tar.bz2 linux-de51919c9a0297345d520de0ec2baee4bf5ddc87.zip |
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: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8807
Reviewed-on: https://review.whamcloud.com/23666
Reviewed-by: Andreas Dilger <andreas.dilger@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>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 271608df9158..10adfcdd7035 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2664,15 +2664,12 @@ again: 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) + if (!rc) { + LASSERT(request); ll_update_times(request, parent); - if (request) { body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY); - if (!body) { - rc = -EPROTO; - goto out_close; - } + LASSERT(body); /* * If the server does release layout lock, then we cleanup @@ -2686,14 +2683,17 @@ again: kfree(och); och = NULL; } + } + if (request) { ptlrpc_req_finished(request); + request = NULL; } + /* 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)) goto again; - } + out_close: if (och) /* close the file */ ll_lease_close(och, child_inode, NULL); |