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

2022-06-16 Thread Pankaj Raghav
On 2022-06-17 01:49, Damien Le Moal wrote: >>> Why do you need to change dm_set_zones_restrictions() at all ? >>> >> When the device mapper is created, the q->limits gets inherited from the >> underlying device. The chunk sectors of the target and the device will >> be the same but we want the

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

2022-06-16 Thread Guenter Roeck
On 6/15/22 13:02, 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, Greg KH wrote: On Fri, Jun 10, 2022 at 11:11:00AM

Re: [dm-devel] [PATCH 2/6] dm: open code blk_max_size_offset in max_io_len

2022-06-16 Thread Mike Snitzer
On Tue, Jun 14 2022 at 5:09P -0400, Christoph Hellwig wrote: > max_io_len always passes an explicitly non-zero chunk_sectors into > blk_max_size_offset. That means much of blk_max_size_offset is not > needed and can be open coded to simplify the code. > > Signed-off-by: Christoph Hellwig >

Re: [dm-devel] [PATCH 1/6] block: factor out a chunk_size_left helper

2022-06-16 Thread Mike Snitzer
On Tue, Jun 14 2022 at 5:09P -0400, Christoph Hellwig wrote: > Factor out a helper from blk_max_size_offset so that it can be reused > independently. > > Signed-off-by: Christoph Hellwig > --- > include/linux/blkdev.h | 19 +-- > 1 file changed, 13 insertions(+), 6

Re: [dm-devel] [PATCH] multipath-tools: add basic info on how to use multipath-tools with NVMe devices

2022-06-16 Thread Xose Vazquez Perez
On 4/1/22 12:20, Martin Wilck wrote: On Mon, 2022-03-28 at 19:57 +0200, Xose Vazquez Perez wrote: On 3/28/22 19:48, Martin Wilck wrote: On Mon, 2022-03-28 at 19:04 +0200, Xose Vazquez Perez wrote: Cc: Martin Wilck Cc: Benjamin Marzinski Cc: Christophe Varoqui Cc: DM-DEVEL ML

[dm-devel] [PATCH] dm: double-check REQ_NOWAIT flag while we hold the table lock

2022-06-16 Thread Mikulas Patocka
Starting with the commit 63a225c9fd20, device mapper has an optimization that it will take cheaper table lock (dm_get_live_table_fast instead of dm_get_live_table) if the bio has REQ_NOWAIT. The bios with REQ_NOWAIT must not block in the target request routine, if they did, we would be blocking

[dm-devel] [PATCH] dm-mirror: round up region bitmap size to BITS_PER_LONG

2022-06-16 Thread Mikulas Patocka
The code in dm-long rounds up bitset_size to 32 bits. It then uses find_next_zero_bit_le on the allocated region. find_next_zero_bit_le accesses the bitmap using unsigned long pointers. So, on 64-bit architectures, it may access 4 bytes beyond the allocated size. This bug was found by running the

[dm-devel] [PATCH] dm: fix accessing of freed memory in dm_put_live_table_bio

2022-06-16 Thread Mikulas Patocka
dm_put_live_table_bio is called from the end of dm_submit_bio. However, at this point, the bio may be already finished and the caller may have freed the bio. Consequently, dm_put_live_table_bio accesses the stale "bio" pointer. This patch fixes the bug by loading the bi_opf value and passing this

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

2022-06-16 Thread Luis Chamberlain
On Thu, Jun 16, 2022 at 12:09:35PM +0200, Pankaj Raghav wrote: > On 2022-06-15 22:28, Bart Van Assche wrote: > >> +    if (!is_power_of_2(zone->len) && zone->capacity < zone->len) { > >> +    pr_warn("%s: Invalid zone capacity for non power of 2 > >> zone size", > >> +   

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

2022-06-16 Thread Pankaj Raghav
Hi Damien, On 2022-06-15 13:49, Damien Le Moal wrote: > On 6/15/22 19:19, Pankaj Raghav wrote: >> 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

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

2022-06-16 Thread Pankaj Raghav
On 2022-06-15 13:01, Damien Le Moal wrote: > On 6/15/22 19:19, Pankaj Raghav wrote: >> 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

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

2022-06-16 Thread Pankaj Raghav
On 2022-06-15 21:54, Randy Dunlap wrote: > 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

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

2022-06-16 Thread Pankaj Raghav
On 2022-06-15 22:28, Bart Van Assche wrote: isk_name, zone->len); >> +    if (zone->len == 0) { >> +    pr_warn("%s: Invalid zone size", disk->disk_name); >> +    return -ENODEV; >> +    } >> + >> +    /* >> + * Don't allow zoned device with non power_of_2 zone

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

2022-06-16 Thread Pankaj Raghav
drivers/md/dm-table.c >> +++ b/drivers/md/dm-table.c >> @@ -251,7 +251,7 @@ static int device_area_is_invalid(struct dm_target *ti, >> struct dm_dev *dev, >> if (bdev_is_zoned(bdev)) { >> unsigned int zone_sectors = bdev_zone_sectors(bdev); >> >> -if (start &

Re: [dm-devel] [PATCH 5/6] block: fold blk_max_size_offset into get_max_io_size

2022-06-16 Thread Pankaj Raghav
On Tue, Jun 14, 2022 at 11:09:33AM +0200, Christoph Hellwig wrote: > Now that blk_max_size_offset has a single caller left, fold it into that > and clean up the naming convention for the local variables there. > > Signed-off-by: Christoph Hellwig > --- > block/blk-merge.c | 9 +++-- >

Re: [dm-devel] [PATCH 1/6] block: factor out a chunk_size_left helper

2022-06-16 Thread Pankaj Raghav
On Tue, Jun 14, 2022 at 11:09:29AM +0200, Christoph Hellwig wrote: > Factor out a helper from blk_max_size_offset so that it can be reused > independently. > > Signed-off-by: Christoph Hellwig > --- > include/linux/blkdev.h | 19 +-- > 1 file changed, 13 insertions(+), 6