Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b0a17f5 authored by wang di's avatar wang di Committed by Greg Kroah-Hartman
Browse files

staging: lustre: llite: check request != NULL in ll_migrate



Check if the request is NULL, before retrieve reply body
from the request.

Signed-off-by: default avatarwang 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: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b96dea60
Loading
Loading
Loading
Loading
+23 −18
Original line number Diff line number Diff line
@@ -2667,6 +2667,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
	if (!rc)
		ll_update_times(request, parent);

	if (request) {
		body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
		if (!body) {
			rc = -EPROTO;
@@ -2679,16 +2680,20 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
		 */
		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);
			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);
	}
	/* 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 */