Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 31 Jan 2014 23:31:23 +0000 (15:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 31 Jan 2014 23:31:23 +0000 (15:31 -0800)
Pull SCSI target updates from Nicholas Bellinger:
 "The highlights this round include:

  - add support for SCSI Referrals (Hannes)
  - add support for T10 DIF into target core (nab + mkp)
  - add support for T10 DIF emulation in FILEIO + RAMDISK backends (Sagi + nab)
  - add support for T10 DIF -> bio_integrity passthrough in IBLOCK backend (nab)
  - prep changes to iser-target for >= v3.15 T10 DIF support (Sagi)
  - add support for qla2xxx N_Port ID Virtualization - NPIV (Saurav + Quinn)
  - allow percpu_ida_alloc() to receive task state bitmask (Kent)
  - fix >= v3.12 iscsi-target session reset hung task regression (nab)
  - fix >= v3.13 percpu_ref se_lun->lun_ref_active race (nab)
  - fix a long-standing network portal creation race (Andy)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (51 commits)
  target: Fix percpu_ref_put race in transport_lun_remove_cmd
  target/iscsi: Fix network portal creation race
  target: Report bad sector in sense data for DIF errors
  iscsi-target: Convert gfp_t parameter to task state bitmask
  iscsi-target: Fix connection reset hang with percpu_ida_alloc
  percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask
  iscsi-target: Pre-allocate more tags to avoid ack starvation
  qla2xxx: Configure NPIV fc_vport via tcm_qla2xxx_npiv_make_lport
  qla2xxx: Enhancements to enable NPIV support for QLOGIC ISPs with TCM/LIO.
  qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure
  IB/isert: pass scatterlist instead of cmd to fast_reg_mr routine
  IB/isert: Move fastreg descriptor creation to a function
  IB/isert: Avoid frwr notation, user fastreg
  IB/isert: seperate connection protection domains and dma MRs
  tcm_loop: Enable DIF/DIX modes in SCSI host LLD
  target/rd: Add DIF protection into rd_execute_rw
  target/rd: Add support for protection SGL setup + release
  target/rd: Refactor rd_build_device_space + rd_release_device_space
  target/file: Add DIF protection support to fd_execute_rw
  target/file: Add DIF protection init/format support
  ...

12 files changed:
1  2 
drivers/infiniband/ulp/isert/ib_isert.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_target.c
drivers/target/iscsi/iscsi_target.c
drivers/target/target_core_device.c
drivers/target/target_core_file.c
drivers/target/target_core_file.h
drivers/target/target_core_iblock.c
drivers/target/target_core_tpg.c
drivers/vhost/scsi.c
include/target/target_core_base.h

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 2d29356d0c85a076e90db99bbda9f1a428f9c336,293d9b081e8a9be9a754774a754a931fb561e4ec..554d4f75a75a6263ac7fb731804f787af64731ac
@@@ -586,6 -621,51 +621,51 @@@ static ssize_t iblock_show_configfs_dev
        return bl;
  }
  
 -      bip->bip_size = (cmd->data_length / dev->dev_attrib.block_size) *
+ static int
+ iblock_alloc_bip(struct se_cmd *cmd, struct bio *bio)
+ {
+       struct se_device *dev = cmd->se_dev;
+       struct blk_integrity *bi;
+       struct bio_integrity_payload *bip;
+       struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
+       struct scatterlist *sg;
+       int i, rc;
+       bi = bdev_get_integrity(ib_dev->ibd_bd);
+       if (!bi) {
+               pr_err("Unable to locate bio_integrity\n");
+               return -ENODEV;
+       }
+       bip = bio_integrity_alloc(bio, GFP_NOIO, cmd->t_prot_nents);
+       if (!bip) {
+               pr_err("Unable to allocate bio_integrity_payload\n");
+               return -ENOMEM;
+       }
 -      bip->bip_sector = bio->bi_sector;
++      bip->bip_iter.bi_size = (cmd->data_length / dev->dev_attrib.block_size) *
+                        dev->prot_length;
 -      pr_debug("IBLOCK BIP Size: %u Sector: %llu\n", bip->bip_size,
 -               (unsigned long long)bip->bip_sector);
++      bip->bip_iter.bi_sector = bio->bi_iter.bi_sector;
++      pr_debug("IBLOCK BIP Size: %u Sector: %llu\n", bip->bip_iter.bi_size,
++               (unsigned long long)bip->bip_iter.bi_sector);
+       for_each_sg(cmd->t_prot_sg, sg, cmd->t_prot_nents, i) {
+               rc = bio_integrity_add_page(bio, sg_page(sg), sg->length,
+                                           sg->offset);
+               if (rc != sg->length) {
+                       pr_err("bio_integrity_add_page() failed; %d\n", rc);
+                       return -ENOMEM;
+               }
+               pr_debug("Added bio integrity page: %p length: %d offset; %d\n",
+                        sg_page(sg), sg->length, sg->offset);
+       }
+       return 0;
+ }
  static sense_reason_t
  iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
                  enum dma_data_direction data_direction)
index 2a573de19a9fdceea07d233f15a699be6c10c770,d1df39a05d885edaa46c1ba3d0e1742299913ae5..c036595b17cfc9cfc75f9bd57d146bfb4179d67b
@@@ -656,9 -658,15 +656,9 @@@ static int core_tpg_setup_virtual_lun0(
        spin_lock_init(&lun->lun_sep_lock);
        init_completion(&lun->lun_ref_comp);
  
-       ret = core_tpg_post_addlun(se_tpg, lun, lun_access, dev);
 -      ret = percpu_ref_init(&lun->lun_ref, core_tpg_lun_ref_release);
 -      if (ret < 0)
 -              return ret;
 -
+       ret = core_tpg_add_lun(se_tpg, lun, lun_access, dev);
 -      if (ret < 0) {
 -              percpu_ref_cancel_init(&lun->lun_ref);
 +      if (ret < 0)
                return ret;
 -      }
  
        return 0;
  }
Simple merge
Simple merge