Re: [PATCH v2 5/6] cdrom: Check SCSI passthrough support before reading audio

2017-05-31 Thread Hannes Reinecke
On 05/31/2017 11:43 PM, Bart Van Assche wrote: > The CDROMREADAUDIO ioctl uses SCSI passthrough when the .disk > pointer has been set in struct cdrom_device_info. Hence check > whether SCSI passthrough is supported before submitting a SCSI > command. Note: both the ide-cd and sr drivers set the

Re: [PATCH v2 4/4] blk-mq-debugfs: Add 'kick' operation

2017-05-31 Thread Hannes Reinecke
On 05/31/2017 11:30 PM, Bart Van Assche wrote: > Running a queue causes the block layer to examine the per-CPU and > hw queues but not the requeue list. Hence add a 'kick' operation > that also examines the requeue list. > > Signed-off-by: Bart Van Assche > Cc:

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Hannes Reinecke
On 05/31/2017 11:30 PM, Bart Van Assche wrote: > Requests that got stuck in a block driver are neither on > blk_mq_ctx.rq_list nor on any hw dispatch queue. Make these > visible in debugfs through the "busy" attribute. > > Signed-off-by: Bart Van Assche > Cc:

blk-mq: free callback if error occurs in blk_mq_init_allocated_queue

2017-05-31 Thread Joseph Qi
From: Joseph Qi If error occurs, we have to free the allocated callback in blk_mq_init_allocated_queue to avoid memory leaking. Fixes: 34dbad5d26e2 ("blk-stat: convert to callback-based statistics reporting") Signed-off-by: Joseph Qi ---

Re: [PATCH v2 4/4] blk-mq-debugfs: Add 'kick' operation

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 02:30:50PM -0700, Bart Van Assche wrote: > Running a queue causes the block layer to examine the per-CPU and > hw queues but not the requeue list. Hence add a 'kick' operation > that also examines the requeue list. > > Signed-off-by: Bart Van Assche

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote: > Requests that got stuck in a block driver are neither on > blk_mq_ctx.rq_list nor on any hw dispatch queue. Make these > visible in debugfs through the "busy" attribute. > > Signed-off-by: Bart Van Assche

Re: [PATCH v2 2/4] blk-mq-debugfs: Show requeue list

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 02:30:48PM -0700, Bart Van Assche wrote: > When verifying whether or not a blk-mq driver forgot to kick the > requeue list after having requeued a request it is important to > be able to verify the contents of the requeue list. Hence export > that list through debugfs. > >

Re: [PATCH v2 1/4] blk-mq-debugfs: Show atomic request flags

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 02:30:47PM -0700, Bart Van Assche wrote: > When analyzing e.g. queue lockups it is important to know whether > or not a request has already been started. Hence also show the > atomic request flags. > > Signed-off-by: Bart Van Assche >

Re: [PATCH v3 5/9] blk-mq: fix blk_mq_quiesce_queue

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 03:37:30PM +, Bart Van Assche wrote: > On Wed, 2017-05-31 at 20:37 +0800, Ming Lei wrote: > > > > + /* wait until queue is unquiesced */ > > + wait_event_cmd(q->quiesce_wq, !blk_queue_quiesced(q), > > + may_sleep ? > > +

Re: [PATCH v3 3/9] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-31 Thread Ming Lei
On Wed, May 31, 2017 at 03:21:41PM +, Bart Van Assche wrote: > On Wed, 2017-05-31 at 20:37 +0800, Ming Lei wrote: > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > index 99e16ac479e3..ffcf05765e2b 100644 > > --- a/drivers/scsi/scsi_lib.c > > +++ b/drivers/scsi/scsi_lib.c >

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Eduardo Valentin
On Wed, May 31, 2017 at 09:54:11PM +, Bart Van Assche wrote: > On Wed, 2017-05-31 at 14:49 -0700, Eduardo Valentin wrote: > > On Wed, May 31, 2017 at 09:45:54PM +, Bart Van Assche wrote: > > > On Wed, 2017-05-31 at 14:43 -0700, Eduardo Valentin wrote: > > > > On Wed, May 31, 2017 at

[PATCH v2 05/12] blk-mq: Initialize a request before assigning a tag

2017-05-31 Thread Bart Van Assche
Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init() is called after a value has been assigned to .rq_flags and .rq_flags is initialized in __blk_mq_finish_request(). Call blk_mq_rq_ctx_init() before modifying any struct request members. Initialize .rq_flags in

[PATCH v2 01/12] block: Make request operation type argument declarations consistent

2017-05-31 Thread Bart Van Assche
Instead of declaring the second argument of blk_*_get_request() as int and passing it to functions that expect an unsigned int, declare that second argument as unsigned int. Also because of consistency, rename that second argument from 'rw' into 'op'. This patch does not change any functionality.

[PATCH v2 12/12] block: Rename blk_mq_rq_{to,from}_pdu()

2017-05-31 Thread Bart Van Assche
Commit 6d247d7f71d1 ("block: allow specifying size for extra command data") added support for .cmd_size to blk-sq. Due to that patch the blk_mq_rq_{to,from}_pdu() functions are also useful for single-queue block drivers. Hence remove "_mq" from the name of these functions. This patch does not

[PATCH v2 04/12] block: Change argument type of scsi_req_init()

2017-05-31 Thread Bart Van Assche
Since scsi_req_init() works on a struct scsi_request, change the argument type into struct scsi_request *. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen

[PATCH v2 06/12] block: Add a comment above queue_lockdep_assert_held()

2017-05-31 Thread Bart Van Assche
Add a comment above the queue_lockdep_assert_held() macro that explains the purpose of the q->queue_lock test. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming

[PATCH v2 08/12] block: Document what queue type each function is intended for

2017-05-31 Thread Bart Van Assche
Some functions in block/blk-core.c must only be used on blk-sq queues while others are safe to use against any queue type. Document which functions are intended for blk-sq queues and issue a warning if the blk-sq API is misused. Signed-off-by: Bart Van Assche Cc:

[PATCH v2 09/12] blk-mq: Document locking assumptions

2017-05-31 Thread Bart Van Assche
Document the locking assumptions in functions that modify blk_mq_ctx.rq_list to make it easier for humans to verify this code. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc:

[PATCH v2 00/12] More patches for kernel v4.13

2017-05-31 Thread Bart Van Assche
Hello Jens, The changes compared to v1 of this patch series are: * Addressed Christoph's comment about moving the .initialize_rq_fn() call from blk_rq_init() / blk_mq_rq_ctx_init() into blk_get_request(). * Left out patch "scsi: Make scsi_ioctl_reset() pass the request queue pointer to

[PATCH v2 10/12] block: Constify disk_type

2017-05-31 Thread Bart Van Assche
The variable 'disk_type' is never modified so constify it. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming Lei --- block/genhd.c | 4 ++--

[PATCH v2 03/12] block: Make most scsi_req_init() calls implicit

2017-05-31 Thread Bart Van Assche
Instead of explicitly calling scsi_req_init() after blk_get_request(), call that function from inside blk_get_request(). Add an .initialize_rq_fn() callback function to the block drivers that need it. Merge the IDE .init_rq_fn() function into .initialize_rq_fn() because it is too small to keep it

[PATCH v2 02/12] block: Introduce request_queue.initialize_rq_fn()

2017-05-31 Thread Bart Van Assche
Several block drivers need to initialize the driver-private data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization code has to be repeated after every blk_get_request() call by adding a new

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Jeff Layton
On Wed, 2017-05-31 at 14:37 -0700, Andrew Morton wrote: > On Wed, 31 May 2017 17:31:49 -0400 Jeff Layton wrote: > > > On Wed, 2017-05-31 at 13:27 -0700, Andrew Morton wrote: > > > On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > > > > > > > This

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Bart Van Assche
On Wed, 2017-05-31 at 14:49 -0700, Eduardo Valentin wrote: > On Wed, May 31, 2017 at 09:45:54PM +, Bart Van Assche wrote: > > On Wed, 2017-05-31 at 14:43 -0700, Eduardo Valentin wrote: > > > On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote: > > > > +static void

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Eduardo Valentin
On Wed, May 31, 2017 at 09:45:54PM +, Bart Van Assche wrote: > On Wed, 2017-05-31 at 14:43 -0700, Eduardo Valentin wrote: > > On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote: > > > +static void hctx_show_busy(struct request *rq, void *data, bool reserved) > > > +{ > > > + const

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Bart Van Assche
On Wed, 2017-05-31 at 14:43 -0700, Eduardo Valentin wrote: > On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote: > > +static void hctx_show_busy(struct request *rq, void *data, bool reserved) > > +{ > > + const struct show_busy_params *params = data; > > + > > + if

[PATCH v2 2/6] block: Introduce queue flag QUEUE_FLAG_SCSI_PASSTHROUGH

2017-05-31 Thread Bart Van Assche
>From the context where a SCSI command is submitted it is not always possible to figure out whether or not the queue the command is submitted to has struct scsi_request as the first member of its private data. Hence introduce the flag QUEUE_FLAG_SCSI_PASSTHROUGH. Signed-off-by: Bart Van Assche

Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Eduardo Valentin
Hello, On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote: > Requests that got stuck in a block driver are neither on > blk_mq_ctx.rq_list nor on any hw dispatch queue. Make these > visible in debugfs through the "busy" attribute. > > Signed-off-by: Bart Van Assche

[PATCH v2 0/6] Split scsi passthrough fields out of struct request sequel

2017-05-31 Thread Bart Van Assche
Hello Jens, The patches in this series are a sequel of Christoph's "Split scsi passthrough fields out of struct request" patch series. The changes compared to v1 of this patch series are: - Renamed QUEUE_FLAG_SCSI_PDU into QUEUE_FLAG_SCSI_PASSTHROUGH and blk_queue_scsi_pdu() into

[PATCH v2 5/6] cdrom: Check SCSI passthrough support before reading audio

2017-05-31 Thread Bart Van Assche
The CDROMREADAUDIO ioctl uses SCSI passthrough when the .disk pointer has been set in struct cdrom_device_info. Hence check whether SCSI passthrough is supported before submitting a SCSI command. Note: both the ide-cd and sr drivers set the disk pointer in struct cdrom_device_info but neither the

[PATCH v2 1/6] block: Avoid that blk_exit_rl() triggers a use-after-free

2017-05-31 Thread Bart Van Assche
Since the introduction of .init_rq_fn() and .exit_rq_fn() it is essential that the memory allocated for struct request_queue stays around until all blk_exit_rl() calls have finished. Hence make blk_init_rl() take a reference on struct request_queue. This patch fixes the following crash: general

[PATCH v2 4/6] pktcdvd: Check queue type before attaching to a queue

2017-05-31 Thread Bart Van Assche
Since the pktcdvd driver only supports request queues for which struct scsi_request is the first member of their private request data, refuse to register block layer queues for which struct scsi_request is not the first member of the private data. References: commit 82ed4db499b8 ("block: split

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Andrew Morton
On Wed, 31 May 2017 17:31:49 -0400 Jeff Layton wrote: > On Wed, 2017-05-31 at 13:27 -0700, Andrew Morton wrote: > > On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > > > > > This is v5 of the patchset to improve how we're tracking and reporting > >

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Jeff Layton
On Wed, 2017-05-31 at 13:27 -0700, Andrew Morton wrote: > On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > > > This is v5 of the patchset to improve how we're tracking and reporting > > errors that occur during pagecache writeback. > > I'm curious to know how you've

[PATCH v2 2/4] blk-mq-debugfs: Show requeue list

2017-05-31 Thread Bart Van Assche
When verifying whether or not a blk-mq driver forgot to kick the requeue list after having requeued a request it is important to be able to verify the contents of the requeue list. Hence export that list through debugfs. Signed-off-by: Bart Van Assche Reviewed-by:

[PATCH v2 4/4] blk-mq-debugfs: Add 'kick' operation

2017-05-31 Thread Bart Van Assche
Running a queue causes the block layer to examine the per-CPU and hw queues but not the requeue list. Hence add a 'kick' operation that also examines the requeue list. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke

[PATCH v2 3/4] blk-mq-debugfs: Show busy requests

2017-05-31 Thread Bart Van Assche
Requests that got stuck in a block driver are neither on blk_mq_ctx.rq_list nor on any hw dispatch queue. Make these visible in debugfs through the "busy" attribute. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Andrew Morton
On Wed, 31 May 2017 08:45:23 -0400 Jeff Layton wrote: > This is v5 of the patchset to improve how we're tracking and reporting > errors that occur during pagecache writeback. I'm curious to know how you've been testing this? Is that testing strong enough for us to be

Re: [PATCH 08/24] uuid: rename uuid_to_bin to uuid_parse

2017-05-31 Thread Christoph Hellwig
On Wed, May 31, 2017 at 09:14:35PM +0300, Andy Shevchenko wrote: > On Wed, 2017-05-31 at 18:18 +0200, Christoph Hellwig wrote: > > This matches the userspace version of it, and describes the > > functionality > > much better.  Also do the same for the guid version. > > > > No objections for

Re: [PATCH 15/24] block: remove blk_part_pack_uuid

2017-05-31 Thread Christoph Hellwig
On Wed, May 31, 2017 at 09:16:34PM +0300, Andy Shevchenko wrote: > On Wed, 2017-05-31 at 18:18 +0200, Christoph Hellwig wrote: > > This helper was only used by IMA of all things, which would get > > spurious > > errors if CONFIG_BLOCK is disabled.  Just opencode the call there. > > > -

Re: [PATCH 01/24] uuid,afs: move struct uuid_v1 back into afs

2017-05-31 Thread David Howells
Christoph Hellwig wrote: > This essentially is a partial revert of commit ff548773 > ("afs: Move UUID struct to linux/uuid.h") and moves struct uuid_v1 back into > fs/afs as struct afs_uuid. It however keeps it as big endian structure > so that we can use the normal uuid generation

Re: [PATCH 15/24] block: remove blk_part_pack_uuid

2017-05-31 Thread Andy Shevchenko
On Wed, 2017-05-31 at 18:18 +0200, Christoph Hellwig wrote: > This helper was only used by IMA of all things, which would get > spurious > errors if CONFIG_BLOCK is disabled.  Just opencode the call there. > - result = blk_part_pack_uuid(args[0].from, > -

Re: [PATCH 08/24] uuid: rename uuid_to_bin to uuid_parse

2017-05-31 Thread Andy Shevchenko
On Wed, 2017-05-31 at 18:18 +0200, Christoph Hellwig wrote: > This matches the userspace version of it, and describes the > functionality > much better.  Also do the same for the guid version. > No objections for renaming, though I'm pretty sure it should be squashed to patch 6. >

[PATCH 01/24] uuid,afs: move struct uuid_v1 back into afs

2017-05-31 Thread Christoph Hellwig
This essentially is a partial revert of commit ff548773 ("afs: Move UUID struct to linux/uuid.h") and moves struct uuid_v1 back into fs/afs as struct afs_uuid. It however keeps it as big endian structure so that we can use the normal uuid generation helpers when casting to/from struct afs_uuid.

cleanup UUID types V6

2017-05-31 Thread Christoph Hellwig
Hi all, this series, which is a combined effort from Amir, Andy and me introduces new uuid_t and guid_t type names that are less confusing than the existing types, adds new helpers for them and starts switching the fs code over to it. Andy has additional patches on top to convert many of the

[PATCH 04/24] md: namespace private helper names

2017-05-31 Thread Christoph Hellwig
From: Amir Goldstein The md private helper uuid_equal() collides with a generic helper of the same name. Rename the md private helper to md_uuid_equal() and do the same for md_sb_equal(). Signed-off-by: Amir Goldstein Signed-off-by: Christoph Hellwig

[PATCH 03/24] xfs: use uuid_be to implement the uuid_t type

2017-05-31 Thread Christoph Hellwig
Use the generic Linux definition to implement our UUID type, this will allow using more generic infrastructure in the future. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Brian Foster Reviewed-by: Andy Shevchenko

[PATCH 05/24] uuid: remove uuid_be defintions from the uapi header

2017-05-31 Thread Christoph Hellwig
We don't use uuid_be and the UUID_BE constants in any uapi headers, so make them private to the kernel. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- include/linux/uuid.h |

[PATCH 08/24] uuid: rename uuid_to_bin to uuid_parse

2017-05-31 Thread Christoph Hellwig
This matches the userspace version of it, and describes the functionality much better. Also do the same for the guid version. Signed-off-by: Christoph Hellwig --- include/linux/uuid.h | 8 lib/test_uuid.c | 8 lib/uuid.c | 14 +++--- 3

[PATCH 06/24] uuid: rename uuid types

2017-05-31 Thread Christoph Hellwig
Our "little endian" UUID really is a Wintel GUID, so rename it and its helpers such (guid_t). The big endian UUID is the only true one, so give it the name uuid_t. The uuid_le and uuid_be names are retained for now, but will hopefully go away soon. The exception to that are the _cmp helpers

[PATCH 07/24] nfsd: namespace-prefix uuid_parse

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/nfsd/export.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index e71f11b1a180..3bc08c394a3f 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -486,7 +486,7 @@

[PATCH 09/24] uuid: don't export guid_index and uuid_index

2017-05-31 Thread Christoph Hellwig
These are only used in uuid.c and vsprintf.c and aren't something modules should use directly. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- lib/uuid.c | 2 -- 1 file changed, 2

[PATCH 11/24] uuid: hoist uuid_is_null() helper from libnvdimm

2017-05-31 Thread Christoph Hellwig
Hoist the libnvdimm helper as an inline helper to linux/uuid.h using an auxiliary const variable uuid_null in lib/uuid.c. [hch: also add the guid variant. Both do the same but I'd like to keep casts to a minimum] The common helper uses the new abstract type uuid_t * instead of u8 *.

[PATCH 12/24] S390/sysinfo: use uuid_is_null instead of opencoding it

2017-05-31 Thread Christoph Hellwig
And switch to use uuid_t instead of the old uuid_be type. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- arch/s390/include/asm/sysinfo.h | 4 ++-- arch/s390/kernel/sysinfo.c

[PATCH 13/24] xfs: remove uuid_getnodeuniq and xfs_uu_t

2017-05-31 Thread Christoph Hellwig
Opencode uuid_getnodeuniq in the only caller, and directly decode the uuid_t representation instead of using a structure cast for it. Signed-off-by: Christoph Hellwig --- fs/xfs/uuid.c | 25 - fs/xfs/uuid.h | 1 - fs/xfs/xfs_mount.c | 5 - 3

[PATCH 17/24] fs: switch ->s_uuid to uuid_t

2017-05-31 Thread Christoph Hellwig
For some file systems we still memcpy into it, but in various places this already allows us to use the proper uuid helpers. More to come.. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Acked-by: Mimi Zohar  (Changes to

[PATCH 15/24] block: remove blk_part_pack_uuid

2017-05-31 Thread Christoph Hellwig
This helper was only used by IMA of all things, which would get spurious errors if CONFIG_BLOCK is disabled. Just opencode the call there. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Acked-by: Mimi Zohar Reviewed-by:

[PATCH 16/24] ima/policy: switch to use uuid_t

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Acked-by: Mimi Zohar Reviewed-by: Andy Shevchenko --- security/integrity/ima/ima_policy.c | 11 +-- 1 file changed, 5

[PATCH 21/24] nvme: switch to uuid_t

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- drivers/nvme/host/fabrics.c | 8 drivers/nvme/host/fabrics.h | 2 +- drivers/nvme/host/fc.c | 3 +--

[PATCH 18/24] overlayfs: use uuid_t instead of uuid_be

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- fs/overlayfs/copy_up.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 19/24] partitions/ldm: switch to use uuid_t

2017-05-31 Thread Christoph Hellwig
And the uuid helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- block/partitions/ldm.c | 10 +- block/partitions/ldm.h | 6 ++ 2 files changed, 7 insertions(+),

[PATCH 20/24] sysctl: switch to use uuid_t

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- kernel/sysctl_binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sysctl_binary.c

[PATCH 24/24] MAINTAINERS: add uuid entry

2017-05-31 Thread Christoph Hellwig
I'll keep maintaining whatever little changed we need here, with Andy as my designated reviewer. Signed-off-by: Christoph Hellwig --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 053c3bdd1fe5..660c14729205 100644 ---

[PATCH 23/24] tmpfs: generate random sb->s_uuid

2017-05-31 Thread Christoph Hellwig
From: Amir Goldstein This is used by overlayfs to encode intrasystem unique file handles. Suggested-by: Miklos Szeredi Cc: Hugh Dickins Cc: Andrew Morton Signed-off-by: Amir Goldstein

[PATCH 22/24] scsi_debug: switch to uuid_t

2017-05-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Amir Goldstein Reviewed-by: Andy Shevchenko --- drivers/scsi/scsi_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_debug.c

[PATCH 10/24] uuid: hoist helpers uuid_equal() and uuid_copy() from xfs

2017-05-31 Thread Christoph Hellwig
These helper are used to compare and copy two uuid_t type objects. Signed-off-by: Amir Goldstein [hch: also provide the respective guid_ versions] Signed-off-by: Christoph Hellwig Reviewed-by: Andy Shevchenko ---

Re: [PATCH v3 5/9] blk-mq: fix blk_mq_quiesce_queue

2017-05-31 Thread Bart Van Assche
On Wed, 2017-05-31 at 20:37 +0800, Ming Lei wrote: > > + /* wait until queue is unquiesced */ > + wait_event_cmd(q->quiesce_wq, !blk_queue_quiesced(q), > + may_sleep ? > + srcu_read_unlock(>queue_rq_srcu, *srcu_idx) : > +

Re: [PATCH v2] cfq-iosched: fix the delay of cfq_group's vdisktime under iops mode

2017-05-31 Thread Jens Axboe
On 05/30/2017 09:09 PM, Hou Tao wrote: > Hi Jens, > > I didn't found the patch in your linux-block git tree and the vanilla git > tree. > Maybe you have forgot this CFQ fix ? Looks like that did get missed, sorry about that. I've queued it up now. -- Jens Axboe

Re: [PATCH v3 3/9] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-05-31 Thread Bart Van Assche
On Wed, 2017-05-31 at 20:37 +0800, Ming Lei wrote: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 99e16ac479e3..ffcf05765e2b 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -3031,7 +3031,10 @@ scsi_internal_device_unblock(struct scsi_device

[xfstests PATCH v3 1/5] generic: add a writeback error handling test

2017-05-31 Thread Jeff Layton
I'm working on a set of kernel patches to change how writeback errors are handled and reported in the kernel. Instead of reporting a writeback error to only the first fsync caller on the file, I aim to make the kernel report them once on every file description. This patch adds a test for the new

[xfstests PATCH v3 0/5] add a test for reporting writeback errors across all fds on fsync

2017-05-31 Thread Jeff Layton
This patchset is a companion to the Linux kernel patch series I recently posted with the cover letter: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it That patchset adds a new userland-visible change to report errors on all open file

[xfstests PATCH v3 2/5] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-05-31 Thread Jeff Layton
The writeback error handling test requires that you put the journal on a separate device. This allows us to use dmerror to simulate data writeback failure, without affecting the journal. xfs already has infrastructure for this (a'la $SCRATCH_LOGDEV), so wire up the ext4 code so that it can do the

[xfstests PATCH v3 5/5] btrfs: allow it to use $SCRATCH_LOGDEV

2017-05-31 Thread Jeff Layton
With btrfs, we can't really put the log on a separate device. What we can do however is mirror the metadata across two devices and make the data striped across all devices. When we turn on dmerror then the metadata can fall back to using the other mirror while the data errors out. Note that the

[xfstests PATCH v3 4/5] ext3: allow it to put journal on a separate device when doing scratch_mkfs

2017-05-31 Thread Jeff Layton
Signed-off-by: Jeff Layton --- common/rc | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 391d36f373cd..83765aacfb06 100644 --- a/common/rc +++ b/common/rc @@ -832,7 +832,16 @@ _scratch_mkfs()

[PATCH v5 02/17] fs: new infrastructure for writeback error handling and reporting

2017-05-31 Thread Jeff Layton
Most filesystems currently use mapping_set_error and filemap_check_errors for setting and reporting/clearing writeback errors at the mapping level. filemap_check_errors is indirectly called from most of the filemap_fdatawait_* functions and from filemap_write_and_wait*. These functions are called

[PATCH v5 01/17] lib: add errseq_t type and infrastructure for handling it

2017-05-31 Thread Jeff Layton
An errseq_t is a way of recording errors in one place, and allowing any number of "subscribers" to tell whether an error has been set again since a previous time. It's implemented as an unsigned 32-bit value that is managed with atomic operations. The low order bits are designated to hold an

[PATCH v5 04/17] fs: add a new fstype flag to indicate how writeback errors are tracked

2017-05-31 Thread Jeff Layton
Now that we have new infrastructure for handling writeback errors using errseq_t, we need to convert the existing code to use it. We could attempt to retrofit the old interfaces on top of the new, but there is a conceptual disconnect here in the case of internal callers that invoke

[PATCH v5 05/17] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-05-31 Thread Jeff Layton
I waxed a little loquacious here, but I figured that more detail was better, and writeback error handling is so hard to get right. Although I think we'll eventually remove it once the transition is complete, I've gone ahead and documented the FS_WB_ERRSEQ flag as well. Cc: Jan Kara

[PATCH v5 14/17] ext4: convert to errseq_t based error tracking

2017-05-31 Thread Jeff Layton
Sample the block device inode's errseq_t when opening a file, so we can catch metadata writeback errors at fsync time. Change ext4_sync_file to check for data errors first, and then check the blockdev for metadata errors afterward. There are also several internal callers of

[PATCH v5 12/17] fs: allow __generic_file_fsync to support both flavors of error reporting

2017-05-31 Thread Jeff Layton
For now, we add a FS_WB_ERRSEQ check to know how to handle it. Signed-off-by: Jeff Layton --- fs/libfs.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 1dec90819366..2ae58a252718 100644 ---

[PATCH v5 09/17] block: convert to errseq_t based writeback error tracking

2017-05-31 Thread Jeff Layton
Fairly straightforward conversion. In fsync, just use the file->f_wb_err value as a "since" value. At the end, call filemap_report_wb_err to advance the cursor in it. Signed-off-by: Jeff Layton --- fs/block_dev.c | 13 ++--- 1 file changed, 10 insertions(+), 3

[PATCH v5 10/17] block: add sync_blockdev_since and sync_filesystem_since

2017-05-31 Thread Jeff Layton
New variants of sync_filesystem and sync_blockdev. Signed-off-by: Jeff Layton --- fs/block_dev.c | 15 +++ fs/internal.h | 8 fs/sync.c | 45 + include/linux/fs.h | 13 - 4 files

[PATCH v5 15/17] fs: add a write_one_page_since

2017-05-31 Thread Jeff Layton
Allow filesystems to pass in an errseq_t for a since value. Signed-off-by: Jeff Layton --- include/linux/mm.h | 2 ++ mm/page-writeback.c | 53 + 2 files changed, 43 insertions(+), 12 deletions(-) diff --git

[PATCH v5 13/17] jbd2: conditionally handle errors using errseq_t based on FS_WB_ERRSEQ flag

2017-05-31 Thread Jeff Layton
Grab the current mapping->wb_err when linking a transaction to the list and stash it in the journal inode. Then we can use that as a "since" value when committing it to ensure that there were no writeback errors since the transaction was started. We do still need to perform old-style error

[PATCH v5 11/17] fs: add f_md_wb_err field to struct file for tracking metadata errors

2017-05-31 Thread Jeff Layton
Some filesystems (particularly local ones) keep a different mapping for metadata writeback. Add a second errseq_t to struct file for tracking metadata writeback errors. Also add a new function for checking a mapping of the caller's choosing vs. the f_md_wb_err value. Signed-off-by: Jeff Layton

[PATCH v5 16/17] ext2: convert to errseq_t based writeback error tracking

2017-05-31 Thread Jeff Layton
Set the flag to indicate that we want new-style data writeback error handling. This means that we need to override the open routines for files and directories so that we can sample the bdev wb_err at open. XXX: doesn't quite pass the xfstest for this currently, as ext2_error resets the

[PATCH v5 07/17] mm: add filemap_fdatawait_range_since and filemap_write_and_wait_range_since

2017-05-31 Thread Jeff Layton
Add new filemap_*wait* variants that take a "since" value and return an error if one occurred since that sample point. Signed-off-by: Jeff Layton --- include/linux/fs.h | 9 mm/filemap.c | 67 ++ 2 files

[PATCH v5 17/17] fs: convert ext2 to use write_one_page_since

2017-05-31 Thread Jeff Layton
Sample the wb_err before changing the directory, so that we can catch errors that occur since that point. Signed-off-by: Jeff Layton --- fs/ext2/dir.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index

[PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-05-31 Thread Jeff Layton
v5: don't retrofit old API over the new infrastructure add fstype flag to indicate how wb errors are tracked within that fs add more function variants that take a errseq_t "since" value add second errseq_t to struct file to track metadata wb errors convert ext4 and ext2 to use the

[PATCH v5 03/17] mm: tracepoints for writeback error events

2017-05-31 Thread Jeff Layton
To enable that, make __errseq_set return the value that it was set to we exit the loop. Take heed that that value is not suitable as a later "since" value, as it will not have been marked seen. Signed-off-by: Jeff Layton --- include/linux/errseq.h | 2 +-

[PATCH v3 9/9] Revert "blk-mq: don't use sync workqueue flushing from drivers"

2017-05-31 Thread Ming Lei
This patch reverts commit 2719aa217e0d02(blk-mq: don't use sync workqueue flushing from drivers) because only blk_mq_quiesce_queue() need the sync flush, and now we don't need to stop queue any more, so revert it. Also changes to cancel_delayed_work() in blk_mq_stop_hw_queue(). Signed-off-by:

[PATCH v3 8/9] blk-mq: clarify dispatch may not be drained/blocked by stopping queue

2017-05-31 Thread Ming Lei
BLK_MQ_S_STOPPED may not be observed in other concurrent I/O paths, we can't guarantee that dispatching won't happen after returning from the APIs of stopping queue. So clarify the fact and avoid potential misuse. Signed-off-by: Ming Lei --- block/blk-mq.c | 10 ++

[PATCH v3 7/9] blk-mq: don't stop queue for quiescing

2017-05-31 Thread Ming Lei
Queue can be started by other blk-mq APIs and can be used in different cases, this limits uses of blk_mq_quiesce_queue() if it is based on stopping queue, and make its usage very difficult, especially users have to use the stop queue APIs carefully for avoiding to break blk_mq_quiesce_queue(). We

[PATCH v3 4/9] nvme: host: unquiesce queue in nvme_kill_queues()

2017-05-31 Thread Ming Lei
When nvme_kill_queues() is run, queues may be in quiesced state, so we forcibly unquiesce queues to avoid blocking dispatch, and I/O hang can be avoided in remove path. Peviously we use blk_mq_start_stopped_hw_queues() as counterpart of blk_mq_quiesce_queue(), now we have introduced

[PATCH v3 2/9] block: introduce flag of QUEUE_FLAG_QUIESCED

2017-05-31 Thread Ming Lei
This flag is introduced for improving the quiescing code. Signed-off-by: Ming Lei --- include/linux/blkdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 41291be82ac4..60967797f4f6 100644 ---

[PATCH v3 0/8] blk-mq: fix & improve queue quiescing

2017-05-31 Thread Ming Lei
There is one big issue in current blk_mq_quiesce_queue(): - in case of direct issue or BLK_MQ_S_START_ON_RUN, dispatch won't be prevented after blk_mq_quiesce_queue() is returned. It is observed that request double-free/use-after-free can be triggered easily when canceling NVMe requests

Re: [PATCH v2 5/8] blk-mq: update comments on blk_mq_quiesce_queue()

2017-05-31 Thread Ming Lei
On Tue, May 30, 2017 at 05:14:44PM +, Bart Van Assche wrote: > On Sat, 2017-05-27 at 22:21 +0800, Ming Lei wrote: > > /** > > - * blk_mq_quiesce_queue() - wait until all ongoing queue_rq calls have > > finished > > + * blk_mq_quiesce_queue() - wait until all ongoing dispatching have > >

Re: [PATCH 01/22] Revert "afs: Move UUID struct to linux/uuid.h"

2017-05-31 Thread Christoph Hellwig
On Tue, May 30, 2017 at 11:00:04AM +0100, David Howells wrote: > This isn't going to work. You've effectively changed the types of the fields > in the UUID struct from BE to CPU-endian, but you're still calling > generate_random_uuid(), which produces a BE UUID. You need to leave the > struct

Re: [PATCH 09/10] xfs: nowait aio support

2017-05-31 Thread Jan Kara
On Tue 30-05-17 11:13:29, Goldwyn Rodrigues wrote: > > Btw, can you write a small blurb up for the man page to document these > > ѕemantics in man-page like language? > > > > Yes, but which man page would it belong to? > Should it be a subsection of errors in io_getevents/io_submit. We don't >