[dm-devel] [PATCH v7 00/13] support non power of 2 zoned device

2022-06-15 Thread Pankaj Raghav
onstraint from nvme zns. Patch 5-6 removes the po2 contraint in null blk Patch 7 adds npo2 support to zonefs Patches 8-13 adds support for npo2 zoned devices in the DM layer and adds a new target dm-zoned-npo2-target The patch series is based on linux-next tag: next-20220615 Testing: The new t

[dm-devel] [PATCH v7 01/13] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-06-15 Thread Pankaj Raghav
Adapt blkdev_nr_zones and blk_queue_zone_no function so that it can also work for non-power-of-2 zone sizes. As the existing deployments of zoned devices had power-of-2 assumption, power-of-2 optimized calculation is kept for those devices. There are no direct hot paths modified and the changes j

[dm-devel] [PATCH v7 02/13] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-06-15 Thread Pankaj Raghav
Checking if a given sector is aligned to a zone is a common operation that is performed for zoned devices. Add blk_queue_is_zone_start helper to check for this instead of opencoding it everywhere. Convert the calculations on zone size to be generic instead of relying on power_of_2 based logic in t

[dm-devel] [PATCH v7 04/13] nvmet: Allow ZNS target to support non-power_of_2 zone sizes

2022-06-15 Thread Pankaj Raghav
A generic bdev_zone_no helper is added to calculate zone number for a given sector in a block device. This helper internally uses blk_queue_zone_no to find the zone number. Use the helper bdev_zone_no() to calculate nr of zones. This let's us make modifications to the math if needed in one place a

[dm-devel] [PATCH v7 03/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

2022-06-15 Thread Pankaj Raghav
Remove the condition which disallows non-power_of_2 zone size ZNS drive to be updated and use generic method to calculate number of zones instead of relying on log and shift based calculation on zone size. The power_of_2 calculation has been replaced directly with generic calculation without speci

[dm-devel] [PATCH v7 05/13] null_blk: allow non power of 2 zoned devices

2022-06-15 Thread Pankaj Raghav
Convert the power of 2 based calculation with zone size to be generic in null_zone_no with optimization for power of 2 based zone sizes. The nr_zones calculation in null_init_zoned_dev has been replaced with a division without special handling for power of 2 based zone sizes as this function is ca

[dm-devel] [PATCH v7 07/13] zonefs: allow non power of 2 zoned devices

2022-06-15 Thread Pankaj Raghav
The zone size shift variable is useful only if the zone sizes are known to be power of 2. Remove that variable and use generic helpers from block layer to calculate zone index in zonefs. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/zonefs/super.c | 6 ++ fs/zonefs/zone

[dm-devel] [PATCH v7 06/13] null_blk: use zone_size_sects_shift for power of 2 zoned devices

2022-06-15 Thread Pankaj Raghav
Instead of doing is_power_of_2 and ilog2 operation for every IO, cache the zone_size_sects_shift variable and use it for power of 2 zoned devices. This variable will be set to zero for non power of 2 zoned devices. Suggested-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Luis Cham

[dm-devel] [PATCH v7 08/13] dm-zoned: ensure only power of 2 zone sizes are allowed

2022-06-15 Thread Pankaj Raghav
From: Luis Chamberlain Today dm-zoned relies on the assumption that you have a zone size with a power of 2. Even though the block layer today enforces this requirement, these devices do exist and so provide a stop-gap measure to ensure these devices cannot be used by mistake Reviewed-by: Hannes

[dm-devel] [PATCH v7 09/13] dm-zone: use generic helpers to calculate offset from zone start

2022-06-15 Thread Pankaj Raghav
Use the blk_queue_offset_from_zone_start() helper function to calculate the offset from zone start instead of using power of 2 based calculation. Signed-off-by: Pankaj Raghav Reviewed-by: Luis Chamberlain --- drivers/md/dm-zone.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) dif

[dm-devel] [PATCH v7 11/13] dm-table: allow non po2 zoned devices

2022-06-15 Thread Pankaj Raghav
As the block layer now supports non po2 zoned devices, allow dm to support non po2 zoned device. Signed-off-by: Pankaj Raghav --- drivers/md/dm-table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index b553cdb6d..ec77e78

[dm-devel] [PATCH v7 10/13] dm-table: use bdev_is_zone_start helper in device_area_is_invalid()

2022-06-15 Thread Pankaj Raghav
Use bdev_is_zone_start() helper that uses generic calculation to check for zone alignment instead of using po2 based alignment check. Signed-off-by: Pankaj Raghav Reviewed-by: Luis Chamberlain --- drivers/md/dm-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driv

[dm-devel] [PATCH v7 12/13] dm: call dm_zone_endio after the target endio callback for zoned devices

2022-06-15 Thread Pankaj Raghav
dm_zone_endio() updates the bi_sector of orig bio for zoned devices that uses either native append or append emulation and it is called before the endio of the target. But target endio can still update the clone bio after dm_zone_endio is called, thereby, the orig bio does not contain the updated i

[dm-devel] [PATCH v7 13/13] dm: add non power of 2 zoned target

2022-06-15 Thread Pankaj Raghav
Only power of 2(po2) zoned devices were supported in linux but now non power of 2(npo2) zoned device support has been added to the block layer. Filesystems such as F2FS and btrfs have support for zoned devices with po2 zone size assumption. Before adding native support for npo2 zoned devices, it w

Re: [dm-devel] [PATCH v7 13/13] dm: add non power of 2 zoned target

2022-06-15 Thread kernel test robot
Hi Pankaj, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on axboe-block/for-next] [also build test WARNING on device-mapper-dm/for-next linus/master v5.19-rc2 next-20220615] [cannot apply to song-md/md-next] [If your patch is applied to the wrong git tree

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Guenter Roeck
On Mon, Jun 13, 2022 at 11:13:21AM +0200, Greg KH wrote: > On Fri, Jun 10, 2022 at 11:11:00AM -0400, Mike Snitzer wrote: > > On Fri, Jun 10 2022 at 1:15P -0400, > > Greg KH wrote: > > > > > On Fri, Jun 10, 2022 at 04:22:00AM +, Oleksandr Tymoshenko wrote: > > > > I believe this commit introd

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Mike Snitzer
On Wed, Jun 15 2022 at 10:36P -0400, Guenter Roeck wrote: > On Mon, Jun 13, 2022 at 11:13:21AM +0200, Greg KH wrote: > > On Fri, Jun 10, 2022 at 11:11:00AM -0400, Mike Snitzer wrote: > > > On Fri, Jun 10 2022 at 1:15P -0400, > > > Greg KH wrote: > > > > > > > On Fri, Jun 10, 2022 at 04:22:00AM

Re: [dm-devel] dm: fix possible race in dm_start_io_acct

2022-06-15 Thread Mike Snitzer
On Tue, Jun 14 2022 at 12:10P -0400, Benjamin Marzinski wrote: > After commit 82f6cdcc3676c ("dm: switch dm_io booleans over to proper > flags") dm_start_io_acct stopped atomically checking and setting > was_accounted, which turned into the DM_IO_ACCOUNTED flag. This opened > the possibility for

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Guenter Roeck
On 6/15/22 08:29, Mike Snitzer wrote: On Wed, Jun 15 2022 at 10:36P -0400, Guenter Roeck wrote: On Mon, Jun 13, 2022 at 11:13:21AM +0200, Greg KH wrote: On Fri, Jun 10, 2022 at 11:11:00AM -0400, Mike Snitzer wrote: On Fri, Jun 10 2022 at 1:15P -0400, Greg KH wrote: On Fri, Jun 10, 2022 a

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Mike Snitzer
On Wed, Jun 15 2022 at 1:50P -0400, Guenter Roeck wrote: > On 6/15/22 08:29, Mike Snitzer wrote: > > On Wed, Jun 15 2022 at 10:36P -0400, > > Guenter Roeck wrote: > > > > > On Mon, Jun 13, 2022 at 11:13:21AM +0200, Greg KH wrote: > > > > On Fri, Jun 10, 2022 at 11:11:00AM -0400, Mike Snitzer w

Re: [dm-devel] [PATCH v7 01/13] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-06-15 Thread Bart Van Assche
On 6/15/22 03:19, Pankaj Raghav wrote: Adapt blkdev_nr_zones and blk_queue_zone_no function so that it can also work for non-power-of-2 zone sizes. As the existing deployments of zoned devices had power-of-2 assumption, power-of-2 optimized calculation is kept for those devices. There are no di

Re: [dm-devel] [PATCH v7 02/13] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-06-15 Thread Bart Van Assche
On 6/15/22 03:19, Pankaj Raghav wrote: @@ -489,14 +489,27 @@ static int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx, * smaller last zone. */ if (zone->start == 0) { - if (zone->len == 0 || !is_power_of_2(zone->len)) { -

Re: [dm-devel] [PATCH v7 13/13] dm: add non power of 2 zoned target

2022-06-15 Thread Randy Dunlap
Hi-- On 6/15/22 03:19, Pankaj Raghav wrote: > --- > drivers/md/Kconfig| 9 + > drivers/md/Makefile | 2 + > drivers/md/dm-zone.c | 9 + > drivers/md/dm-zoned-npo2-target.c | 268 ++ > 4 files changed, 288 insertions(+)

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Guenter Roeck
On Wed, Jun 15, 2022 at 04:02:36PM -0400, Mike Snitzer wrote: [ ... ] > > OK, well this is pretty easy to fix in general. If there are slight > differences across older trees they are easily resolved. Fact that > stable@ couldn't cope with backporting 9c37de297f65 is.. what it is. > > But this

Re: [dm-devel] [RFC PATCH v8 02/17] ipe: add policy parser

2022-06-15 Thread Paul Moore
On Wed, Jun 8, 2022 at 3:03 PM Deven Bowers wrote: > > IPE's interpretation of the what the user trusts is accomplished through > its policy. IPE's design is to not provide support for a single trust > provider, but to support multiple providers to enable the end-user to > choose the best one to s

Re: [dm-devel] [RFC PATCH v8 07/17] ipe: add auditing support

2022-06-15 Thread Paul Moore
On Wed, Jun 8, 2022 at 3:01 PM Deven Bowers wrote: > > Users of IPE require a way to identify when and why an operation fails, > allowing them to both respond to violations of policy and be notified > of potentially malicious actions on their systens with respect to IPE > itself. > > The new 1420

Re: [dm-devel] [PATCH 5.4 26/34] dm verity: set DM_TARGET_IMMUTABLE feature flag

2022-06-15 Thread Guenter Roeck
On Wed, Jun 15, 2022 at 04:02:36PM -0400, Mike Snitzer wrote: > On Wed, Jun 15 2022 at 1:50P -0400, > Guenter Roeck wrote: > > > On 6/15/22 08:29, Mike Snitzer wrote: > > > On Wed, Jun 15 2022 at 10:36P -0400, > > > Guenter Roeck wrote: > > > > > > > On Mon, Jun 13, 2022 at 11:13:21AM +0200, G