提交 8a7298b7 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

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
...@@ -1095,7 +1095,7 @@ int target_emulate_write_same(struct se_cmd *cmd) ...@@ -1095,7 +1095,7 @@ int target_emulate_write_same(struct se_cmd *cmd)
if (num_blocks != 0) if (num_blocks != 0)
range = num_blocks; range = num_blocks;
else 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", pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n",
(unsigned long long)lba, (unsigned long long)range); (unsigned long long)lba, (unsigned long long)range);
......
...@@ -2031,7 +2031,7 @@ static int __core_scsi3_write_aptpl_to_file( ...@@ -2031,7 +2031,7 @@ static int __core_scsi3_write_aptpl_to_file(
if (IS_ERR(file) || !file || !file->f_dentry) { if (IS_ERR(file) || !file || !file->f_dentry) {
pr_err("filp_open(%s) for APTPL metadata" pr_err("filp_open(%s) for APTPL metadata"
" failed\n", path); " 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]; iov[0].iov_base = &buf[0];
...@@ -3818,7 +3818,7 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd) ...@@ -3818,7 +3818,7 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd)
" SPC-2 reservation is held, returning" " SPC-2 reservation is held, returning"
" RESERVATION_CONFLICT\n"); " RESERVATION_CONFLICT\n");
cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT; cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT;
ret = EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -3828,7 +3828,8 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd) ...@@ -3828,7 +3828,8 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd)
*/ */
if (!cmd->se_sess) { if (!cmd->se_sess) {
cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
return -EINVAL; ret = -EINVAL;
goto out;
} }
if (cmd->data_length < 24) { if (cmd->data_length < 24) {
......
...@@ -230,6 +230,8 @@ u32 ft_get_task_tag(struct se_cmd *se_cmd) ...@@ -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); 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; return fc_seq_exch(cmd->seq)->rxid;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册