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

Commit 620f086d authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lmv: release locks if lmv_intent_lock() fails



In lmv_intent_lock() if we will return an error then first release any
locks referenced by the intent.

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5431
Reviewed-on: http://review.whamcloud.com/11319


Reviewed-by: default avatarwang di <di.wang@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@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 60deafea
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -533,5 +533,27 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
				     extra_lock_flags);
	else
		LBUG();

	if (rc < 0) {
		struct lustre_handle lock_handle;

		if (it->it_lock_mode) {
			lock_handle.cookie = it->it_lock_handle;
			ldlm_lock_decref(&lock_handle, it->it_lock_mode);
		}

		it->it_lock_handle = 0;
		it->it_lock_mode = 0;

		if (it->it_remote_lock_mode) {
			lock_handle.cookie = it->it_remote_lock_handle;
			ldlm_lock_decref(&lock_handle,
					 it->it_remote_lock_mode);
		}

		it->it_remote_lock_handle = 0;
		it->it_remote_lock_mode = 0;
	}

	return rc;
}