[dm-devel] [PATCH 15/15] block: use bvec_kmap_local in bio_integrity_process

2021-07-26 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bio-integrity.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/b

[dm-devel] [PATCH 14/15] block: use bvec_kmap_local in t10_pi_type1_{prepare, complete}

2021-07-26 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/t10-pi.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block

[dm-devel] [PATCH 13/15] block: use memcpy_from_bvec in __blk_queue_bounce

2021-07-26 Thread Christoph Hellwig
Rewrite the actual bounce buffering loop in __blk_queue_bounce to that the memcpy_to_bvec helper can be used to perform the data copies. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bounce.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-)

[dm-devel] [PATCH 12/15] block: use memcpy_from_bvec in bio_copy_kern_endio_read

2021-07-26 Thread Christoph Hellwig
Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-map.c b/block/blk-map.c index 3743158ddaeb..d1448aaad980 100644 --- a/block/b

[dm-devel] [PATCH 11/15] block: use memcpy_to_bvec in copy_to_high_bio_irq

2021-07-26 Thread Christoph Hellwig
Use memcpy_to_bvec instead of opencoding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bounce.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/block/bounce.c b/block/bounce.c index 94081e013c58..7e9e666c04dc 1006

[dm-devel] [PATCH 10/15] block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec

2021-07-26 Thread Christoph Hellwig
Use the proper helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bio.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/block/bio.c b/block/bio.c index 2e436bccb1e2..0c89fa2f7a85 1

[dm-devel] [PATCH 09/15] block: remove bvec_kmap_irq and bvec_kunmap_irq

2021-07-26 Thread Christoph Hellwig
These two helpers are entirely unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- include/linux/bio.h | 42 -- 1 file changed, 42 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 2203b686e1f0..7b5f65

[dm-devel] [PATCH 08/15] ps3disk: use memcpy_{from,to}_bvec

2021-07-26 Thread Christoph Hellwig
Use the bvec helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Tested-by: Geoff Levand --- drivers/block/ps3disk.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/block/ps3disk.c b/drivers/b

[dm-devel] [PATCH 07/15] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq

2021-07-26 Thread Christoph Hellwig
There is no need to disable interrupts in bio_copy_block, and the local only mappings helps to avoid any sort of problems with stray writes into the bio data. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- drivers/md/dm-writecache.c | 5 ++--- 1 fil

[dm-devel] [PATCH 06/15] rbd: use memzero_bvec

2021-07-26 Thread Christoph Hellwig
Use memzero_bvec instead of reimplementing it. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- drivers/block/rbd.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/block/rbd.c b/driv

[dm-devel] [PATCH 01/15] MIPS: don't include in

2021-07-26 Thread Christoph Hellwig
There is no need to include genhd.h from a random arch header, and not doing so prevents the possibility for nasty include loops. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- arch/mips/include/asm/mach-rc32434/rb.h

[dm-devel] [PATCH 05/15] block: use memzero_page in zero_fill_bio

2021-07-26 Thread Christoph Hellwig
Use memzero_bvec to zero each segment in the bio instead of manually mapping and zeroing the data. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- block/bio.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletion

[dm-devel] [PATCH 04/15] bvec: add memcpy_{from, to}_bvec and memzero_bvec helper

2021-07-26 Thread Christoph Hellwig
Add helpers to perform common memory operation on a bvec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h | 33 + 1 file changed, 33 insertions(+) diff --git a/inc

[dm-devel] [PATCH 03/15] bvec: add a bvec_kmap_local helper

2021-07-26 Thread Christoph Hellwig
Add a helper to call kmap_local_page on a bvec. There is no need for an unmap helper given that kunmap_local accept any address in the mapped page. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h

[dm-devel] switch the block layer to use kmap_local_page v3

2021-07-26 Thread Christoph Hellwig
Hi all, this series switches the core block layer code and all users of the existing bvec kmap helpers to use kmap_local_page. Drivers that currently use open coded kmap_atomic calls will converted in a follow on series. To do so a new kunmap variant is added that calls flush_kernel_dcache_page.

[dm-devel] [PATCH 02/15] bvec: fix the include guards for bvec.h

2021-07-26 Thread Christoph Hellwig
Fix the include guards to match the file naming. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --g

Re: [dm-devel] [PATCH 2/9] libmultipath: strbuf: simple api for growing string buffers

2021-07-26 Thread Benjamin Marzinski
On Thu, Jul 15, 2021 at 12:52:16PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Add an API for string buffers that grow in size as text is added. > This API will be useful in several places of the multipath-tools code > base. Add unit tests for these helpers, too. > This looks good. I

Re: [dm-devel] [PATCH 1/9] libmultipath: variable-size parameters in dm_get_map()

2021-07-26 Thread Benjamin Marzinski
On Thu, Jul 15, 2021 at 12:52:15PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > We've seen a crash of multipath in disassemble_map because of a params > string exceeding PARAMS_SIZE. While the crash could have been fixed by > a simple error check, I believe multipath should be able to w

Re: [dm-devel] [PATCH 7/7] dm: add documentation for IMA measurement support

2021-07-26 Thread Tushar Sugandhi
Hi Mimi, On 7/26/21 9:33 AM, Mimi Zohar wrote: Hi Tushar, On Sat, 2021-07-24 at 00:25 -0700, Tushar Sugandhi wrote: Hi Mimi, Missing from the document is a way of validating the template data. For example, in the original case of file measurements, the template data contains the file hash,

Re: [dm-devel] [PATCH 7/7] dm: add documentation for IMA measurement support

2021-07-26 Thread Mimi Zohar
Hi Tushar, On Sat, 2021-07-24 at 00:25 -0700, Tushar Sugandhi wrote: > Hi Mimi, > > > > Missing from the document is a way of validating the template data. > > For example, in the original case of file measurements, the template > > data contains the file hash, which can be recalculated or verif

Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount

2021-07-26 Thread Benjamin Marzinski
On Mon, Jul 26, 2021 at 08:22:49PM +0800, lixiaokeng wrote: > > >> After sdb mounted to /var, we can start multipathd service successfully. > > > > But when the binaries were compiled, if /var/run existed and was a > > symlink in your build environment, then RUN should equal "run", and > > multip

Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount

2021-07-26 Thread lixiaokeng
>> After sdb mounted to /var, we can start multipathd service successfully. > > But when the binaries were compiled, if /var/run existed and was a > symlink in your build environment, then RUN should equal "run", and > multipath should should be using /run instead of /var/run, right? > > This i

[dm-devel] [RFC PATCH v1 0/4] keys: introduce key_extract_material helper

2021-07-26 Thread Ahmad Fatoum
While keys of differing type have a common struct key definition, there is no common scheme to the payload and key material extraction differs. For kernel functionality that supports different key types, this means duplicated code for key material extraction and because key type is discriminated b

[dm-devel] [RFC PATCH v1 2/4] dm: crypt: use new key_extract_material helper

2021-07-26 Thread Ahmad Fatoum
There is a common function now to extract key material out of a few different key types, which includes all types currently supported by dm-crypt. Make use of it. Signed-off-by: Ahmad Fatoum --- To: David Howells To: Jarkko Sakkinen To: James Morris To: "Serge E. Hallyn" To: Alasdair Kergon

[dm-devel] [RFC PATCH v1 1/4] keys: introduce key_extract_material helper

2021-07-26 Thread Ahmad Fatoum
While keys of differing type have a common struct key definition, there is no common scheme to the payload and key material extraction differs. For kernel functionality that supports different key types, this means duplicated code for key material extraction and because key type is discriminated b

Re: [dm-devel] [PATCH] dm io: fix comments to align with on-stack plugging

2021-07-26 Thread Xianting Tian
Could I get the comments for the patch?  thanks 在 2021/7/17 下午11:54, Xianting Tian 写道: From: Xianting Tian Ther is no unplugging timer now, on-stack io plugging is used: struct blk_plug plug; blk_start_plug(&plug); submit_batch_of_io(); blk_finish_plug(&plug);

[dm-devel] [RFC PATCH v1 3/4] ubifs: auth: remove never hit key type error check

2021-07-26 Thread Ahmad Fatoum
key_request accepts a key type as its first argument. If it returns a valid pointer, it should always have this same requested key type. Indeed other request_key users surveyed such as dm-crypt, ecryptfs and fscrypt v1 also don't check the key type. Therefore drop the apparently unneeded check. S

[dm-devel] [RFC PATCH v1 4/4] ubifs: auth: consult encrypted and trusted keys if no logon key was found

2021-07-26 Thread Ahmad Fatoum
Currently, UBIFS auth_key can only be a logon key: This is a user key that's provided to the kernel in plaintext and that then remains within the kernel. Linux also supports trusted and encrypted keys, which have stronger guarantees: They are only exposed to userspace in encrypted form and, in the