Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 22:37:51 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 22:37:51 +0000 (15:37 -0700)
Pull block driver updates from Jens Axboe:
 "This branch also contains core changes.  I've come to the conclusion
  that from 4.9 and forward, I'll be doing just a single branch.  We
  often have dependencies between core and drivers, and it's hard to
  always split them up appropriately without pulling core into drivers
  when that happens.

  That said, this contains:

   - separate secure erase type for the core block layer, from
     Christoph.

   - set of discard fixes, from Christoph.

   - bio shrinking fixes from Christoph, as a followup up to the
     op/flags change in the core branch.

   - map and append request fixes from Christoph.

   - NVMeF (NVMe over Fabrics) code from Christoph.  This is pretty
     exciting!

   - nvme-loop fixes from Arnd.

   - removal of ->driverfs_dev from Dan, after providing a
     device_add_disk() helper.

   - bcache fixes from Bhaktipriya and Yijing.

   - cdrom subchannel read fix from Vchannaiah.

   - set of lightnvm updates from Wenwei, Matias, Johannes, and Javier.

   - set of drbd updates and fixes from Fabian, Lars, and Philipp.

   - mg_disk error path fix from Bart.

   - user notification for failed device add for loop, from Minfei.

   - NVMe in general:
        + NVMe delay quirk from Guilherme.
        + SR-IOV support and command retry limits from Keith.
        + fix for memory-less NUMA node from Masayoshi.
        + use UINT_MAX for discard sectors, from Minfei.
        + cancel IO fixes from Ming.
        + don't allocate unused major, from Neil.
        + error code fixup from Dan.
        + use constants for PSDT/FUSE from James.
        + variable init fix from Jay.
        + fabrics fixes from Ming, Sagi, and Wei.
        + various fixes"

* 'for-4.8/drivers' of git://git.kernel.dk/linux-block: (115 commits)
  nvme/pci: Provide SR-IOV support
  nvme: initialize variable before logical OR'ing it
  block: unexport various bio mapping helpers
  scsi/osd: open code blk_make_request
  target: stop using blk_make_request
  block: simplify and export blk_rq_append_bio
  block: ensure bios return from blk_get_request are properly initialized
  virtio_blk: use blk_rq_map_kern
  memstick: don't allow REQ_TYPE_BLOCK_PC requests
  block: shrink bio size again
  block: simplify and cleanup bvec pool handling
  block: get rid of bio_rw and READA
  block: don't ignore -EOPNOTSUPP blkdev_issue_write_same
  block: introduce BLKDEV_DISCARD_ZERO to fix zeroout
  NVMe: don't allocate unused nvme_major
  nvme: avoid crashes when node 0 is memoryless node.
  nvme: Limit command retries
  loop: Make user notify for adding loop device failed
  nvme-loop: fix nvme-loop Kconfig dependencies
  nvmet: fix return value check in nvmet_subsys_alloc()
  ...

22 files changed:
1  2 
MAINTAINERS
block/bio-integrity.c
block/blk-core.c
block/blk-lib.c
block/blk-merge.c
block/blk-mq.c
block/genhd.c
drivers/block/brd.c
drivers/block/drbd/drbd_int.h
drivers/block/xen-blkfront.c
drivers/mmc/card/block.c
drivers/nvdimm/pmem.c
drivers/nvme/host/core.c
drivers/nvme/host/pci.c
drivers/s390/block/dcssblk.c
drivers/scsi/sd.c
fs/buffer.c
fs/gfs2/dir.c
include/linux/bio.h
include/linux/blk_types.h
include/linux/blkdev.h
kernel/trace/blktrace.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
diff --cc block/blk-lib.c
index 9031d2af0b47c4210fe1db182545e1a806def18b,e371f83a31868e0a4ec9d846cccab07b7a5a5bd0..083e56f72308e7ebed8721ba300eb59c22f953cf
@@@ -113,9 -121,8 +121,9 @@@ int blkdev_issue_discard(struct block_d
                        &bio);
        if (!ret && bio) {
                ret = submit_bio_wait(bio);
-               if (ret == -EOPNOTSUPP)
+               if (ret == -EOPNOTSUPP && !(flags & BLKDEV_DISCARD_ZERO))
                        ret = 0;
 +              bio_put(bio);
        }
        blk_finish_plug(&plug);
  
@@@ -169,11 -176,9 +177,11 @@@ int blkdev_issue_write_same(struct bloc
                }
        }
  
 -      if (bio)
 +      if (bio) {
                ret = submit_bio_wait(bio);
-       return ret != -EOPNOTSUPP ? ret : 0;
 +              bio_put(bio);
 +      }
+       return ret;
  }
  EXPORT_SYMBOL(blkdev_issue_write_same);
  
Simple merge
diff --cc block/blk-mq.c
Simple merge
diff --cc block/genhd.c
Simple merge
Simple merge
Simple merge
index da05d3f9bad206b193135e44b7c979894b50e42a,89525d10d1a7bcc963c5662058b8e1041d347423..0b6682a33e3b836e35a70aa5ba445f8083017f8f
@@@ -2089,40 -2142,6 +2088,43 @@@ static int blkfront_resume(struct xenbu
  
        dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename);
  
-                           shadow[j].request->cmd_flags & (REQ_FUA | REQ_SECURE)) {
-                           
 +      bio_list_init(&info->bio_list);
 +      INIT_LIST_HEAD(&info->requests);
 +      for (i = 0; i < info->nr_rings; i++) {
 +              struct blkfront_ring_info *rinfo = &info->rinfo[i];
 +              struct bio_list merge_bio;
 +              struct blk_shadow *shadow = rinfo->shadow;
 +
 +              for (j = 0; j < BLK_RING_SIZE(info); j++) {
 +                      /* Not in use? */
 +                      if (!shadow[j].request)
 +                              continue;
 +
 +                      /*
 +                       * Get the bios in the request so we can re-queue them.
 +                       */
 +                      if (req_op(shadow[i].request) == REQ_OP_FLUSH ||
 +                          req_op(shadow[i].request) == REQ_OP_DISCARD ||
++                          req_op(shadow[i].request) == REQ_OP_SECURE_ERASE ||
++                          shadow[j].request->cmd_flags & REQ_FUA) {
 +                              /*
 +                               * Flush operations don't contain bios, so
 +                               * we need to requeue the whole request
++                               *
++                               * XXX: but this doesn't make any sense for a
++                               * write with the FUA flag set..
 +                               */
 +                              list_add(&shadow[j].request->queuelist, &info->requests);
 +                              continue;
 +                      }
 +                      merge_bio.head = shadow[j].request->bio;
 +                      merge_bio.tail = shadow[j].request->biotail;
 +                      bio_list_merge(&info->bio_list, &merge_bio);
 +                      shadow[j].request->bio = NULL;
 +                      blk_mq_end_request(shadow[j].request, 0);
 +              }
 +      }
 +
        blkif_free(info, info->connected == BLKIF_STATE_CONNECTED);
  
        err = negotiate_mq(info);
Simple merge
Simple merge
index 1c5a032d490d22116433ac8ff59945a7bdf749b3,74b1d380dd423ddc0969474c6e41c398d646fc4c..7ff2e820bbf473e8f9d31a19c17cfd6ec1ccb833
@@@ -1557,9 -1782,10 +1790,8 @@@ static int nvme_scan_ns_list(struct nvm
  
  static void nvme_scan_ns_sequential(struct nvme_ctrl *ctrl, unsigned nn)
  {
-       struct nvme_ns *ns, *next;
        unsigned i;
  
 -      lockdep_assert_held(&ctrl->namespaces_mutex);
 -
        for (i = 1; i <= nn; i++)
                nvme_validate_ns(ctrl, i);
  
Simple merge
index 093e9e18e7e745246454b9bf02a2a70a4898e68a,2f056b2662f663d21515b72eb25b41e3f32a8e05..fac1b51ea0dee9a55738d030efed1aaf1a43e5bc
@@@ -615,10 -615,8 +615,9 @@@ dcssblk_add_store(struct device *dev, s
        dev_info->dcssblk_queue = blk_alloc_queue(GFP_KERNEL);
        dev_info->gd->queue = dev_info->dcssblk_queue;
        dev_info->gd->private_data = dev_info;
-       dev_info->gd->driverfs_dev = &dev_info->dev;
        blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
        blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096);
 +      queue_flag_set_unlocked(QUEUE_FLAG_DAX, dev_info->dcssblk_queue);
  
        seg_byte_size = (dev_info->end - dev_info->start + 1);
        set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors
Simple merge
diff --cc fs/buffer.c
Simple merge
diff --cc fs/gfs2/dir.c
Simple merge
Simple merge
Simple merge
index 48f05d768a53bb4801d26d3a6c6a24d2fd628c27,0cdea75a6614e3b58884434fdf2a55dbc3efb0a0..c96db9c22d1031496d01c0622a65ea0df8e2965a
@@@ -593,9 -593,8 +593,9 @@@ static inline void queue_flag_clear(uns
  #define blk_queue_stackable(q)        \
        test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
  #define blk_queue_discard(q)  test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)
- #define blk_queue_secdiscard(q)       (blk_queue_discard(q) && \
-       test_bit(QUEUE_FLAG_SECDISCARD, &(q)->queue_flags))
+ #define blk_queue_secure_erase(q) \
+       (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))
 +#define blk_queue_dax(q)      test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags)
  
  #define blk_noretry_request(rq) \
        ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \
Simple merge