Re: [dm-devel] [PATCH] dm zoned: Fix metadata zone size check

2020-06-17 Thread Damien Le Moal
On 2020/06/18 11:48, Shin'ichiro Kawasaki wrote: > When dm zoned has multiple devices, metadata is on the cache device, not > in random zones of the zoned devices. Then the number of metadata zones > shall be checked with the number of cache zones, not random zones. > > Fixes: 34f5affd04c4 ("dm

[dm-devel] [PATCH] dm zoned: Fix metadata zone size check

2020-06-17 Thread Shin'ichiro Kawasaki
When dm zoned has multiple devices, metadata is on the cache device, not in random zones of the zoned devices. Then the number of metadata zones shall be checked with the number of cache zones, not random zones. Fixes: 34f5affd04c4 ("dm zoned: separate random and cache zones") Signed-off-by:

[dm-devel] [PATCH AUTOSEL 4.14 069/108] dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone

2020-06-17 Thread Sasha Levin
From: Hannes Reinecke [ Upstream commit 489dc0f06a5837f87482c0ce61d830d24e17082e ] The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make

[dm-devel] [PATCH AUTOSEL 4.14 019/108] dm mpath: switch paths in dm_blk_ioctl() code path

2020-06-17 Thread Sasha Levin
From: Martin Wilck [ Upstream commit 2361ae595352dec015d14292f1b539242d8446d6 ] SCSI LUN passthrough code such as qemu's "scsi-block" device model pass every IO to the host via SG_IO ioctls. Currently, dm-multipath calls choose_pgpath() only in the block IO code path, not in the ioctl code path

[dm-devel] [PATCH AUTOSEL 4.19 107/172] dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone

2020-06-17 Thread Sasha Levin
From: Hannes Reinecke [ Upstream commit 489dc0f06a5837f87482c0ce61d830d24e17082e ] The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make

[dm-devel] [PATCH AUTOSEL 4.19 025/172] dm mpath: switch paths in dm_blk_ioctl() code path

2020-06-17 Thread Sasha Levin
From: Martin Wilck [ Upstream commit 2361ae595352dec015d14292f1b539242d8446d6 ] SCSI LUN passthrough code such as qemu's "scsi-block" device model pass every IO to the host via SG_IO ioctls. Currently, dm-multipath calls choose_pgpath() only in the block IO code path, not in the ioctl code path

[dm-devel] [PATCH AUTOSEL 5.4 172/266] dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone

2020-06-17 Thread Sasha Levin
From: Hannes Reinecke [ Upstream commit 489dc0f06a5837f87482c0ce61d830d24e17082e ] The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make

[dm-devel] [PATCH AUTOSEL 5.7 047/388] dm mpath: switch paths in dm_blk_ioctl() code path

2020-06-17 Thread Sasha Levin
From: Martin Wilck [ Upstream commit 2361ae595352dec015d14292f1b539242d8446d6 ] SCSI LUN passthrough code such as qemu's "scsi-block" device model pass every IO to the host via SG_IO ioctls. Currently, dm-multipath calls choose_pgpath() only in the block IO code path, not in the ioctl code path

[dm-devel] [PATCH AUTOSEL 5.7 252/388] dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone

2020-06-17 Thread Sasha Levin
From: Hannes Reinecke [ Upstream commit 489dc0f06a5837f87482c0ce61d830d24e17082e ] The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make

[dm-devel] [PATCH 6/7] multipath: delegate flushing maps to multipathd

2020-06-17 Thread Benjamin Marzinski
Since there can be problems with removing maps outside of multipathd, multipath should attempt to delegate this command to multipathd. However, multipathd doesn't attempt to suspend the device, in order to avoid potential hangs. If delegating to multipathd fails, multipath should try the remove

[dm-devel] [PATCH 7/7] multipath: add option to skip multipathd delegation

2020-06-17 Thread Benjamin Marzinski
Add the -D option to allow users to skip delegating commands to multipathd. Signed-off-by: Benjamin Marzinski --- libmultipath/config.h | 1 + multipath/main.c | 15 +++ multipath/multipath.8 | 16 +++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git

[dm-devel] [PATCH 0/7] Fix muitpath/multipathd flush issue

2020-06-17 Thread Benjamin Marzinski
If a multipath device is removed, and check_path() checks one of its paths before multipathd processes either the uevent or the dm event from removing it, multipathd will recreate the removed device. This happens because check_path() will continute to check the removed device's former paths until

[dm-devel] [PATCH 1/7] libmultipath: change do_get_info returns

2020-06-17 Thread Benjamin Marzinski
Make do_get_info() differentiate between dm failures and missing devices, and update callers to retain their current behavior. Also, rename it and make it external. These changes will be used by future commits. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 29

Re: [dm-devel] dm writecache: correct uncommitted_block when discarding uncommitted entry

2020-06-17 Thread Mike Snitzer
On Sat, Jun 13 2020 at 8:40am -0400, Mikulas Patocka wrote: > > > On Fri, 12 Jun 2020, Huaisheng Ye wrote: > > > From: Huaisheng Ye > > > > When uncommitted entry has been discarded, correct wc->uncommitted_block > > for getting the exact number. > > > > Signed-off-by: Huaisheng Ye > >

Re: [dm-devel] dm ioctl: Use struct_size() helper

2020-06-17 Thread Mike Snitzer
On Tue, Jun 16 2020 at 6:06pm -0400, Gustavo A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this? > > It's been almost a year... and I just noticed there was a problem > with the email addresses back then... > > I just fixed the issue and this patch should now appear on >

[dm-devel] [PATCH 3/3] dm-crypt: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-17 Thread Mikulas Patocka
Don't use crypto drivers that have the flag CRYPTO_ALG_ALLOCATES_MEMORY set. These drivers allocate memory and thus they are unsuitable for block I/O processing. Signed-off-by: Mikulas Patocka --- drivers/md/dm-crypt.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-)

[dm-devel] [PATCH 2/3] crypto: set the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-17 Thread Mikulas Patocka
Set the flag CRYPTO_ALG_ALLOCATES_MEMORY in the crypto drivers that allocate memory. drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c: sun8i_ce_cipher drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c: sun8i_ss_cipher drivers/crypto/amlogic/amlogic-gxl-core.c: meson_cipher

[dm-devel] [PATCH 1/3] crypto: pass the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-17 Thread Mikulas Patocka
Introduce a new flag CRYPTO_ALG_ALLOCATES_MEMORY and pass it down the crypto stack. If the flag is set, then the crypto driver allocates memory in its request routine. Such drivers are not suitable for disk encryption because GFP_ATOMIC allocation can fail anytime (causing random I/O errors) and

Re: [dm-devel] [PATCH 1/4] crypto: introduce CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-17 Thread Mikulas Patocka
I'm resending the patches with your comments resolved... Mikulas On Tue, 16 Jun 2020, Eric Biggers wrote: > On Tue, Jun 16, 2020 at 11:01:31AM -0400, Mikulas Patocka wrote: > > Introduce a new flag CRYPTO_ALG_ALLOCATES_MEMORY and modify dm-crypt, so > > that it uses only drivers without this

Re: [dm-devel] [PATCH 2/2] hisilicon-crypto: don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified

2020-06-17 Thread Jonathan Cameron
On Wed, 17 Jun 2020 09:49:52 -0400 Mikulas Patocka wrote: > There is this call chain: > sec_alg_skcipher_encrypt -> sec_alg_skcipher_crypto -> > sec_alg_alloc_and_calc_split_sizes -> kcalloc > where we call sleeping allocator function even if CRYPTO_TFM_REQ_MAY_SLEEP > was not specified. > >

[dm-devel] [PATCH 2/2] hisilicon-crypto: don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified

2020-06-17 Thread Mikulas Patocka
There is this call chain: sec_alg_skcipher_encrypt -> sec_alg_skcipher_crypto -> sec_alg_alloc_and_calc_split_sizes -> kcalloc where we call sleeping allocator function even if CRYPTO_TFM_REQ_MAY_SLEEP was not specified. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org # v4.19+

[dm-devel] [PATCH 1/2] cpt-crypto: don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified

2020-06-17 Thread Mikulas Patocka
There is this call chain: cvm_encrypt -> cvm_enc_dec -> cptvf_do_request -> process_request -> kzalloc where we call sleeping allocator function even if CRYPTO_TFM_REQ_MAY_SLEEP was not specified. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org # v4.11+ Fixes: c694b233295b

Re: [dm-devel] [PATCH] multipath-tools: Fix compiler warnings when built without systemd.

2020-06-17 Thread Marius Bakke
Martin Wilck writes: > Hello Marius, > > On Sat, 2020-05-16 at 19:55 +0200, Marius Bakke wrote: >> --- >> libmultipath/config.c | 2 +- >> multipathd/main.c | 19 +-- >> 2 files changed, 14 insertions(+), 7 deletions(-) >> > > thank you for the patch, and sorry for the

Re: [dm-devel] [PATCH 0/2] introduce interface to list all badblocks

2020-06-17 Thread yangerkun
在 2020/6/16 20:28, Bryn M. Reeves 写道: On Mon, Jun 15, 2020 at 06:03:31PM +0100, Alasdair G Kergon wrote: On Mon, Jun 08, 2020 at 04:45:11PM +0800, yangerkun wrote: $ sudo dmsetup message dust1 0 listbadblocks The following message will appear, listing one bad block number per Did you

[dm-devel] [PATCH v2] multipath: Fix compiler warnings when built without systemd.

2020-06-17 Thread Marius Bakke
Add ifdef guards for code that is unused when systemd is not available. --- libmultipath/config.c | 6 -- multipathd/main.c | 10 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index b4d87689..658bec8b 100644 ---

Re: [dm-devel] [PATCH v2] multipath: Fix compiler warnings when built without systemd.

2020-06-17 Thread Martin Wilck
On Wed, 2020-06-17 at 01:11 +0200, Marius Bakke wrote: > Add ifdef guards for code that is unused when systemd is not > available. > --- > libmultipath/config.c | 6 -- > multipathd/main.c | 10 +- > 2 files changed, 13 insertions(+), 3 deletions(-) > Reviewed-by: Martin Wilck