Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Browse files Browse the repository at this point in the history
Pull SCSI target fixes from Nicholas Bellinger:
 "This includes the bug-fix for a >= v3.8-rc1 regression specific to
  iscsi-target persistent reservation conflict handling (CC'ed to
  stable), and a tcm_vhost patch to drop VIRTIO_RING_F_EVENT_IDX usage
  so that in-flight qemu vhost-scsi-pci device code can detect the
  proper vhost feature bits.

  Also, there are two more tcm_vhost patches still being discussed by
  MST and Asias for v3.9 that will be required for the in-flight qemu
  vhost-scsi-pci device patch to function properly, and that should
  (hopefully) be the last target fixes for this round."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Fix RESERVATION_CONFLICT status regression for iscsi-target special case
  tcm_vhost: Avoid VIRTIO_RING_F_EVENT_IDX feature bit
  • Loading branch information
torvalds committed Mar 30, 2013
2 parents 46a1f21 + f85eda8 commit 13d2080
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,10 @@ target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb)
return ret;

ret = target_check_reservation(cmd);
if (ret)
if (ret) {
cmd->scsi_status = SAM_STAT_RESERVATION_CONFLICT;
return ret;
}

ret = dev->transport->parse_cdb(cmd);
if (ret)
Expand Down
13 changes: 11 additions & 2 deletions drivers/vhost/tcm_vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ enum {
VHOST_SCSI_VQ_IO = 2,
};

/*
* VIRTIO_RING_F_EVENT_IDX seems broken. Not sure the bug is in
* kernel but disabling it helps.
* TODO: debug and remove the workaround.
*/
enum {
VHOST_SCSI_FEATURES = VHOST_FEATURES & (~VIRTIO_RING_F_EVENT_IDX)
};

#define VHOST_SCSI_MAX_TARGET 256
#define VHOST_SCSI_MAX_VQ 128

Expand Down Expand Up @@ -946,7 +955,7 @@ static void vhost_scsi_flush(struct vhost_scsi *vs)

static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)
{
if (features & ~VHOST_FEATURES)
if (features & ~VHOST_SCSI_FEATURES)
return -EOPNOTSUPP;

mutex_lock(&vs->dev.mutex);
Expand Down Expand Up @@ -992,7 +1001,7 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
return 0;
case VHOST_GET_FEATURES:
features = VHOST_FEATURES;
features = VHOST_SCSI_FEATURES;
if (copy_to_user(featurep, &features, sizeof features))
return -EFAULT;
return 0;
Expand Down

0 comments on commit 13d2080

Please sign in to comment.