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

Commit 8a7298b7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull target fixes from Nicholas Bellinger:
 "This includes a bugfix from MDR to address a NULL pointer OOPs with
  FCoE aborts, along with a WRITE_SAME emulation bugfix for NOLB=0
  cases, and persistent reservation return cleanups from Roland.

  All three patches are CC'ed to stable."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Fix range calculation in WRITE SAME emulation when num blocks == 0
  target: Clean up returning errors in PR handling code
  tcm_fc: Fix crash seen with aborts and large reads
parents b1bdd2eb 1765fe5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1095,7 +1095,7 @@ int target_emulate_write_same(struct se_cmd *cmd)
	if (num_blocks != 0)
		range = num_blocks;
	else
		range = (dev->transport->get_blocks(dev) - lba);
		range = (dev->transport->get_blocks(dev) - lba) + 1;

	pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n",
		 (unsigned long long)lba, (unsigned long long)range);
+4 −3
Original line number Diff line number Diff line
@@ -2031,7 +2031,7 @@ static int __core_scsi3_write_aptpl_to_file(
	if (IS_ERR(file) || !file || !file->f_dentry) {
		pr_err("filp_open(%s) for APTPL metadata"
			" failed\n", path);
		return (PTR_ERR(file) < 0 ? PTR_ERR(file) : -ENOENT);
		return IS_ERR(file) ? PTR_ERR(file) : -ENOENT;
	}

	iov[0].iov_base = &buf[0];
@@ -3818,7 +3818,7 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd)
			" SPC-2 reservation is held, returning"
			" RESERVATION_CONFLICT\n");
		cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT;
		ret = EINVAL;
		ret = -EINVAL;
		goto out;
	}

@@ -3828,7 +3828,8 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd)
	 */
	if (!cmd->se_sess) {
		cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
		return -EINVAL;
		ret = -EINVAL;
		goto out;
	}

	if (cmd->data_length < 24) {
+2 −0
Original line number Diff line number Diff line
@@ -230,6 +230,8 @@ u32 ft_get_task_tag(struct se_cmd *se_cmd)
{
	struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd);

	if (cmd->aborted)
		return ~0;
	return fc_seq_exch(cmd->seq)->rxid;
}