Re: [dm-devel] [PATCH v2 2/3] LoadPin: Enable loading from trusted dm-verity devices

2022-04-27 Thread kernel test robot
Hi Matthias, Thank you for the patch! Yet something to improve: [auto build test ERROR on device-mapper-dm/for-next] [also build test ERROR on song-md/md-next kees/for-next/pstore v5.18-rc4 next-20220427] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [dm-devel] [PATCH 03/16] block: add bdev_zone_no helper

2022-04-27 Thread Bart Van Assche
On 4/27/22 09:02, Pankaj Raghav wrote: +static inline unsigned int bdev_zone_no(struct block_device *bdev, sector_t sec) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (q) + return blk_queue_zone_no(q, sec); + return 0; +} This patch series has been

Re: [dm-devel] [PATCH 02/16] block: add blk_queue_zone_aligned and bdev_zone_aligned helper

2022-04-27 Thread Bart Van Assche
On 4/27/22 09:02, Pankaj Raghav wrote: +static inline bool bdev_zone_aligned(struct block_device *bdev, sector_t sec) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (q) + return blk_queue_zone_aligned(q, sec); + return false; +} Which patch uses this

[dm-devel] [PATCH] dm: dm-mpath: Provide high-resolution timer to HST with bio-mpath

2022-04-27 Thread Gabriel Krisman Bertazi
The precision loss of reading IO start_time with jiffies_to_nsecs instead of using a high resolution timer degrades HST path prediction for BIO-based mpath on high load workloads. Below, I show the utilization percentage of a 10 disk multipath with asymmetrical disk access cost, while being exerci

Re: [dm-devel] [PATCH v2 2/3] LoadPin: Enable loading from trusted dm-verity devices

2022-04-27 Thread kernel test robot
Hi Matthias, Thank you for the patch! Yet something to improve: [auto build test ERROR on device-mapper-dm/for-next] [also build test ERROR on song-md/md-next kees/for-next/pstore v5.18-rc4 next-20220427] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

[dm-devel] [PATCH v3] hex2bin: fix access beyond string end

2022-04-27 Thread Mikulas Patocka
If we pass too short string to "hex2bin" (and the string size without the terminating NUL character is even), "hex2bin" reads one byte after the terminating NUL character. This patch fixes it. Note that hex_to_bin returns -1 on error and hex2bin return -EINVAL on error - so we can't just return th

Re: [dm-devel] [PATCH v2] hex2bin: fix access beyond string end

2022-04-27 Thread Mikulas Patocka
On Wed, 27 Apr 2022, Andy Shevchenko wrote: > On Tue, Apr 26, 2022 at 5:29 PM Mikulas Patocka wrote: > > On Tue, 26 Apr 2022, Andy Shevchenko wrote: > > > On Tue, Apr 26, 2022 at 08:07:44AM -0400, Mikulas Patocka wrote: > > > > On Tue, 26 Apr 2022, Andy Shevchenko wrote: > > > > > On Sun, Apr

[dm-devel] [PATCH v4 06/10] nvmet: add copy command support for bdev and file ns

2022-04-27 Thread Nitesh Shetty
From: Arnav Dawn Add support for handling target command on target. For bdev-ns we call into blkdev_issue_copy, which the block layer completes by a offloaded copy request to backend bdev or by emulating the request. For file-ns we call vfs_copy_file_range to service our request. Currently targ

[dm-devel] [PATCH v4 07/10] dm: Add support for copy offload.

2022-04-27 Thread Nitesh Shetty
Before enabling copy for dm target, check if underlying devices and dm target support copy. Avoid split happening inside dm target. Fail early if the request needs split, currently splitting copy request is not supported. Signed-off-by: Nitesh Shetty --- drivers/md/dm-table.c | 45 ++

Re: [dm-devel] [PATCH 06/11] raid5: don't set the discard_alignment queue limit

2022-04-27 Thread Song Liu
On Sun, Apr 17, 2022 at 9:53 PM Christoph Hellwig wrote: > > The discard_alignment queue limit is named a bit misleading means the > offset into the block device at which the discard granularity starts. > Setting it to the discard granularity as done by raid5 is mostly > harmless but also useless.

[dm-devel] [PATCH v4 02/10] block: Add copy offload support infrastructure

2022-04-27 Thread Nitesh Shetty
Introduce blkdev_issue_copy which supports source and destination bdevs, and an array of (source, destination and copy length) tuples. Introduce REQ_COPY copy offload operation flag. Create a read-write bio pair with a token as payload and submitted to the device in order. Read request populates to

[dm-devel] [PATCH v2 3/3] dm: verity-loadpin: Use CONFIG_SECURITY_LOADPIN_VERITY for conditional compilation

2022-04-27 Thread Matthias Kaehlcke
The verity glue for LoadPin is only needed when CONFIG_SECURITY_LOADPIN_VERITY is set, use this option for conditional compilation instead of the combo of CONFIG_DM_VERITY and CONFIG_SECURITY_LOADPIN. Signed-off-by: Matthias Kaehlcke --- Changes in v2: - none drivers/md/Makefile

[dm-devel] [PATCH v2 0/3] LoadPin: Enable loading from trusted dm-verity devices

2022-04-27 Thread Matthias Kaehlcke
As of now LoadPin restricts loading of kernel files to a single pinned filesystem, typically the rootfs. This works for many systems, however it can result in a bloated rootfs (and OTA updates) on platforms where multiple boards with different hardware configurations use the same rootfs image. Espe

[dm-devel] [PATCH v4 04/10] block: add emulation for copy

2022-04-27 Thread Nitesh Shetty
For the devices which does not support copy, copy emulation is added. Copy-emulation is implemented by reading from source ranges into memory and writing to the corresponding destination synchronously. Signed-off-by: Nitesh Shetty Signed-off-by: Vincent Fu Signed-off-by: Arnav Dawn --- block/b

Re: [dm-devel] [PATCH] hex2bin: make the function hex_to_bin constant-time

2022-04-27 Thread David Laight
From: Linus Torvalds > Sent: 24 April 2022 22:42 > > On Sun, Apr 24, 2022 at 2:37 PM Linus Torvalds > wrote: > > > > Finally, for the same reason - please don't use ">> 8". Because I do > > not believe that bit 8 is well-defined in your arithmetic. The *sign* > > bit will be, but I'm not convinc

[dm-devel] [PATCH v4 00/10] Add Copy offload support

2022-04-27 Thread Nitesh Shetty
The patch series covers the points discussed in November 2021 virtual call [LSF/MM/BFP TOPIC] Storage: Copy Offload[0]. We have covered the Initial agreed requirements in this patchset. Patchset borrows Mikulas's token based approach for 2 bdev implementation. Overall series supports – 1. Driver

Re: [dm-devel] [dm-5.19 PATCH 21/21] dm: improve abnormal bio processing

2022-04-27 Thread Shinichiro Kawasaki
On Apr 22, 2022 / 09:26, Mike Snitzer wrote: > On Fri, Apr 22 2022 at 9:13P -0400, > Mike Snitzer wrote: [...] > > Thanks for your report, I'll sort it out but your patch doesn't seem right. > > > > init_clone_info() will reset ci.is_abnormal_io so the bio won't be > > processed properly. Rig

[dm-devel] [PATCH v4 09/10] dm kcopyd: use copy offload support

2022-04-27 Thread Nitesh Shetty
From: SelvaKumar S Introduce copy_jobs to use copy-offload, if supported by underlying devices otherwise fall back to existing method. run_copy_jobs() calls block layer copy offload API, if both source and destination request queue are same and support copy offload. On successful completion, des

[dm-devel] [PATCH v4 03/10] block: Introduce a new ioctl for copy

2022-04-27 Thread Nitesh Shetty
Add new BLKCOPY ioctl that offloads copying of one or more sources ranges to one or more destination in a device. COPY ioctl accepts a 'copy_range' structure that contains no of range, a reserved field , followed by an array of ranges. Each source range is represented by 'range_entry' that contains

Re: [dm-devel] [PATCH v2] hex2bin: fix access beyond string end

2022-04-27 Thread Andy Shevchenko
On Tue, Apr 26, 2022 at 08:07:44AM -0400, Mikulas Patocka wrote: > On Tue, 26 Apr 2022, Andy Shevchenko wrote: > > On Sun, Apr 24, 2022 at 10:48 PM Mikulas Patocka > > wrote: ... > > You need to provide a Fixes tag. > > OK. Here I resend it with the "Fixes" tag. Still shadows error codes. >

[dm-devel] [PATCH v4 01/10] block: Introduce queue limits for copy-offload support

2022-04-27 Thread Nitesh Shetty
Add device limits as sysfs entries, - copy_offload (RW) - copy_max_bytes (RW) - copy_max_hw_bytes (RO) - copy_max_range_bytes (RW) - copy_max_range_hw_bytes (RO) - copy_max_nr_ranges (RW) - copy_max_nr_ranges_hw (RO) Above limits help to spli

Re: [dm-devel] [PATCH v2] hex2bin: fix access beyond string end

2022-04-27 Thread Andy Shevchenko
On Tue, Apr 26, 2022 at 08:07:44AM -0400, Mikulas Patocka wrote: > On Tue, 26 Apr 2022, Andy Shevchenko wrote: > > On Sun, Apr 24, 2022 at 10:48 PM Mikulas Patocka > > wrote: > > > > > > If we pass too short string to "hex2bin" (and the string size without the > > > terminating NUL character is e

[dm-devel] [PATCH v4 10/10] fs: add support for copy file range in zonefs

2022-04-27 Thread Nitesh Shetty
From: Arnav Dawn copy_file_range is implemented using copy offload, copy offloading to device is always enabled. To disable copy offloading mount with "no_copy_offload" mount option. At present copy offload is only used, if the source and destination files are on same block device, otherwise copy

Re: [dm-devel] [PATCH] hex2bin: make the function hex_to_bin constant-time

2022-04-27 Thread David Laight
From: Mikulas Patocka > Sent: 25 April 2022 12:04 > > On Mon, 25 Apr 2022, David Laight wrote: > > > From: Linus Torvalds > > > Sent: 24 April 2022 22:42 > > > > > > On Sun, Apr 24, 2022 at 2:37 PM Linus Torvalds > > > wrote: > > > > > > > > Finally, for the same reason - please don't use ">> 8"

[dm-devel] [PATCH v4 08/10] dm: Enable copy offload for dm-linear target

2022-04-27 Thread Nitesh Shetty
Setting copy_offload_supported flag to enable offload. Signed-off-by: Nitesh Shetty --- drivers/md/dm-linear.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 0a6abbbe3745..3b8de6d5ca9c 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md

[dm-devel] [PATCH v2 2/3] LoadPin: Enable loading from trusted dm-verity devices

2022-04-27 Thread Matthias Kaehlcke
Extend LoadPin to allow loading of kernel files from trusted dm-verity [1] devices. This change adds the concept of trusted verity devices to LoadPin. Userspace can use the new systl file 'loadpin/trusted_verity_root_digests_path' to provide LoadPin with the path of a file with a list of root dige

[dm-devel] [PATCH v2 1/3] dm: Add verity helpers for LoadPin

2022-04-27 Thread Matthias Kaehlcke
LoadPin limits loading of kernel modules, firmware and certain other files to a 'pinned' file system (typically a read-only rootfs). To provide more flexibility LoadPin is being extended to also allow loading these files from trusted dm-verity devices. For that purpose LoadPin can be provided with

Re: [dm-devel] [PATCH] hex2bin: fix access beyond string end

2022-04-27 Thread Andy Shevchenko
On Sun, Apr 24, 2022 at 10:48 PM Mikulas Patocka wrote: > > If we pass too short string to "hex2bin" (and the string size without the > terminating NUL character is even), "hex2bin" reads one byte after the > terminating NUL character. This patch fixes it. > > Signed-off-by: Mikulas Patocka > Cc:

[dm-devel] [PATCH v4 05/10] nvme: add copy offload support

2022-04-27 Thread Nitesh Shetty
For device supporting native copy, nvme driver receives read and write request with BLK_COPY op flags. For read request the nvme driver populates the payload with source information. For write request the driver converts it to nvme copy command using the source information in the payload and submit

Re: [dm-devel] [PATCH v4 03/10] block: Introduce a new ioctl for copy

2022-04-27 Thread Hannes Reinecke
On 4/26/22 12:12, Nitesh Shetty wrote: Add new BLKCOPY ioctl that offloads copying of one or more sources ranges to one or more destination in a device. COPY ioctl accepts a 'copy_range' structure that contains no of range, a reserved field , followed by an array of ranges. Each source range is r

Re: [dm-devel] [PATCH v4 01/10] block: Introduce queue limits for copy-offload support

2022-04-27 Thread Hannes Reinecke
On 4/26/22 12:12, Nitesh Shetty wrote: Add device limits as sysfs entries, - copy_offload (RW) - copy_max_bytes (RW) - copy_max_hw_bytes (RO) - copy_max_range_bytes (RW) - copy_max_range_hw_bytes (RO) - copy_max_nr_ranges (RW) - copy_

Re: [dm-devel] [PATCH v4 02/10] block: Add copy offload support infrastructure

2022-04-27 Thread Hannes Reinecke
On 4/26/22 12:12, Nitesh Shetty wrote: Introduce blkdev_issue_copy which supports source and destination bdevs, and an array of (source, destination and copy length) tuples. Introduce REQ_COPY copy offload operation flag. Create a read-write bio pair with a token as payload and submitted to the d