[PATCH 06/14] null_blk: complete requests from ->timeout

2018-05-23 Thread Christoph Hellwig
By completing the request entirely in the driver we can remove the BLK_EH_HANDLED return value and thus the split responsibility between the driver and the block layer that has been causing trouble. Signed-off-by: Christoph Hellwig --- drivers/block/null_blk.c | 6 -- 1 file changed, 4

[PATCH 12/14] blk-mq: Fix timeout and state order

2018-05-23 Thread Christoph Hellwig
From: Keith Busch The block layer had been setting the state to in-flight prior to updating the timer. This is the wrong order since the timeout handler could observe the in-flight state with the older timeout, believing the request had expired when in fact it is just getting started. Signed-off

[PATCH 07/14] scsi_transport_fc: complete requests from ->timeout

2018-05-23 Thread Christoph Hellwig
By completing the request entirely in the driver we can remove the BLK_EH_HANDLED return value and thus the split responsibility between the driver and the block layer that has been causing trouble. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_transport_fc.c | 7 +++ 1 file

[PATCH 11/14] block: document the blk_eh_timer_return values

2018-05-23 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/blkdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3d9d4da4dedd..3815d9dcfbe0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -337,8 +337,8

[PATCH 09/14] libiscsi: don't try to bypass SCSI EH

2018-05-23 Thread Christoph Hellwig
t one should not actually be possible. If this doesn't work out iscsi will probably need its own eh_strategy_handler instead to just do the right thing. Signed-off-by: Christoph Hellwig --- drivers/scsi/libiscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH 10/14] block: remove BLK_EH_HANDLED

2018-05-23 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- Documentation/scsi/scsi_eh.txt | 11 --- block/blk-mq.c | 3 --- block/blk-timeout.c| 3 --- include/linux/blkdev.h | 1 - 4 files changed, 18 deletions(-) diff --git a/Documentation/scsi/scsi_eh.txt b

[PATCH 14/14] blk-mq: simplify blk_mq_rq_timed_out

2018-05-23 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 8c7b1803b7e9..592bab689f8e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -747,22 +747,16 @@ EXPORT_SYMBOL

[PATCH 08/14] mmc: complete requests from ->timeout

2018-05-23 Thread Christoph Hellwig
!] Signed-off-by: Christoph Hellwig --- drivers/mmc/core/queue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index 56e9a803db21..648eb6743ed5 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c

[PATCH 13/14] blk-mq: Remove generation seqeunce

2018-05-23 Thread Christoph Hellwig
x27;s tag won't be released for reuse until both the timeout handler and the completion are done with it. [hch: slight cleanups] Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig --- block/blk-core.c | 6 - block/blk-mq-debugfs.c | 1 - block/bl

Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-23 Thread Christoph Hellwig
On Wed, May 23, 2018 at 08:13:56AM -0600, Jens Axboe wrote: > > Should I move to code to a new drivers/scsi/scsi_sense.c and add it to > > drivers/scsi/Makefile as: > > > > obj-$(CONFIG_BLK_SCSI_REQUEST)+= scsi_sense.o > > > > Every place I want to use the code is already covered by > > CONFI

[PATCH 2/2] xfs: add support for sub-pagesize writeback without buffer_heads

2018-05-23 Thread Christoph Hellwig
Switch to using the iomap_page structure for checking sub-page uptodate status and track sub-page I/O completion status, and remove large quantities of boilerplate code working around buffer heads. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 536

[PATCH 1/2] iomap: add support for sub-pagesize buffered I/O without buffer heads

2018-05-23 Thread Christoph Hellwig
. - two atomic_t counters are used to track the outstanding read and write counts There is quite a bit of boilerplate code as the buffered I/O path uses various helper methods, but the actual code is very straight forward. Signed-off-by: Christoph Hellwig --- fs/iomap.c| 247

sub-page blocksize support in iomap non-buffer head path v3

2018-05-23 Thread Christoph Hellwig
Hi all, this series adds support for buffered I/O without buffer heads for block size < PAGE_SIZE to the iomap and XFS code. A git tree is available at: git://git.infradead.org/users/hch/xfs.git xfs-iomap-read xfs-remove-bufferheads.2 Gitweb: http://git.infradead.org/users/hch/xfs.gi

Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-24 Thread Christoph Hellwig
On Wed, May 23, 2018 at 02:17:14PM -0700, Kees Cook wrote: > > True, though I'm finding other robustness issues in the CDROM code. > They're probably all insane corner cases, but it seems like it'd be > nice to just fix them: > > diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c > index

Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-24 Thread Christoph Hellwig
On Wed, May 23, 2018 at 03:14:19PM -0600, Jens Axboe wrote: > Ugh, so that would necessitate a change there too. As I said before, > I don't really care where it lives. I know the SCSI folks seem bothered > by moving it, but in reality, it's not like this stuff will likely ever > really change. Of

Re: [PATCH 6/6] scsi: Check sense buffer size at build time

2018-05-24 Thread Christoph Hellwig
> +/* Make sure any sense buffer is the correct size. */ > +#define scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, > \ > + sshdr, timeout, retries, flags, rq_flags, resid) \ > +({ \ > + B

Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-25 Thread Christoph Hellwig
On Thu, May 24, 2018 at 10:06:59AM -0700, Kees Cook wrote: > On Thu, May 24, 2018 at 1:00 AM, Christoph Hellwig wrote: > > On Wed, May 23, 2018 at 03:14:19PM -0600, Jens Axboe wrote: > >> Ugh, so that would necessitate a change there too. As I said before, > >> I don&#

[PATCH 06/14] nvmet: add a new nvmet_zero_sgl helper

2018-05-26 Thread Christoph Hellwig
Zeroes the SGL in the payload. Signed-off-by: Christoph Hellwig --- drivers/nvme/target/core.c | 7 +++ drivers/nvme/target/nvmet.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 800aaf96ddcd..55c4bc693aa2 100644 --- a

[PATCH 01/14] block: unexport check_disk_size_change

2018-05-26 Thread Christoph Hellwig
Only used in block_dev.c and the partitions code, and it should remain that way.. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 7ec920e27065..771ddfa29dc9 100644 --- a/fs/block_dev.c +++ b/fs

[PATCH 05/14] nvme.h: add AER configuration symbols

2018-05-26 Thread Christoph Hellwig
From: Hannes Reinecke Signed-off-by: Hannes Reinecke [hch: split from a larger patch] Signed-off-by: Christoph Hellwig --- include/linux/nvme.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 7ce0f3cf4409..2950ce957656 100644 --- a

[PATCH 02/14] block: don't print a message when the device went away

2018-05-26 Thread Christoph Hellwig
The information about a size change in this case just creates confusion. Signed-off-by: Christoph Hellwig --- block/partition-generic.c | 4 ++-- fs/block_dev.c| 14 +- include/linux/fs.h| 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a

nvme/nvmet AEN and log page fixups

2018-05-26 Thread Christoph Hellwig
Hi all, this series started as prep work for ANA, but has grown a lot. The idea is to make the AEN handling in the target closer to what the standard says, and implement the changed namespaces list log page, which is required to clear the namespace attribute notice event. One the host side this

[PATCH 04/14] nvme.h: add the changed namespace list log

2018-05-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index c37103a4ad38..7ce0f3cf4409 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -751,6 +751,7 @@ enum

[PATCH 03/14] nvme.h: untangle AEN notice definitions

2018-05-26 Thread Christoph Hellwig
Stop including the event type in the definitions for the notice type. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 30 ++ include/linux/nvme.h | 8 ++-- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/nvme/host

[PATCH 09/14] nvmet: Add AEN configuration support

2018-05-26 Thread Christoph Hellwig
From: Hannes Reinecke AEN configuration via the 'Get Features' and 'Set Features' admin command is mandatory, so we should be implemeting handling for it. Signed-off-by: Hannes Reinecke [hch: use WRITE_ONCE, check for invalid values] Signed-off-by: Christoph Hellwig ---

[PATCH 12/14] nvme: mark nvme_queue_scan static

2018-05-26 Thread Christoph Hellwig
And move it toward the top of the file to avoid a forward declaration. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 19 +-- drivers/nvme/host/nvme.h | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme

[PATCH 11/14] nvme: submit AEN event configuration on startup

2018-05-26 Thread Christoph Hellwig
From: Hannes Reinecke We should register for AEN events; some law-abiding targets might not be sending us AENs otherwise. Signed-off-by: Hannes Reinecke [hch: slight cleanups] Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 17 + drivers/nvme/host/nvme.h | 1

[PATCH 07/14] nvmet: split log page implementation

2018-05-26 Thread Christoph Hellwig
Remove the common code to allocate a buffer and copy it into the SGL. Instead the two no-op implementations just zero the SGL directly, and the smart log allocates a buffer on its own. This prepares for the more elaborate ANA log page. Signed-off-by: Christoph Hellwig --- drivers/nvme/target

[PATCH 08/14] nvmet: implement the changed namespaces log

2018-05-26 Thread Christoph Hellwig
Just keep a per-controller buffer of changed namespaces and copy it out in the get log page implementation. Signed-off-by: Christoph Hellwig --- drivers/nvme/target/admin-cmd.c | 23 + drivers/nvme/target/core.c | 44 ++--- drivers/nvme/target

[PATCH 13/14] nvme: use the changed namespaces list log to clear ns data changed AENs

2018-05-26 Thread Christoph Hellwig
Per section 5.2 we need to issue the corresponding log page to clear an AEN, so for a namespace data changed AEN we need to read the changed namespace list log. And once we read that log anyway we might as well use it to optimize the rescan. Signed-off-by: Christoph Hellwig --- drivers/nvme

[PATCH 10/14] nvmet: mask pending AERs

2018-05-26 Thread Christoph Hellwig
lears that event. An event is cleared by reading the log page associated with that event using the Get Log Page command (see section 5.14)." Signed-off-by: Christoph Hellwig --- drivers/nvme/target/admin-cmd.c | 1 + drivers/nvme/target/core.c | 2 ++ drivers/nvme/target/nvmet.h

[PATCH 14/14] nvme: limit warnings from nvme_identify_ns

2018-05-26 Thread Christoph Hellwig
When rescanning namespaces after an AEN we will issue Identify Namespace comands to namespaces that have gone away, so don't warn for this specific case. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dr

Re: [PATCH 13/14] nvme: use the changed namespaces list log to clear ns data changed AENs

2018-05-26 Thread Christoph Hellwig
On Sat, May 26, 2018 at 12:05:02PM +, Popuri, Sriram wrote: > Reading the spec it looks like ns log is alternate approach: > > "Namespace Attribute Changed: The Identify Namespace data structure for one > or more namespaces, as well as the Namespace List returned when the Identify > command

Re: mmc filesystem performance decreased on the first write after filesystem creation

2018-05-27 Thread Christoph Hellwig
Summary: mke2s uses the BLKDISCARD ioctl to wipe the device, and then uses BLKDISCARDZEROES to check if that zeroed the data. A while ago I made BLKDISCARDZEROES always return 0 because it is basically impossible to have reliably zeroing using discard as the standards leave the devices way to many

Re: [PATCH 1/2] iomap: add support for sub-pagesize buffered I/O without buffer heads

2018-05-27 Thread Christoph Hellwig
On Fri, May 25, 2018 at 01:17:02PM -0400, Brian Foster wrote: > > +static struct iomap_page * > > +iomap_page_create(struct inode *inode, struct page *page) > > +{ > > + struct iomap_page *iop = to_iomap_page(page); > > + > > + if (iop || i_blocksize(inode) == PAGE_SIZE) > > + return

Re: [PATCH 2/2] xfs: add support for sub-pagesize writeback without buffer_heads

2018-05-27 Thread Christoph Hellwig
On Fri, May 25, 2018 at 01:17:15PM -0400, Brian Foster wrote: > On Wed, May 23, 2018 at 04:46:46PM +0200, Christoph Hellwig wrote: > > Switch to using the iomap_page structure for checking sub-page uptodate > > status and track sub-page I/O completion status, and remove large &g

Re: [PATCH 03/14] nvme: return BLK_EH_DONE from ->timeout

2018-05-28 Thread Christoph Hellwig
On Thu, May 24, 2018 at 12:45:15PM +0800, Ming Lei wrote: > This change should have been done after '[PATCH 13/14] blk-mq: Remove > generation seqeunce', otherwise the timed-out request won't be completed > by nvme_cancel_request() at all because we always marked this request as > 'COMPLETE' before

Re: [PATCH 03/14] nvme: return BLK_EH_DONE from ->timeout

2018-05-28 Thread Christoph Hellwig
On Wed, May 23, 2018 at 03:27:35PM +0200, Hannes Reinecke wrote: > Is there a way of _testing_ this patch? Use the error injection framework Johannes wrote? Use blktests (but make sure you have a fixed version of test 011). > It looks pretty dodgy, just replacing BLK_EH_HANDLED with > BLK_EH_NO

Re: [PATCH 04/14] nbd: complete requests from ->timeout

2018-05-28 Thread Christoph Hellwig
On Wed, May 23, 2018 at 03:28:38PM +0200, Hannes Reinecke wrote: > Again, some testcase would be nice ... For this one I don't have an actual test case. I'll have to defer to the nbd maintainers for that.

[PATCH] block: remove parent device reference from struct bsg_class_device

2018-05-28 Thread Christoph Hellwig
. Reported-by: Anatoliy Glagolev Signed-off-by: Christoph Hellwig --- block/bsg-lib.c | 6 ++--- block/bsg.c | 39 - drivers/scsi/scsi_transport_fc.c| 7 +++--- drivers/scsi/scsi_transport_iscsi.c | 2 +- drivers/scsi

Re: [PATCH 06/14] nvmet: add a new nvmet_zero_sgl helper

2018-05-29 Thread Christoph Hellwig
On Mon, May 28, 2018 at 08:36:56AM +0200, Johannes Thumshirn wrote: > Don't we already have this? Or is it a re-send? It looks so awefully familiar > to me... It was part of my ANA series, like many changes in this series.

Re: [PATCH 08/14] nvmet: implement the changed namespaces log

2018-05-29 Thread Christoph Hellwig
On Mon, May 28, 2018 at 08:53:42AM +0200, Johannes Thumshirn wrote: > Reviewed-by: Johannes Thumshirn > > As a side note, what happens if more than 1024 Namespaces are changed > (apart from setting the 1st element to 0x and zeroing out the > rest)? > > The Spec is pretty silent in this r

Re: [PATCH 08/14] nvmet: implement the changed namespaces log

2018-05-29 Thread Christoph Hellwig
On Tue, May 29, 2018 at 10:16:31AM +0200, Johannes Thumshirn wrote: > The "full rescan" part was what I couldn't read out of the spec. The spec part is: something changed (AEN + some content in the log page) + too much changed (all-f first entry). The rest is host policy, but except for the full

[PATCH 2/2] block: don't print a message when the device went away

2018-05-29 Thread Christoph Hellwig
The information about a size change in this case just creates confusion. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/partition-generic.c | 4 ++-- fs/block_dev.c| 14 +- include/linux/fs.h| 2 +- 3 files changed, 12 insertions

[PATCH 1/2] block: unexport check_disk_size_change

2018-05-29 Thread Christoph Hellwig
Only used in block_dev.c and the partitions code, and it should remain that way.. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/block_dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 7ec920e27065..771ddfa29dc9 100644 --- a

check_disk_size_change tidyups

2018-05-29 Thread Christoph Hellwig
Remove the unused export, and suppress the size change message when the device went away.

Re: [PATCH 08/14] nvmet: implement the changed namespaces log

2018-05-29 Thread Christoph Hellwig
On Tue, May 29, 2018 at 04:59:05PM +, Verkamp, Daniel wrote: > > + } else if (ctrl->nr_changed_ns == NVME_MAX_CHANGED_NAMESPACES) { > > + ctrl->changed_ns_list[0] = cpu_to_le32(0x); > > + } > > Unless I'm missing it happening somewhere else, the list-full case that sets

Re: [PATCH 09/14] nvmet: Add AEN configuration support

2018-05-29 Thread Christoph Hellwig
On Tue, May 29, 2018 at 05:15:34PM +, Verkamp, Daniel wrote: > This looks overly restrictive - a host sending a Set Features with e.g. the > health critical warning bits set in CDW11 will get a failure. As far as I > can tell, this isn't allowed by the spec; Set Features - Asynchronous Even

Re: [PATCH 09/14] nvmet: Add AEN configuration support

2018-05-29 Thread Christoph Hellwig
On Tue, May 29, 2018 at 05:35:12PM +, Verkamp, Daniel wrote: > Sorry, I should have been clearer - I agree with your position here. Only > bits that are valid should be allowed, so for example it is fine to fail > commands that set reserved bits, or optional bits that have a mechanism to >

[GIT PULL] nvme one-liner fix for 4.17

2018-05-29 Thread Christoph Hellwig
Hi Jens, below is a one-liner fix from Max that unbreaks T10-DIF support, which got broken in 4.15. The following changes since commit eedffa28c9b00ca2dcb4d541b5a530f4c917052d: loop: clear wb_err in bd_inode when detaching backing file (2018-05-21 12:36:03 -0600) are available in the Git rep

[GIT PULL] nvme updates for 4.18

2018-05-29 Thread Christoph Hellwig
Hi Jens, here is the current batch of nvme updates for 4.18, we have a few more patches in the queue, but I'd like to get this pile into your tree and linux-next ASAP. The biggest item is support for file-backed namespaces in the NVMe target from Chaitanya, in addition to that we mostly small fix

Re: [PATCH 0/2][RFC] block: default to deadline for SMR devices

2018-05-30 Thread Christoph Hellwig
On Wed, May 30, 2018 at 06:22:04AM +, Damien Le Moal wrote: > That would necessitate splitting elevator_init() into a generic elevator > initialization function setting up the elevator related fields of the > request queue and a second part setting up the default elevator (e.g. > elevator_set_d

Re: [PATCH 0/2][RFC] block: default to deadline for SMR devices

2018-05-30 Thread Christoph Hellwig
While I really don't want drivers to change the I/O schedule themselves we have a class of devices (zoned) that don't work at all with certain I/O schedulers. The kernel not chosing something sane and requiring user workarounds is just silly.

nvme/nvmet AEN and log page fixups v2

2018-05-30 Thread Christoph Hellwig
Hi all, this series started as prep work for ANA, but has grown a lot. The idea is to make the AEN handling in the target closer to what the standard says, and implement the changed namespaces list log page, which is required to clear the namespace attribute notice event. One the host side this

[PATCH 04/12] nvmet: add a new nvmet_zero_sgl helper

2018-05-30 Thread Christoph Hellwig
Zeroes the SGL in the payload. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/target/core.c | 7 +++ drivers/nvme/target/nvmet.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index

[PATCH 06/12] nvmet: implement the changed namespaces log

2018-05-30 Thread Christoph Hellwig
Just keep a per-controller buffer of changed namespaces and copy it out in the get log page implementation. Signed-off-by: Christoph Hellwig --- drivers/nvme/target/admin-cmd.c | 26 + drivers/nvme/target/core.c | 50 +++-- drivers/nvme/target

[PATCH 02/12] nvme.h: add the changed namespace list log

2018-05-30 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- include/linux/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index c37103a4ad38..7ce0f3cf4409 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -751,6

[PATCH 05/12] nvmet: split log page implementation

2018-05-30 Thread Christoph Hellwig
Remove the common code to allocate a buffer and copy it into the SGL. Instead the two no-op implementations just zero the SGL directly, and the smart log allocates a buffer on its own. This prepares for the more elaborate ANA log page. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes

[PATCH 01/12] nvme.h: untangle AEN notice definitions

2018-05-30 Thread Christoph Hellwig
Stop including the event type in the definitions for the notice type. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 30 ++ include/linux/nvme.h | 8 ++-- 2 files changed, 24 insertions(+), 14 deletions

[PATCH 03/12] nvme.h: add AER configuration symbols

2018-05-30 Thread Christoph Hellwig
From: Hannes Reinecke Signed-off-by: Hannes Reinecke [hch: split from a larger patch] Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- include/linux/nvme.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index

[PATCH 07/12] nvmet: Add AEN configuration support

2018-05-30 Thread Christoph Hellwig
AEN configuration via the 'Get Features' and 'Set Features' admin command is mandatory, so we should be implemeting handling for it. Signed-off-by: Hannes Reinecke [hch: use WRITE_ONCE, check for invalid values] Signed-off-by: Christoph Hellwig --- drivers/nvme/tar

[PATCH 08/12] nvmet: mask pending AERs

2018-05-30 Thread Christoph Hellwig
lears that event. An event is cleared by reading the log page associated with that event using the Get Log Page command (see section 5.14)." Signed-off-by: Christoph Hellwig --- drivers/nvme/target/admin-cmd.c | 1 + drivers/nvme/target/core.c | 9 - drivers/nvme/target/nvmet

[PATCH 11/12] nvme: use the changed namespaces list log to clear ns data changed AENs

2018-05-30 Thread Christoph Hellwig
Per section 5.2 we need to issue the corresponding log page to clear an AEN, so for a namespace data changed AEN we need to read the changed namespace list log. And once we read that log anyway we might as well use it to optimize the rescan. Signed-off-by: Christoph Hellwig --- drivers/nvme

[PATCH 10/12] nvme: mark nvme_queue_scan static

2018-05-30 Thread Christoph Hellwig
And move it toward the top of the file to avoid a forward declaration. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 19 +-- drivers/nvme/host/nvme.h | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a

[PATCH 12/12] nvme: limit warnings from nvme_identify_ns

2018-05-30 Thread Christoph Hellwig
When rescanning namespaces after an AEN we will issue Identify Namespace comands to namespaces that have gone away, so don't warn for this specific case. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 4 +++- 1 file changed, 3 insertions(

[PATCH 09/12] nvme: submit AEN event configuration on startup

2018-05-30 Thread Christoph Hellwig
From: Hannes Reinecke We should register for AEN events; some law-abiding targets might not be sending us AENs otherwise. Signed-off-by: Hannes Reinecke [hch: slight cleanups] Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 17

[PATCH] blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter

2018-05-30 Thread Christoph Hellwig
We already check for started commands in all callbacks, but we should also protect against already completed commands. Do this by taking the checks to common code. Signed-off-by: Christoph Hellwig --- block/blk-mq-tag.c| 2 +- drivers/block/mtip32xx/mtip32xx.c | 12

Re: [PATCH 06/12] nvmet: implement the changed namespaces log

2018-05-31 Thread Christoph Hellwig
pely actually looks cleaner as well: --- >From d4baf4068220a90ecf67309d01ece5d0aadd952e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 25 May 2018 17:16:09 +0200 Subject: nvmet: implement the changed namespaces log Just keep a per-controller buffer of changed namespaces and copy it out in the get log page

[PATCH 2/6] block: unexport elevator_init/exit

2018-05-31 Thread Christoph Hellwig
These are only used by the block core. Also move the declarations to block/blk.h. Reported-by: Damien Le Moal Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk.h | 2 ++ block/elevator.c | 2 -- include/linux/elevator.h

[PATCH 3/6] block: remove the always unused name argument to elevator_init

2018-05-31 Thread Christoph Hellwig
Reported-by: Damien Le Moal Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-core.c | 2 +- block/blk-mq-sched.c | 2 +- block/blk.h | 2 +- block/elevator.c | 10 ++ 4 files changed, 5 insertions(+), 11 deletions

[PATCH 5/6] block: split the blk-mq case from elevator_init

2018-05-31 Thread Christoph Hellwig
There is almost no shared logic, which leads to a very confusing code flow. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-mq.c | 2 +- block/blk.h | 1 + block/elevator.c | 77 +--- 3

[PATCH 4/6] block: move sysfs_lock into elevator_init

2018-05-31 Thread Christoph Hellwig
Both callers take just around so function call, so move it in. Also remove the now pointless blk_mq_sched_init wrapper. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-core.c | 10 +- block/blk-mq-sched.c | 11 --- block

[PATCH 6/6] blk-mq: defer I/O scheduler initialization until add_disk

2018-05-31 Thread Christoph Hellwig
No need for I/O scheduling during probe, and this cleans up the code nicely by converging on the switch path. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-mq.c| 9 - block/blk-sysfs.c | 25 ++--- block

[PATCH 1/6] block: move initialization of elevator-related fields to blk_alloc_queue_node

2018-05-31 Thread Christoph Hellwig
No point in doing this in elevator_init. Signed-off-by: Christoph Hellwig Reported-by: Damien Le Moal Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-core.c | 5 + block/elevator.c | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk

elevator init cleanups

2018-05-31 Thread Christoph Hellwig
The first 5 patches are simple cleanup and refactoring patches. 6 changes behavior in that it only attaches blk-mq ioscheds once we are done with probing, but that actually simplifies things a bit too even if it might be a bit more controversial.

Re: elevator init cleanups

2018-05-31 Thread Christoph Hellwig
On Thu, May 31, 2018 at 02:21:51PM -0600, Jens Axboe wrote: > On 5/31/18 11:11 AM, Christoph Hellwig wrote: > > The first 5 patches are simple cleanup and refactoring patches. 6 changes > > behavior in that it only attaches blk-mq ioscheds once we are done with > > probi

[GIT PULL] nvme updates for 4.18

2018-06-01 Thread Christoph Hellwig
-06-01 14:37:35 +0200) Christoph Hellwig (12): nvme-pci: simplify __nvme_submit_cmd nvme-loop: add support for multiple ports nvme-fabrics: allow internal passthrough command on deleting controllers nvme.h

a few cleanups to prepare for multipage bio_vecs

2018-06-04 Thread Christoph Hellwig
Clean up some bio_vec abuses to prepare for saner handling of multipage bio_vecs.

[PATCH 1/3] block: simplify bio_check_pages_dirty

2018-06-04 Thread Christoph Hellwig
t by not saving irq state - we know we are called from a workqueue. Signed-off-by: Christoph Hellwig --- block/bio.c | 56 +--- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/block/bio.c b/block/bio.c index 53e0f0a1ed94..5094

[PATCH 3/3] block: use bio_add_page in bio_iov_iter_get_pages

2018-06-04 Thread Christoph Hellwig
merge physically contiguous pages once support for multipath bio_vecs is merged. Signed-off-by: Christoph Hellwig --- block/bio.c | 45 + 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/block/bio.c b/block/bio.c index d95fab72acb5..b09c133

[PATCH 2/3] block: bio_set_pages_dirty can't see NULL bv_page in a valid bio_vec

2018-06-04 Thread Christoph Hellwig
So don't bother handling it. Signed-off-by: Christoph Hellwig --- block/bio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/bio.c b/block/bio.c index 50941c1c9118..d95fab72acb5 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1578,10 +1578,8 @@

Re: [PATCH 13/14] nvme: use the changed namespaces list log to clear ns data changed AENs

2018-06-04 Thread Christoph Hellwig
well > > use it to optimize the rescan. > > > > Signed-off-by: Christoph Hellwig > > I'm a little concerned about this. Userspace might be reading the same > log page. Since the contents of the page may change each time its read, > it's possible the dr

Re: [PATCH] block: always set partition number to '0' in blk_partition_remap()

2018-06-06 Thread Christoph Hellwig
On Wed, Jun 06, 2018 at 08:26:56AM -0600, Jens Axboe wrote: > On 6/6/18 8:22 AM, Hannes Reinecke wrote: > > blk_partition_remap() will only clear bi_partno if an actual remapping > > has happened. But flush request et al don't have an actual size, so > > the remapping doesn't happen and bi_partno i

Re: [PATCH] block: pass failfast and driver-specific flags to flush requests

2018-06-06 Thread Christoph Hellwig
On Wed, Jun 06, 2018 at 04:21:40PM +0200, Hannes Reinecke wrote: > If flush requests are being sent to the device we need to inherit the > failfast and driver-specific flags, too, otherwise I/O will fail. Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH] blktrace: display failfast and driver-specific flags

2018-06-07 Thread Christoph Hellwig
Good idea to display the flags, but the characters aren't really very self-describing. Should we prefix each with an f maybe?

Re: [PATCHv2] block: always set partition number to '0' in blk_partition_remap()

2018-06-07 Thread Christoph Hellwig
So for stacked devices blk_partition_remap() will be called on each level. > If (as is the case for native nvme multipathing) one of the lower-level > devices do _not_support partitioning a spurious I/O error is generated. > > Signed-off-by: Hannes Reinecke Looks good, Reviewed-by: Christoph Hellwig

[GIT PULL] nvme fixes for 4.18

2018-06-07 Thread Christoph Hellwig
ository at: git://git.infradead.org/nvme.git nvme-4.18 for you to fetch changes up to 9ce44fde233fcbe5eca34f97f2a68b97d3ca833b: nvme: cleanup double shift issue (2018-06-07 16:27:08 +0200) ---- Christoph Hellwig (1): nvmet: return

Re: [PATCH 1/1] blk-mq: reinit q->tag_set_list entry only after grace period

2018-06-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

[PATCH 2/6] bcache: use bio_reuse instead of bio_reinit where applicable

2018-06-11 Thread Christoph Hellwig
Use the bio_reuse helper instead of rebuilding the bio_vecs and size for bios that get reused for the same data. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/request.c | 5 + drivers/md/bcache/super.c | 6 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a

[PATCH 6/6] bcache: use bio_add_page instead of open coded bio manipulation

2018-06-11 Thread Christoph Hellwig
Let bch_bio_alloc_pages and bch_bio_map set up the bio vec information and bi_size. This also means no additional bch_bio_map call with a NULL argument is needed before bch_bio_alloc_pages. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/btree.c | 16 +++- drivers/md/bcache

[PATCH 3/6] bcache: clean up bio reuse for struct moving_io

2018-06-11 Thread Christoph Hellwig
Instead of reinitializing the bio everytime we can call bio_reuse when reusing it. Also removes the remainder of the moving_init helper to improve readability. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/movinggc.c | 40 +--- 1 file changed, 19

[PATCH 5/6] bcache: don't clone bio in bch_data_verify

2018-06-11 Thread Christoph Hellwig
We immediately overwrite the biovec array, so instead just allocate a new bio and copy over the disk, setor and size. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/debug.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md

[RFC] cleanup bcache bio handling

2018-06-11 Thread Christoph Hellwig
Hi all, this series cleans up various places where bcache is way too intimate with bio internals. This is intended as a baseline for the multi-page biovec work, which requires some nasty workarounds for the existing code. Note that I do not have a bcache test setup, so this will require some car

[PATCH 4/6] bcache: clean up bio reuse for struct dirty_io

2018-06-11 Thread Christoph Hellwig
Instead of reinitializing the bio everytime we can call bio_reuse when reusing it. Also moves the private data initialization out of dirty_init, which is renamed to suit the remaining functionality. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/writeback.c | 26

[PATCH 1/6] block: add a bio_reuse helper

2018-06-11 Thread Christoph Hellwig
This abstracts out a way to reuse a bio without destroying the data pointers. Signed-off-by: Christoph Hellwig --- block/bio.c | 20 include/linux/bio.h | 1 + 2 files changed, 21 insertions(+) diff --git a/block/bio.c b/block/bio.c index 70c4e1b6dd45

Re: [PATCH 1/6] block: add a bio_reuse helper

2018-06-13 Thread Christoph Hellwig
On Tue, Jun 12, 2018 at 02:16:30AM -0400, Kent Overstreet wrote: > On Mon, Jun 11, 2018 at 09:48:01PM +0200, Christoph Hellwig wrote: > > This abstracts out a way to reuse a bio without destroying the > > data pointers. > > What is the point of this? What "data pointers

Re: [RFC] cleanup bcache bio handling

2018-06-13 Thread Christoph Hellwig
On Wed, Jun 13, 2018 at 07:06:41PM +0800, Ming Lei wrote: > > before bio_alloc_pages) that can be switched to something that just creates > > a > > single bvec. > > Yes, multipage bvec shouldn't break any driver or fs. It probably isn't broken, at least I didn't see assumptions of the same numbe

Re: [PATCH 1/6] block: add a bio_reuse helper

2018-06-13 Thread Christoph Hellwig
On Wed, Jun 13, 2018 at 04:54:41AM -0400, Kent Overstreet wrote: > bi_size is not immutable though, it will usually be modified by drivers when > you > submit a bio. > > I see what you're trying to do, but your approach is busted given the way the > block layer works today. You'd have to save bio

[PATCH 5/6] bcache: don't clone bio in bch_data_verify

2018-06-13 Thread Christoph Hellwig
We immediately overwrite the biovec array, so instead just allocate a new bio and copy over the disk, setor and size. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/debug.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md

[PATCH 6/6] bcache: use bio_add_page instead of open coded bio manipulation

2018-06-13 Thread Christoph Hellwig
Let bch_bio_alloc_pages and bch_bio_map set up the bio vec information and bi_size. This also means no additional bch_bio_map call with a NULL argument is needed before bch_bio_alloc_pages. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/btree.c | 16 +++- drivers/md/bcache

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