Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1579040
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] staging: lustre: llite: check request != NULL in ll_migrate |
| Date | 2017-02-11 18:20 +0100 |
| Message-ID | <t9Jv4-3qG-25@gated-at.bofh.it> (permalink) |
| References | <t9Jv3-3qG-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: wang di <di.wang@intel.com>
Check if the request is NULL, before retrieve reply body
from the request.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7396
Reviewed-on: http://review.whamcloud.com/17079
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/lustre/llite/file.c | 41 +++++++++++++++++-------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 9870901..0c83bd7 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2667,28 +2667,33 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
if (!rc)
ll_update_times(request, parent);
- body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
- if (!body) {
- rc = -EPROTO;
- goto out_free;
- }
+ if (request) {
+ body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
+ if (!body) {
+ rc = -EPROTO;
+ goto out_free;
+ }
- /*
- * If the server does release layout lock, then we cleanup
- * the client och here, otherwise release it in out_free:
- */
- if (och && 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;
- kfree(och);
- och = NULL;
- }
+ /*
+ * If the server does release layout lock, then we cleanup
+ * the client och here, otherwise release it in out_free:
+ */
+ if (och && 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;
+ kfree(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) {
if (och) /* close the file */
--
1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] staging: lustre: llite: fixups for ll_migrate() James Simmons <jsimmons@infradead.org> - 2017-02-11 18:20 +0100
[PATCH 2/3] staging: lustre: llite: root inode checking for migration James Simmons <jsimmons@infradead.org> - 2017-02-11 18:20 +0100
Re: [PATCH 2/3] staging: lustre: llite: root inode checking for migration Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-12 13:20 +0100
[PATCH 1/3] staging: lustre: llite: check request != NULL in ll_migrate James Simmons <jsimmons@infradead.org> - 2017-02-11 18:20 +0100
[PATCH 3/3] staging: lustre: llite: check reply status in ll_migrate() James Simmons <jsimmons@infradead.org> - 2017-02-11 18:20 +0100
csiph-web