[PATCH 11/18] scsi: remove gfp_flags member in scsi_host_cmd_pool

2017-01-25 Thread Christoph Hellwig
-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 75455d4..0f93892 100644 --- a/drivers/scsi/scsi.c +

[PATCH 14/18] scsi: remove __scsi_alloc_queue

2017-01-25 Thread Christoph Hellwig
Instead do an internal export of __scsi_init_queue for the transport classes that export BSG nodes. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.

[PATCH 04/18] block: simplify blk_init_allocated_queue

2017-01-25 Thread Christoph Hellwig
, given that the request structure is zeroed on allocation. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/blk-core.c | 38 +++--- drivers/md/dm-rq.c | 3 ++- include/linux/blkdev.h | 3

[PATCH 03/18] block: fix elevator init check

2017-01-25 Thread Christoph Hellwig
for a flush. Fix this by allowing to pass any block op and flags, and by checking for the flush flags in __get_request. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/blk-core.c | 26 -- 1 file changed,

[PATCH 02/18] md: cleanup bio op / flags handling in raid1_write_request

2017-01-25 Thread Christoph Hellwig
No need for the local variables, the bio is still live and we can just assigned the bits we want directly. Make me wonder why we can't assign all the bio flags to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/md/raid1.c | 7 ++- 1 file changed, 2 insertions

[PATCH 01/18] block: add a op_is_flush helper

2017-01-25 Thread Christoph Hellwig
This centralizes the checks for bios that needs to be go into the flush state machine. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 8 block/blk-mq-sched.c | 5 ++--- block/blk-mq.c | 4 ++-- drivers/md/bcache/request.c

[PATCH 08/18] scsi_dh_rdac: switch to scsi_execute_req_flags()

2017-01-25 Thread Christoph Hellwig
d even if the device is quiesced. Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_rdac.c | 174 + 1 file changed, 51 insertions(+), 123 deletions(-) diff --git a/drivers/s

Re: [Nbd] [PATCH 4/4] nbd: add a nbd-control interface

2017-01-26 Thread Christoph Hellwig
On Wed, Jan 25, 2017 at 03:36:20PM -0600, Eric Blake wrote: > How do you get an fd to existing nbd block device? Your intent is to > use an ioctl to request creating/opening a new nbd device that no one > else is using; opening an existing device in order to send that ioctl > may have negative

automatic IRQ affinity for virtio V2

2017-01-27 Thread Christoph Hellwig
Hi Michael, hi Jason, This patches applies a few cleanups to the virtio PCI interrupt handling code, and then converts the virtio PCI code to use the automatic MSI-X vectors spreading, as well as using the information in virtio-blk and virtio-scsi to automatically align the blk-mq queues to the

[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

2017-01-27 Thread Christoph Hellwig
semantics - we can use a simple array to look up the MSI-X vec if needed. - That simple array now also duoble serves to replace the per_vq_vectors flag Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/virtio/virtio_pci_common.c | 117 +++-- d

[PATCH 7/9] blk-mq: provide a default queue mapping for virtio device

2017-01-27 Thread Christoph Hellwig
Similar to the PCI version, just calling into virtio instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/Kconfig | 5 block/Makefile| 1 + block/blk-mq-virtio.c | 54 +++ include/linux/

[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-01-27 Thread Christoph Hellwig
handlers there, and only treat vector 0 special. Additionally clean up the VQ allocation code to properly unwind on error instead of having a single global cleanup label, which is error prone, and in this case also leads to more code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/

[PATCH 4/9] virtio_pci: simplify MSI-X setup

2017-01-27 Thread Christoph Hellwig
Try to grab the MSI-X vectors early and fall back to the shared one before doing lots of allocations. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/virtio/virtio_pci_common.c | 58 +++--- 1 file changed, 29 insertions(+), 29 deletions(-) diff

[PATCH 9/9] virtio_scsi: use virtio IRQ affinity

2017-01-27 Thread Christoph Hellwig
Use automatic IRQ affinity assignment in the virtio layer if available, and build the blk-mq queues based on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/virtio_scsi.c | 126 + include/linux/cpuhotplug.h | 1 - 2 files c

[PATCH 5/9] virtio: allow drivers to request IRQ affinity when creating VQs

2017-01-27 Thread Christoph Hellwig
to allocate the irq descritors node-local and avoid interconnect traffic. Last but not least this will allow blk-mq queues are created based on the interrupt affinity for storage drivers. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/virtio_blk.c | 3 ++- driver

[PATCH 6/9] virtio: provide a method to get the IRQ affinity mask for a virtqueue

2017-01-27 Thread Christoph Hellwig
This basically passed up the pci_irq_get_affinity information through virtio through an optional get_vq_affinity method. It is only implemented by the PCI backend for now, and only when we use per-virtqueue IRQs. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/

[PATCH 8/9] virtio_blk: use virtio IRQ affinity

2017-01-27 Thread Christoph Hellwig
Use automatic IRQ affinity assignment in the virtio layer if available, and build the blk-mq queues based on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/virtio_blk.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH 3/9] virtio_pci: don't duplicate the msix_enable flag in struct pci_dev

2017-01-27 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/virtio/virtio_pci_common.c | 5 ++--- drivers/virtio/virtio_pci_common.h | 2 -- drivers/virtio/virtio_pci_legacy.c | 2 +- drivers/virtio/virtio_pci_modern.c | 2 +- include/uapi/linux/virtio_pci.h| 2 +- 5 files chan

Re: [PATCH 05/18] block: allow specifying size for extra command data

2017-01-27 Thread Christoph Hellwig
On Wed, Jan 25, 2017 at 10:15:55PM -0500, Martin K. Petersen wrote: > +static void *alloc_request_size(gfp_t gfp_mask, void *data) > > I like alloc_request_simple() but alloc_request_size() seems a bit > contrived. _reserve? _extra? _special? Don't have any good suggestions, > I'm afraid. Not

Re: split scsi passthrough fields out of struct request V2

2017-01-27 Thread Christoph Hellwig
On Fri, Jan 27, 2017 at 09:11:14AM -0700, Jens Axboe wrote: > I've queued this up for 4.11. Since some of the patches had dependencies > on changes in master since for-4.11/block was forked, they are sitting > in a separate branch that has both for-4.11/block and v4.10-rc5 pulled > in first.

[PATCH 02/19] md: cleanup bio op / flags handling in raid1_write_request

2017-01-27 Thread Christoph Hellwig
No need for the local variables, the bio is still live and we can just assign the bits we want directly. Make me wonder why we can't assign all the bio flags to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com&

[PATCH 01/19] block: add a op_is_flush helper

2017-01-27 Thread Christoph Hellwig
This centralizes the checks for bios that needs to be go into the flush state machine. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/blk-core.

split scsi passthrough fields out of struct request V3

2017-01-27 Thread Christoph Hellwig
Hi all, this series splits the support for SCSI passthrough commands from the main struct request used all over the block layer into a separate scsi_request structure that drivers that want to support SCSI passthough need to embedded as the first thing into their request-private data, similar to

Re: split scsi passthrough fields out of struct request V2

2017-01-27 Thread Christoph Hellwig
On Fri, Jan 27, 2017 at 09:21:46AM -0700, Jens Axboe wrote: > On 01/27/2017 09:17 AM, Christoph Hellwig wrote: > > On Fri, Jan 27, 2017 at 09:11:14AM -0700, Jens Axboe wrote: > >> I've queued this up for 4.11. Since some of the patches had dependencies > >> on chang

Re: split scsi passthrough fields out of struct request V2

2017-01-27 Thread Christoph Hellwig
On Fri, Jan 27, 2017 at 09:38:40AM -0700, Jens Axboe wrote: > > Ok, I'll repost what I have right now, which is on top of a merge > > of your block/for-4.11/next and your for-next from this morning > > my time. > > Perfect. At least I tried, looks like the mail server is overloaded and crapped

[PATCH 13/18] scsi: remove scsi_cmd_dma_pool

2017-01-25 Thread Christoph Hellwig
There is no need for GFP_DMA allocations of the scsi_cmnd structures themselves, all that might be DMAed to or from is the actual payload, or the sense buffers. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- drivers/scsi

[PATCH 06/18] dm: remove incomple BLOCK_PC support

2017-01-25 Thread Christoph Hellwig
DM tries to copy a few fields around for BLOCK_PC requests, but given that no dm-target ever wires up scsi_cmd_ioctl BLOCK_PC can't actually be sent to dm. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- drivers/md/dm-rq.c | 16 ---

[PATCH 07/18] dm: always defer request allocation to the owner of the request_queue

2017-01-25 Thread Christoph Hellwig
in the block layer greatly simplifies the dm-rq and mpath code, and should also make arbitrary combinations of SQ and MQ devices with SQ or MQ device mapper tables easily possible as a further step. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com&

[PATCH 15/18] scsi: allocate scsi_cmnd structures as part of struct request

2017-01-25 Thread Christoph Hellwig
Rely on the new block layer functionality to allocate additional driver specific data behind struct request instead of implementing it in SCSI itѕelf. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- drivers/scsi/hosts.c | 20 +--

[PATCH 05/18] block: allow specifying size for extra command data

2017-01-25 Thread Christoph Hellwig
This mirrors the blk-mq capabilities to allocate extra drivers-specific data behind struct request by setting a cmd_size field, as well as having a constructor / destructor for it. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- bloc

[PATCH 12/18] scsi: respect unchecked_isa_dma for blk-mq

2017-01-25 Thread Christoph Hellwig
that this switches to lazy allocation of the sense slab caches - the slab caches (not the actual allocations) won't be destroy until the scsi module is unloaded instead of keeping track of hosts using them. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com>

[PATCH 10/18] scsi_dh_hp_sw: switch to scsi_execute_req_flags()

2017-01-25 Thread Christoph Hellwig
Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 222 1 file changed, 65 insertions(+), 157 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw

[PATCH 18/18] block: don't assign cmd_flags in __blk_rq_prep_clone

2017-01-25 Thread Christoph Hellwig
These days we have the proper flags set since request allocation time. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/blk-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index 33c5d

Re: [PATCH] opal: Use empty structure when not defined

2017-02-15 Thread Christoph Hellwig
I'd rather prefer to make the structure separately allocated as discussed before. Scott, can you test the patch below? I'm not near my devices I could test on. --- >From b2cda0c7ec5c0ec66582655751838f519cfa1706 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig <h...@lst.de> Date: Th

Re: [PATCHv4 4/4] block/sed: Embed function data into the function sequence

2017-02-21 Thread Christoph Hellwig
> + if (!lock_held) > + mutex_lock(>dev_lock); No conditional locking, please. I guess I causesd this by asking you to remove __opal_lock_unlock, but it seems we'd either need to keep it in the end. Except for that the series looks fine to me. Jens: given that 1-3 are the

Re: sense handling improvements

2017-02-21 Thread Christoph Hellwig
On Wed, Feb 15, 2017 at 10:42:56PM -0500, Martin K. Petersen wrote: > >>>>> "Christoph" == Christoph Hellwig <h...@lst.de> writes: > > Christoph> this series is on top of the scsi_request changes in Jens' > Christoph> tree and further improves

[PATCH] scsi: zero per-cmd driver data before each I/O

2017-02-20 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> Reported-by: Dexuan Cui <de...@microsoft.com> Tested-by: Dexuan Cui <de...@microsoft.com> --- drivers/scsi/scsi_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 90f65

Re: [PATCHv2 0/5] OPAL patche'd cont'd

2017-02-18 Thread Christoph Hellwig
On Fri, Feb 17, 2017 at 05:00:24PM -0700, Jon Derrick wrote: > v1->v2: > Moved misplaced code from 5/5 to 4/5 > > The first three in the series have been reviewed already but I wanted to > squash them with the next two since they haven't been pulled yet. Next time please carry the reviewed-by

Re: [PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-18 Thread Christoph Hellwig
Hi Jon, I think this is a great cleanup! A few nitpicky comments below: > -typedef int (*opal_step)(struct opal_dev *dev); > +typedef struct opal_step { > + int (*fn)(struct opal_dev *dev, void *data); > + void *data; > +} opal_step; no typedefs for structure types, please. > +

Re: [PATCHv2 5/5] block/sed: Eliminate state variable

2017-02-18 Thread Christoph Hellwig
Looks fine: Reviewed-by: Christoph Hellwig <h...@lst.de> But I would just fold it into the previous patch.

Re: [PATCH] block/sed-opal: Introduce free_opal_dev to free the structure and clean up state

2017-02-18 Thread Christoph Hellwig
by: Scott Bauer <scott.ba...@intel.com> This looks fine to me, but I think the fix to add_suspend_info should be a separate patch: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCHv2 2/2] nvme: Complete all stuck requests

2017-02-23 Thread Christoph Hellwig
Thanks Keith, this looks much simpler so that even I can understand it :) Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCHv2 1/2] blk-mq: Export blk_mq_freeze_queue_wait

2017-02-23 Thread Christoph Hellwig
Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH 1/2] lightnvm: add generic ocssd detection

2017-02-25 Thread Christoph Hellwig
On Fri, Feb 24, 2017 at 06:16:48PM +0100, Matias Bjørling wrote: > More implementations of OCSSDs are becoming available. Adding each using > pci ids are becoming a hassle. Instead, use a 16 byte string in the > vendor-specific area of the identification command to identify an > Open-Channel SSD.

Re: [PATCH v1 01/14] block: introduce bio_segments_all()

2017-02-25 Thread Christoph Hellwig
> +static inline unsigned bio_segments_all(struct bio *bio) > +{ > + WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)); > + > + return bio->bi_vcnt; > +} I don't think this helpers really adds any benefit.

Re: [PATCH v1 02/14] block: introduce bio_remove_last_page()

2017-02-25 Thread Christoph Hellwig
On Fri, Feb 24, 2017 at 11:42:39PM +0800, Ming Lei wrote: > MD need this helper to remove the last added page, so introduce > it. If MD really has a valid use case for this it should open code the operation. The semantics look deeply fishy to me.

Re: sense handling improvements

2017-02-23 Thread Christoph Hellwig
On Thu, Feb 23, 2017 at 09:28:20AM -0500, Martin K. Petersen wrote: > >>>>> "Christoph" == Christoph Hellwig <h...@lst.de> writes: > > Christoph, > > >> I applied 1-4 to 4.11/scsi-fixes. Both 5 and 6 had problems so please > >> fix

Re: [PATCH] block/sed: Embed function data into the function sequence

2017-02-23 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: sense handling improvements

2017-02-23 Thread Christoph Hellwig
On Wed, Feb 22, 2017 at 07:51:44PM -0500, Martin K. Petersen wrote: > I applied 1-4 to 4.11/scsi-fixes. Both 5 and 6 had problems so please > fix those up. What kind of problem? I didn't see anything on the list.

Re: [PATCH 4/4] nvme: re-check security protocol support after reset

2017-02-17 Thread Christoph Hellwig
On Fri, Feb 17, 2017 at 10:26:51AM -0500, Keith Busch wrote: > On Fri, Feb 17, 2017 at 01:59:41PM +0100, Christoph Hellwig wrote: > > @@ -1789,7 +1789,8 @@ static void nvme_reset_work(struct work_struct *work) > > if (result) > > goto out; > >

Re: [PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-18 Thread Christoph Hellwig
On Sat, Feb 18, 2017 at 08:52:19AM -0700, Scott Bauer wrote: > >> +static int set_mbr_done(struct opal_dev *dev, void *data) > >> { > >> - u8 mbr_done_tf = *(u8 *)dev->func_data[dev->state]; > >> + u8 mbr_done_tf = *(u8 *)data; > > > > No need for casts when going from void * to any pointer

Re: [PATCH] scsi_transport_sas: fix BSG ioctl memory corruption

2017-02-21 Thread Christoph Hellwig
to memory corruption in the call to > scsi_req_init() in bsg_map_hdr(), since it will memset past the end of > the allocated request. Fix it by setting ->cmd_size on the allocated > request_queue. Oh, I missed that SAS still opencodes it's queue allocations. Acked-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH 4/4] nvme: re-check security protocol support after reset

2017-02-17 Thread Christoph Hellwig
On Fri, Feb 17, 2017 at 09:55:51AM -0700, Scott Bauer wrote: > I'm working on it now. Do you want a diff like Keith did or a separate patch? Please make it a proper patch that applies on top of my patches 1-3 (where 3 really is yours anyway). I'll respin 4 with the updates from Keith on top of

[PATCH 5/6] scsi: merge __scsi_execute into scsi_execute

2017-02-14 Thread Christoph Hellwig
All but one caller want the decoded sense header, so offer the existing __scsi_execute helper as the public scsi_execute API to simply the callers. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/ata/libata-scsi.c | 12 -- drivers/scsi/cxlflash/superpipe.

[PATCH 2/6] sd: improve TUR handling in sd_check_events

2017-02-14 Thread Christoph Hellwig
Remove bogus evaluations of retval and sshdr when the device is offline, and fix a possible NULL pointer dereference by allocating the 8 byte sized sense header on stack. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sd.c | 25 +++-- 1 file chang

[PATCH 3/6] scsi: make the sense header argument to scsi_test_unit_ready mandatory

2017-02-14 Thread Christoph Hellwig
It's a tiny structure that can be allocated on the stack, don't complicate the code by making it optional. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/osd/osd_uld.c | 3 ++- drivers/scsi/scsi_ioctl.c | 3 ++- drivers/scsi/scsi_lib.c| 14 ++ 3 files c

sense handling improvements

2017-02-14 Thread Christoph Hellwig
Hi all, this series is on top of the scsi_request changes in Jens' tree and further improves the handling of the sense buffer. The first patch prevents any possibily of reusing stale sense codes in sense headers, and is a bug fix that we should probably get into the block tree ASAP. The rest

[PATCH 1/6] scsi: always zero sshdr in scsi_normalize_sense

2017-02-14 Thread Christoph Hellwig
This gives us a clear state even if a command didn't return sense data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/scsi_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c index b1383a

[PATCH 6/6] scsi: remove scsi_execute_req_flags

2017-02-14 Thread Christoph Hellwig
And switch all callers to use scsi_execute instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_alua.c | 16 ++-- drivers/scsi/device_handler/scsi_dh_emc.c | 7 +++ drivers/scsi/device_handler/scsi_dh_hp_sw.c | 10 -- d

[PATCH 4/6] scsi: simplify scsi_execute_req_flags

2017-02-14 Thread Christoph Hellwig
Add a sshdr argument to __scsi_execute so that we can decode the sense data directly into the sense header instead of needing a copy of it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/scsi_lib.c | 27 +-- 1 file changed, 9 insertions(+), 18 del

Re: [PATCH] sd: Check for unaligned partial completion

2017-02-14 Thread Christoph Hellwig
> + unsigned int sector_sz = SCpnt->device->sector_size; Can you spell out size? > + /* > + * In case of bogus fw or device, we could end up having > + * unaligned partial completion. Check this here. > + */ > + resid = scsi_get_resid(SCpnt); > + if

Re: [PATCH V5 4/4] Maintainers: Modify SED list from nvme to block

2017-02-14 Thread Christoph Hellwig
Reviewed-by: Christoph Hellwig <h...@lst.de> Let's get it in ASAP as well.

Re: [PATCH V5 1/4] block: sed-opal: change ioctl to take user pointer instead of unsinged long

2017-02-14 Thread Christoph Hellwig
On Mon, Feb 13, 2017 at 09:15:10AM -0700, Scott Bauer wrote: > esOn Mon, Feb 13, 2017 at 09:11:09AM -0700, Scott Bauer wrote: > > Signed-off-by: Scott Bauer > > --- > > block/sed-opal.c | 6 -- > > drivers/nvme/host/core.c | 3 ++- > > include/linux/sed-opal.h

Re: [PATCH V5 2/4] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-14 Thread Christoph Hellwig
Reviewed-by: Christoph Hellwig <h...@lst.de> Let's get this one in ASAP while waiting for a respin of the KASAN fix.

Re: [PATCH 1/1] dm-zoned: Zoned block device target

2017-02-09 Thread Christoph Hellwig
On Thu, Feb 09, 2017 at 01:18:49PM +0900, Damien Le Moal wrote: > + > +/* > + * Target BIO completion. > + */ > +static inline void dmz_bio_end(struct bio *bio, int err) > +{ > + struct dm_zone_bioctx *bioctx = > + dm_per_bio_data(bio, sizeof(struct dm_zone_bioctx)); > + > + if

Re: [PATCH v1 1/5] block: introduce bio_clone_bioset_partial()

2017-02-14 Thread Christoph Hellwig
On Tue, Feb 14, 2017 at 09:04:26AM +0800, Ming Lei wrote: > On Mon, Feb 13, 2017 at 9:46 PM, Christoph Hellwig <h...@infradead.org> wrote: > > On Fri, Feb 10, 2017 at 06:56:13PM +0800, Ming Lei wrote: > >> md still need bio clone(not the fast version) for behind wr

Re: [PATCH v2 5/5] md: fast clone bio in bio_clone_mddev()

2017-02-14 Thread Christoph Hellwig
> use bio_clone() for allocating new bvec table. > > So this patch replaces bio_clone() with bio_clone_fast() > in bio_clone_mddev(). > > Also kill bio_clone_mddev() and call bio_clone_fast() directly, as > suggested by Christoph Hellwig. > > Signed-off-by: Ming Lei <

Re: [PATCH V4 1/2] uapi: sed-opal fix IOW for activate lsp to use correct struct

2017-02-12 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH 00/16] multiqueue for MMC/SD third try

2017-02-09 Thread Christoph Hellwig
> What immediately jumps out at you is that linear read/writes > perform just as nicely or actually better with MQ than with the > old block layer. > > What is amazing is that just a little randomness, such as the > find . > /dev/null immediately seems to visibly regress with MQ. > My best guess

Re: automatic IRQ affinity for virtio V3

2017-02-09 Thread Christoph Hellwig
On Sun, Feb 05, 2017 at 06:15:17PM +0100, Christoph Hellwig wrote: > Hi Michael, hi Jason, > > This patches applies a few cleanups to the virtio PCI interrupt handling > code, and then converts the virtio PCI code to use the automatic MSI-X > vectors spreading, as well as using

Re: sense handling improvements

2017-02-16 Thread Christoph Hellwig
On Wed, Feb 15, 2017 at 10:42:56PM -0500, Martin K. Petersen wrote: > Christoph> The first patch prevents any possibily of reusing stale sense > Christoph> codes in sense headers, and is a bug fix that we should > Christoph> probably get into the block tree ASAP. > > Christoph> The rest cleans up

Re: [PATCHv4 2/4] block/sed: Add helper to qualify response tokens

2017-02-16 Thread Christoph Hellwig
Scott Bauer <scott.ba...@intel.com> Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCHv4 3/4] block/sed: Check received header lengths

2017-02-16 Thread Christoph Hellwig
.@intel.com> Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de>

[PATCH 2/2] block/sed-opal: allocate struct opal_dev dynamically

2017-02-16 Thread Christoph Hellwig
that a lot of internals can be made private as well. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/opal_proto.h | 23 ++ block/sed-opal.c | 101 + drivers/nvme/host/core.c | 9 ++-- drivers/nvme/host/nvme.h

Re: sense handling improvements

2017-02-15 Thread Christoph Hellwig
On Wed, Feb 15, 2017 at 09:19:18AM +0100, Hannes Reinecke wrote: > On 02/14/2017 08:15 PM, Christoph Hellwig wrote: > > Hi all, > > > > this series is on top of the scsi_request changes in Jens' tree and > > further improves the handling of the sense buffer. > >

Re: BUG: KASAN: Use-after-free

2017-01-23 Thread Christoph Hellwig
On Mon, Jan 23, 2017 at 05:07:52PM +0100, Matias Bjørling wrote: > Hi, > > I could use some help verifying an use-after-free bug that I am seeing > after the new direct I/O work went in. > > When issuing a direct write io using libaio, a bio is referenced in the > blkdev_direct_IO path, and then

Re: [PATCH 01/16] block: fix elevator init check

2017-01-24 Thread Christoph Hellwig
On Tue, Jan 24, 2017 at 08:06:39AM -0700, Jens Axboe wrote: > We check for REQ_PREFLUSH | REQ_FUA in so many places though, might not > be a bad idea to keep the helper but just make it take the opf and fix > up the other locations too. The fact that PREFLUSH|FUA is the magic to > check for is

Re: [PATCH 4/6] blk-mq: Update queue map when changing queue count

2017-01-23 Thread Christoph Hellwig
Looks fine except for the nitpick pointed out by Sagi: Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/6] irq/affinity: Assign all online CPUs to vectors

2017-01-23 Thread Christoph Hellwig
rs if some nodes have fewer CPUs than nodes previosuly > set up, but at least every online CPU will be assigned to something. This looks fine: I think we still should switch to something like all present or possible cpus for MSI-X vector and blk-mq queue assignment, though reduce the needs for

Re: [PATCH 3/6] nvme/pci: Start queues after tagset is updated

2017-01-23 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: BUG: KASAN: Use-after-free

2017-01-24 Thread Christoph Hellwig
On Tue, Jan 24, 2017 at 11:01:42AM +0100, Matias Bjørling wrote: > Yup. That fixes it. Should I put together the patch, or will you take > care of it? I'll send it out. Of course with proper reporting credits for you. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in

[PATCH] block: fix use after free in __blkdev_direct_IO

2017-01-24 Thread Christoph Hellwig
We can't dereference the dio structure after submitting the last bio for this request, as I/O completion might have happened before the code is run. Introduce a local is_sync variable instead. Fixes: 542ff7bf ("block: new direct I/O implementation") Signed-off-by: Christoph Hellwig &l

Re: [PATCH 05/16] dm: always defer request allocation to the owner of the request_queue

2017-01-24 Thread Christoph Hellwig
On Tue, Jan 24, 2017 at 05:05:39AM -0500, Mike Snitzer wrote: > possible and is welcomed cleanup. The only concern I have is that using > get_request() for the old request_fn request_queue eliminates the > guaranteed availability of requests to allow for forward progress (on > path failure or for

Re: [PATCH v1 3/5] md: fail if mddev->bio_set can't be created

2017-02-13 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> but this really needs to be patch 2 in this series.

Re: [PATCH v1 1/5] block: introduce bio_clone_bioset_partial()

2017-02-13 Thread Christoph Hellwig
n how few users bio_clone_bioset has I wonder if we shouldn't simply add the two new arguments to it instead of adding another indirection. Otherwise looks fine: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH v1 2/5] md/raid1: use bio_clone_bioset_partial() in case of write behind

2017-02-13 Thread Christoph Hellwig
or - bio->bi_iter.bi_sector, > - max_sectors); > + offset = r1_bio->sector - bio->bi_iter.bi_sector; I think offset should be a sector_t. Otherwise this looks fine: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH v1 5/5] md: fast clone bio in bio_clone_mddev()

2017-02-13 Thread Christoph Hellwig
Please use bio_clone_fast directly and kill the wrapper.

Re: [PATCH v1 4/5] md: remove unnecessary check on mddev

2017-02-13 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de>

[PATCH 2/4] block/sed-opal: allocate struct opal_dev dynamically

2017-02-17 Thread Christoph Hellwig
that a lot of internals can be made private as well. Signed-off-by: Christoph Hellwig <h...@lst.de> Tested-by: Scott Bauer <scott.ba...@intel.com> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/opal_proto.h | 23 ++ block/sed-op

[PATCH 4/4] nvme: re-check security protocol support after reset

2017-02-17 Thread Christoph Hellwig
A device may change capabilities after each reset, e.g. due to a firmware upgrade. We should thus check for Security Send/Receive and OPAL support after each reset. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

OPAL fixups

2017-02-17 Thread Christoph Hellwig
Hi all, this contains a few more OPAL-related fixups. It tones down warnings a bit, allocates the OPAL-ѕpecific data structure in a separate dynamic allocation, checks for support of Security Send/Receive in NVMe before using them, and makes sure we re-discovery the security capabilities after

[PATCH 1/4] block/sed-opal: tone down not supported warnings

2017-02-17 Thread Christoph Hellwig
Not having OPAL or a sub-feature supported is an entirely normal condition for many drives, so don't warn about it. Keep the messages, but tone them down to debug only. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Scott Bauer <scott.ba...@intel.com> --- block/se

Re: [PATCH 3/4] nvme: use blk_rq_payload_bytes

2017-01-18 Thread Christoph Hellwig
On Tue, Jan 17, 2017 at 10:06:51PM +0200, Sagi Grimberg wrote: > >> @@ -1014,9 +1013,9 @@ static int nvme_rdma_map_data(struct nvme_rdma_queue >> *queue, >> } >> > > Christoph, a little above here we still look at blk_rq_bytes(), > shouldn't that look at blk_rq_payload_bytes() too? The

Re: [PATCH v1 00/54] block: support multipage bvec

2017-01-16 Thread Christoph Hellwig
On Mon, Jan 16, 2017 at 11:19:19AM +0800, Ming Lei wrote: > Any comments on this version? We'll need to make sure all drivers can handle multi-page bvecs before continuing any other work. Without that the series is a no-go. Note that in general making a drivers capable of handling multipage

Re: [PATCH v1 00/54] block: support multipage bvec

2017-01-16 Thread Christoph Hellwig
On Tue, Jan 17, 2017 at 10:40:36AM +0800, Ming Lei wrote: > IMO, the only one left is raid(1/5/10) which can be dealt with by the > "NO_MP" flag. No, they can't in the long run. They need to handle the bvecs just like everyone else. -- To unsubscribe from this list: send the line "unsubscribe

Re: [LSF/MM TOPIC] Future direction of DAX

2017-01-16 Thread Christoph Hellwig
On Mon, Jan 16, 2017 at 05:50:33PM -0800, Darrick J. Wong wrote: > I wouldn't consider it a barrier in general (since ext4 also prints > EXPERIMENTAL warnings for DAX), merely one for XFS. I don't even think > it's that big of a hurdle -- afaict XFS ought to be able to achieve this > by modifying

Re: [PATCH 1/2] lightnvm: add generic ocssd detection

2017-02-26 Thread Christoph Hellwig
[adding linux-nvme to Cc as the patch changes the nvme driver, despite the subject line] On Sat, Feb 25, 2017 at 08:16:04PM +0100, Matias Bjørling wrote: > On 02/25/2017 07:21 PM, Christoph Hellwig wrote: > > On Fri, Feb 24, 2017 at 06:16:48PM +0100, Matias Bjørling wrote: &

[PATCH 09/12] block: advertize max atomic write limit

2017-02-28 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-settings.c | 22 ++ block/blk-sysfs.c | 12 include/linux/blkdev.h | 9 + 3 files changed, 43 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index 529e55

[RFC] failure atomic writes for file systems and block devices

2017-02-28 Thread Christoph Hellwig
Hi all, this series implements a new O_ATOMIC flag for failure atomic writes to files. It is based on and tries to unify to earlier proposals, the first one for block devices by Chris Mason: https://lwn.net/Articles/573092/ and the second one for regular files, published by HP

[PATCH 08/12] xfs: implement the F_IOINFO fcntl

2017-02-28 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/xfs/xfs_file.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index a7d8324b59c5..4d955b3266df 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@

<    1   2   3   4   5   6   7   8   9   10   >