Re: [dm-devel] [PATCH] fix an integer overflow in __blkdev_sectors_to_bio_pages

2017-08-14 Thread Damien Le Moal
On 8/15/17 09:01, Mikulas Patocka wrote: > > > On Mon, 14 Aug 2017, Damien Le Moal wrote: > >> On Sun, 2017-08-13 at 22:47 -0400, Mikulas Patocka wrote: >>> >>> On Wed, 9 Aug 2017, h...@lst.de wrote: >>> Does commit 615d22a51c04856efe62af6e1d5b450aaf5cc2c0 "block: Fix

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread Mikulas Patocka
On Tue, 15 Aug 2017, Tom Yan wrote: > Just tested the patch with kernel 4.12.6. Well it sort of worked. No > more OOM or kernel panic. Memory takeup is around ~250M on a machine > with 8G RAM. However I keep getting this: > > Aug 15 04:04:10 archlinux kernel: INFO: task blkdiscard:538 blocked

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread Mikulas Patocka
On Mon, 14 Aug 2017, John Stoffel wrote: > > "Mikulas" == Mikulas Patocka writes: > > Mikulas> dm-crypt consumes excessive amount memory when the user attempts to > zero > Mikulas> a dm-crypt device with "blkdiscard -z". The command "blkdiscard -z" > calls >

[dm-devel] [PATCH] fix an integer overflow in __blkdev_sectors_to_bio_pages

2017-08-14 Thread Mikulas Patocka
On Mon, 14 Aug 2017, Damien Le Moal wrote: > On Sun, 2017-08-13 at 22:47 -0400, Mikulas Patocka wrote: > > > > On Wed, 9 Aug 2017, h...@lst.de wrote: > > > > > Does commit 615d22a51c04856efe62af6e1d5b450aaf5cc2c0 > > > "block: Fix __blkdev_issue_zeroout loop" fix the issue for you? > > > > >

[dm-devel] [PATCH 1/3] kpartx/devmapper.h: remove dm_no_partitions

2017-08-14 Thread Martin Wilck
This removes the deleted function from the header file. Fixes: 2ea69fc9 'kpartx: remove "no_partitions" support' Signed-off-by: Martin Wilck --- kpartx/devmapper.h | 1 - 1 file changed, 1 deletion(-) diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h index

[dm-devel] [PATCH 2/3] libmultipath: cli_add_map: Use CMD_NONE

2017-08-14 Thread Martin Wilck
Commands issued from the daemon itself should always pass CMD_NONE to coalesce_paths. Otherwise, the daemon mistakenly tries to talk to itself via the socket, causing deadlock. Reproduce simply by calling "multipathd add map $X". Fixes: d19936f4 "libmultipath: Do not access 'conf->cmd' in

[dm-devel] [PATCH 0/3] some minor multipath-tools fixes

2017-08-14 Thread Martin Wilck
Fix some glitches that were discovered recently here at SUSE. Martin Wilck (3): kpartx/devmapper.h: remove dm_no_partitions libmultipath: cli_add_map: Use CMD_NONE multipath-tools: link internal libraries before foreigns kpartx/devmapper.h| 1 - mpathpersist/Makefile | 4 ++--

[dm-devel] [PATCH 3/3] multipath-tools: link internal libraries before foreigns

2017-08-14 Thread Martin Wilck
Otherwise, the runtime linker may resolve foreign symbols instead of internal ones for certain symbol names (observed with xfree() from libreadline). Reported-by: nikola.pajkov...@suse.com Signed-off-by: Martin Wilck --- mpathpersist/Makefile | 4 ++-- multipath/Makefile| 4

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread John Stoffel
> "Mikulas" == Mikulas Patocka writes: Mikulas> dm-crypt consumes excessive amount memory when the user attempts to zero Mikulas> a dm-crypt device with "blkdiscard -z". The command "blkdiscard -z" calls Mikulas> the BLKZEROOUT ioctl, it goes to the function

[dm-devel] [PATCH v5 08/19] crypto: move drbg to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
DRBG is starting an async. crypto op and waiting for it complete. Move it over to generic code doing the same. The code now also passes CRYPTO_TFM_REQ_MAY_SLEEP flag indicating crypto request memory allocation may use GFP_KERNEL which should be perfectly fine as the code is obviously sleeping for

[dm-devel] [PATCH v5 11/19] fscrypt: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
fscrypt starts several async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- fs/crypto/crypto.c | 28 fs/crypto/fname.c | 36

[dm-devel] [PATCH v5 16/19] crypto: talitos: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The talitos driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/talitos.c | 38 +- 1 file changed, 5 insertions(+), 33

[dm-devel] [PATCH v5 12/19] dm: move dm-verity to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
dm-verity is starting async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. This also fixes a possible data coruption bug created by the use of wait_for_completion_interruptible() without dealing correctly with an interrupt aborting the wait prior to the

[dm-devel] [PATCH v5 18/19] crypto: mediatek: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The mediatek driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/mediatek/mtk-aes.c | 31 +-- 1 file changed, 5 insertions(+), 26

[dm-devel] [PATCH v5 17/19] crypto: qce: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The qce driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/qce/sha.c | 30 -- 1 file changed, 4 insertions(+), 26 deletions(-)

[dm-devel] [PATCH v5 14/19] ima: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
ima starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef Acked-by: Mimi Zohar --- security/integrity/ima/ima_crypto.c | 56

[dm-devel] [PATCH v5 13/19] cifs: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
cifs starts an async. crypto op and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef Acked-by: Pavel Shilovsky --- fs/cifs/smb2ops.c | 30 -- 1 file changed, 4

[dm-devel] [PATCH v5 10/19] crypto: move testmgr to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
testmgr is starting async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. This also provides a test of the generic crypto async. wait code. Signed-off-by: Gilad Ben-Yossef --- crypto/testmgr.c | 204

[dm-devel] [PATCH v5 09/19] crypto: move gcm to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
gcm is starting an async. crypto op and waiting for it complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/gcm.c | 32 ++-- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/crypto/gcm.c

[dm-devel] [PATCH v5 07/19] crypto: move pub key to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
public_key_verify_signature() is starting an async crypto op and waiting for it to complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/asymmetric_keys/public_key.c | 28 1 file changed, 4

[dm-devel] [PATCH v5 06/19] crypto: move algif to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
algif starts several async crypto ops and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/af_alg.c | 27 --- crypto/algif_aead.c | 8 crypto/algif_hash.c |

[dm-devel] [PATCH v5 05/19] crypto: introduce crypto wait for async op

2017-08-14 Thread Gilad Ben-Yossef
Invoking a possibly async. crypto op and waiting for completion while correctly handling backlog processing is a common task in the crypto API implementation and outside users of it. This patch adds a generic implementation for doing so in preparation for using it across the board instead of hand

[dm-devel] [PATCH v5 04/19] crypto: marvell/cesa: remove redundant backlog checks on EBUSY

2017-08-14 Thread Gilad Ben-Yossef
Now that -EBUSY return code only indicates backlog queueing we can safely remove the now redundant check for the CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/marvell/cesa.c | 3 +-- drivers/crypto/marvell/cesa.h

[dm-devel] [PATCH v5 03/19] crypto: remove redundant backlog checks on EBUSY

2017-08-14 Thread Gilad Ben-Yossef
Now that -EBUSY return code only indicates backlog queueing we can safely remove the now redundant check for the CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned. Signed-off-by: Gilad Ben-Yossef --- crypto/ahash.c| 12 +++- crypto/cts.c | 6

[dm-devel] [PATCH v5 02/19] crypto: ccp: use -EAGAIN for transient busy indication

2017-08-14 Thread Gilad Ben-Yossef
Replace -EBUSY with -EAGAIN when reporting transient busy indication in the absence of backlog. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccp/ccp-crypto-main.c | 8 +++- drivers/crypto/ccp/ccp-dev.c | 7 +-- 2 files changed, 8 insertions(+), 7

[dm-devel] [PATCH v5 00/19] simplify crypto wait for async op

2017-08-14 Thread Gilad Ben-Yossef
Many users of kernel async. crypto services have a pattern of starting an async. crypto op and than using a completion to wait for it to end. This patch set simplifies this common use case in two ways: First, by separating the return codes of the case where a request is queued to a backlog due

[dm-devel] [PATCH v5 01/19] crypto: change transient busy return code to -EAGAIN

2017-08-14 Thread Gilad Ben-Yossef
The crypto API was using the -EBUSY return value to indicate both a hard failure to submit a crypto operation into a transformation provider when the latter was busy and the backlog mechanism was not enabled as well as a notification that the operation was queued into the backlog when the backlog