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

Commit e255a285 authored by Nicholas Bellinger's avatar Nicholas Bellinger
Browse files

iscsi-target: Only perform wait_for_tasks when performing shutdown



This patch changes transport_generic_free_cmd() to only wait_for_tasks
when shutdown=true is passed to iscsit_free_cmd().

With the advent of >= v3.10 iscsi-target code using se_cmd->cmd_kref,
the extra wait_for_tasks with shutdown=false is unnecessary, and may
end up causing an extra context switch when releasing WRITEs.

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent db60df88
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -736,7 +736,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown)
		 * Fallthrough
		 */
	case ISCSI_OP_SCSI_TMFUNC:
		rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
		rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
		if (!rc && shutdown && se_cmd && se_cmd->se_sess) {
			__iscsit_free_cmd(cmd, true, shutdown);
			target_put_sess_cmd(se_cmd->se_sess, se_cmd);
@@ -752,7 +752,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown)
			se_cmd = &cmd->se_cmd;
			__iscsit_free_cmd(cmd, true, shutdown);

			rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
			rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
			if (!rc && shutdown && se_cmd->se_sess) {
				__iscsit_free_cmd(cmd, true, shutdown);
				target_put_sess_cmd(se_cmd->se_sess, se_cmd);