[dm-devel] [mdadm PATCH] Create: tell udev md device is not ready when first created.

2017-04-27 Thread NeilBrown
When an array is created the content is not initialized, so it could have remnants of an old filesystem or md array etc on it. udev will see this and might try to activate it, which is almost certainly not what is wanted. So create a mechanism for mdadm to communicate with udev to tell it that

Re: [dm-devel] [mdadm PATCH 4/4] Create: tell udev device is not ready when first created.

2017-04-27 Thread NeilBrown
On Wed, Apr 26 2017, Peter Rajnoha wrote: > On 04/20/2017 11:35 PM, NeilBrown wrote: >> On Thu, Apr 20 2017, Jes Sorensen wrote: > ... >>> Second, isn't this going to be racey if you have multiple arrays >>> running? I am wondering if we cannot find a solution that relies on a >>> permanently

Re: [dm-devel] [PATCH v2 11/13] dm-mpath: Micro-optimize the hot path

2017-04-27 Thread Mike Snitzer
On Thu, Apr 27 2017 at 1:11P -0400, Bart Van Assche wrote: > Instead of checking MPATHF_QUEUE_IF_NO_PATH, > MPATHF_SAVED_QUEUE_IF_NO_PATH and the no_flush flag to decide whether > or not to push back a request if there are no paths available, only > clear

Re: [dm-devel] [PATCH v2 05/13] dm-mpath: Make it easier to analyze requeuing behavior

2017-04-27 Thread Bart Van Assche
On Thu, 2017-04-27 at 15:29 -0400, Mike Snitzer wrote: > Documentation/process/coding-style.rst says: > "Coming up with good debugging messages can be quite a challenge; and once > you have them, they can be a huge help for remote troubleshooting. However > debug message printing is handled

Re: [dm-devel] [PATCH v2 04/13] dm-rq: Adjust requeuing delays

2017-04-27 Thread Bart Van Assche
On Thu, 2017-04-27 at 15:16 -0400, Mike Snitzer wrote: > This call toblk_mq_delay_run_hw_queue(), while unconvincing and suspect, > is being introduced via block core during the 4.12 merge. > > But in general, this tweaking of the timeouts in such a short period > speaks to indecision and leaves

Re: [dm-devel] [PATCH v2 05/13] dm-mpath: Make it easier to analyze requeuing behavior

2017-04-27 Thread Mike Snitzer
On Thu, Apr 27 2017 at 1:11P -0400, Bart Van Assche wrote: > When debugging the dm-mpath driver it is important to know what > decisions have been taken with regard to requeuing. Hence this > patch that adds pr_debug() statements that report what decisions > have

Re: [dm-devel] [PATCH v2 04/13] dm-rq: Adjust requeuing delays

2017-04-27 Thread Mike Snitzer
On Thu, Apr 27 2017 at 1:11P -0400, Bart Van Assche wrote: > Reduce the requeue delay in dm_requeue_original_request() from 5s > to 0.5s to avoid that this delay slows down failover or failback. > Increase the requeue delay in dm_mq_queue_rq() from 0.1s to 0.5s > to

[dm-devel] [PATCH v2 13/13] dm, dm-mpath: Make it easier to detect unintended I/O request flushes

2017-04-27 Thread Bart Van Assche
I/O errors triggered by multipathd incorrectly not enabling the no-flush flag for DM_DEVICE_SUSPEND or DM_DEVICE_RESUME are hard to debug. Add more logging to make it easier to debug this. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke ---

[dm-devel] [PATCH v2 11/13] dm-mpath: Micro-optimize the hot path

2017-04-27 Thread Bart Van Assche
Instead of checking MPATHF_QUEUE_IF_NO_PATH, MPATHF_SAVED_QUEUE_IF_NO_PATH and the no_flush flag to decide whether or not to push back a request if there are no paths available, only clear MPATHF_QUEUE_IF_NO_PATH in queue_if_no_path() if no_flush has not been set. The result is that only a single

[dm-devel] [PATCH v2 09/13] dm-mpath: Verify locking assumptions at runtime

2017-04-27 Thread Bart Van Assche
Verify at runtime that __pg_init_all_paths() is called with multipath.lock held if lockdep is enabled. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/md/dm-mpath.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[dm-devel] [PATCH v2 10/13] dm: Introduce enum dm_queue_mode

2017-04-27 Thread Bart Van Assche
Introduce an enumeration type for the queue mode. This patch does not change any functionality but makes the dm code easier to read. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/md/dm-core.h | 2 +-

[dm-devel] [PATCH v2 07/13] dm, persistence: Remove an unused argument from dm_block_manager_create()

2017-04-27 Thread Bart Van Assche
The 'cache_size' argument of dm_block_manager_create() has never been used. Hence remove it and also the definitions of the constants passed as 'cache_size' argument. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke ---

[dm-devel] [PATCH v2 08/13] dm: Verify suspend_locking assumptions at runtime

2017-04-27 Thread Bart Van Assche
Ensure that the assumptions about the caller holding suspend_lock are checked at runtime if lockdep is enabled. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/md/dm-table.c | 4 drivers/md/dm.c | 9 - 2

[dm-devel] [PATCH v2 06/13] dm-rq: Check blk_mq_register_dev() return value

2017-04-27 Thread Bart Van Assche
blk_mq_register_dev() can fail. Hence check the return value of that function. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig --- drivers/md/dm-rq.c | 6 +- 1 file changed, 5 insertions(+), 1

[dm-devel] [PATCH v2 03/13] dm-mpath: Delay requeuing while path initialization is in progress

2017-04-27 Thread Bart Van Assche
Requeuing a request immediately while path initialization is ongoing causes high CPU usage, something that is undesired. Hence delay requeuing while path initialization is in progress. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc:

[dm-devel] [PATCH v2 02/13] dm-mpath: Avoid that path removal can trigger an infinite loop

2017-04-27 Thread Bart Van Assche
If blk_get_request() fails check whether the failure is due to a path being removed. If that is the case fail the path by triggering a call to fail_path(). This patch avoids that the following scenario can be encountered while removing paths: * CPU usage of a kworker thread jumps to 100%. *

[dm-devel] [PATCH v2 00/13] Device mapper and dm-mpath patches

2017-04-27 Thread Bart Van Assche
Hello Mike, The patches in this series are: * A few fixes for bugs in the dm-mpath driver I ran into while testing this driver. * A resend of various dm / dm-mpath patches I had posted before but for which I'm still waiting for a review from you. Please consider at least the dm-mpath bug

[dm-devel] [PATCH v2 05/13] dm-mpath: Make it easier to analyze requeuing behavior

2017-04-27 Thread Bart Van Assche
When debugging the dm-mpath driver it is important to know what decisions have been taken with regard to requeuing. Hence this patch that adds pr_debug() statements that report what decisions have been taken. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke

Re: [dm-devel] [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function

2017-04-27 Thread Logan Gunthorpe
On 26/04/17 09:56 PM, Herbert Xu wrote: > On Tue, Apr 25, 2017 at 12:20:54PM -0600, Logan Gunthorpe wrote: >> Very straightforward conversion to the new function in the caam driver >> and shash library. >> >> Signed-off-by: Logan Gunthorpe >> Cc: Herbert Xu

Re: [dm-devel] [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 12:53 AM, Christoph Hellwig wrote: > I think you'll need to follow the existing kmap semantics and never > fail the iomem version either. Otherwise you'll have a special case > that's almost never used that has a different error path. > > Again, wrong way. Suddenly making things

Re: [dm-devel] [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 27/04/17 09:27 AM, Jason Gunthorpe wrote: > On Thu, Apr 27, 2017 at 08:53:38AM +0200, Christoph Hellwig wrote: > How about first switching as many call sites as possible to use > sg_copy_X_buffer instead of kmap? Yeah, I could look at doing that first. One problem is we might get more Naks

Re: [dm-devel] [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Jason Gunthorpe
On Thu, Apr 27, 2017 at 08:53:38AM +0200, Christoph Hellwig wrote: > > The main difficulty we > > have now is that neither of those functions are expected to fail and we > > need them to be able to in cases where the page doesn't map to system > > RAM. This patch series is trying to address it

[dm-devel] [PATCH v1] dm-crypt: replace custom implementation of hex2bin()

2017-04-27 Thread Andy Shevchenko
From: Andy Shevchenko There is no need to have a duplication of the generic library, i.e. hex2bin(). Replace the open coded variant. Signed-off-by: Andy Shevchenko --- drivers/md/dm-crypt.c | 27 ++- 1 file changed,

Re: [dm-devel] [PATCH] dm ioctl: prevent stack leak in dm ioctl call

2017-04-27 Thread Alasdair G Kergon
On Tue, Apr 25, 2017 at 05:33:19PM -0700, Adrian Salido wrote: > Will update the patch to be clear So at the moment, we're leaning towards just: param->data_size = offsetof(struct dm_ioctl, data) to replace param->data_size = sizeof(*param); in the caller. Alasdair -- dm-devel mailing

Re: [dm-devel] [PATCH 02/13] dm-mpath: Avoid that path removal can trigger an infinite loop

2017-04-27 Thread Mike Snitzer
On Thu, Apr 27 2017 at 11:13am -0400, Hannes Reinecke wrote: > On 04/27/2017 05:11 PM, Bart Van Assche wrote: > > On Thu, 2017-04-27 at 07:46 +0200, Hannes Reinecke wrote: > >> On 04/26/2017 08:37 PM, Bart Van Assche wrote: > >>> + clone = blk_get_request(q, rq->cmd_flags |

Re: [dm-devel] [PATCH 02/13] dm-mpath: Avoid that path removal can trigger an infinite loop

2017-04-27 Thread Hannes Reinecke
On 04/27/2017 05:11 PM, Bart Van Assche wrote: > On Thu, 2017-04-27 at 07:46 +0200, Hannes Reinecke wrote: >> On 04/26/2017 08:37 PM, Bart Van Assche wrote: >>> + clone = blk_get_request(q, rq->cmd_flags | REQ_NOMERGE, GFP_ATOMIC); >>> if (IS_ERR(clone)) { >>> /* EBUSY, ENODEV or

Re: [dm-devel] [PATCH 02/13] dm-mpath: Avoid that path removal can trigger an infinite loop

2017-04-27 Thread Bart Van Assche
On Thu, 2017-04-27 at 07:46 +0200, Hannes Reinecke wrote: > On 04/26/2017 08:37 PM, Bart Van Assche wrote: > > + clone = blk_get_request(q, rq->cmd_flags | REQ_NOMERGE, GFP_ATOMIC); > > if (IS_ERR(clone)) { > > /* EBUSY, ENODEV or EWOULDBLOCK: requeue */ > > - return r;

Re: [dm-devel] [PATCH 3.18-stable] dm bufio: hide bogus warning

2017-04-27 Thread Greg KH
On Fri, Apr 21, 2017 at 03:41:10PM +0200, Arnd Bergmann wrote: > mips-gcc-5.3 warns about correct code on linux-3.18 and earlier: > > In file included from ../include/linux/blkdev.h:4:0, > from ../drivers/md/dm-bufio.h:12, > from ../drivers/md/dm-bufio.c:9: >

Re: [dm-devel] [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 26/04/17 01:44 AM, Christoph Hellwig wrote: > I think we'll at least need a draft of those to make sense of these > patches. Otherwise they just look very clumsy. Ok, I'll work up a draft proposal and send it in a couple days. But without a lot of cleanup such as this series it's not going

Re: [dm-devel] [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions

2017-04-27 Thread Logan Gunthorpe
On 26/04/17 02:59 AM, wrote: > Good to know that somebody is working on this. Those problems troubled > us as well. Thanks Christian. It's a daunting problem and a there's a lot of work to do before we will ever be where we need to be so any help, even an ack, is greatly appreciated. Logan

Re: [dm-devel] [PATCH 13/13] dm, dm-mpath: Make it easier to detect unintended I/O request flushes

2017-04-27 Thread Hannes Reinecke
On 04/26/2017 08:37 PM, Bart Van Assche wrote: > I/O errors triggered by multipathd incorrectly not enabling the > no-flush flag for DM_DEVICE_SUSPEND or DM_DEVICE_RESUME are hard to > debug. Add more logging to make it easier to debug this. > > Signed-off-by: Bart Van Assche

Re: [dm-devel] [PATCH 12/13] dm-mpath: Introduce assign_bit()

2017-04-27 Thread Hannes Reinecke
On 04/26/2017 08:37 PM, Bart Van Assche wrote: > This patch does not change any functionality but makes the code > easier to read. > > Signed-off-by: Bart Van Assche > Cc: Hannes Reinecke > --- > drivers/md/dm-mpath.c | 37

Re: [dm-devel] [PATCH 11/13] dm-mpath: Micro-optimize the hot path

2017-04-27 Thread Hannes Reinecke
On 04/26/2017 08:37 PM, Bart Van Assche wrote: > Instead of checking MPATHF_QUEUE_IF_NO_PATH, > MPATHF_SAVED_QUEUE_IF_NO_PATH and the no_flush flag to decide whether > or not to push back a request if there are no paths available, only > clear MPATHF_QUEUE_IF_NO_PATH in queue_if_no_path() if

Re: [dm-devel] small dm mpath cleanups

2017-04-27 Thread h...@lst.de
On Wed, Apr 26, 2017 at 06:41:27PM +, Bart Van Assche wrote: > On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > > this series has some prep patches for my work to have proper, type > > checked block errors codes. One fallout of that is that we need to > > get rid of how dm

Re: [dm-devel] [PATCH 08/13] dm: Verify suspend_locking assumptions at runtime

2017-04-27 Thread Hannes Reinecke
On 04/26/2017 08:37 PM, Bart Van Assche wrote: > Ensure that the assumptions about the caller holding suspend_lock > are checked at runtime if lockdep is enabled. > > Signed-off-by: Bart Van Assche > Cc: Hannes Reinecke > --- > drivers/md/dm-table.c |