Re: [dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-24 Thread Damien Le Moal
On 2021/05/25 15:15, Chaitanya Kulkarni wrote: > On 5/24/21 7:25 PM, Damien Le Moal wrote: >> SCSI, ZNS and null_blk zoned devices support resetting all zones using >> a single command (REQ_OP_ZONE_RESET_ALL), as indicated using the device >> request queue flag QUEUE_FLAG_ZONE_RESETALL. This flag i

Re: [dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-24 Thread Chaitanya Kulkarni
On 5/24/21 7:25 PM, Damien Le Moal wrote: > SCSI, ZNS and null_blk zoned devices support resetting all zones using > a single command (REQ_OP_ZONE_RESET_ALL), as indicated using the device > request queue flag QUEUE_FLAG_ZONE_RESETALL. This flag is not set for > device mapper targets creating zoned

Re: [dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-24 Thread Chaitanya Kulkarni
On 5/24/21 7:25 PM, Damien Le Moal wrote: > + sector_t sector = 0; nit:- I think there is an extra space here after = . -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH v4 03/11] block: introduce BIO_ZONE_WRITE_LOCKED bio flag

2021-05-24 Thread Damien Le Moal
Introduce the BIO flag BIO_ZONE_WRITE_LOCKED to indicate that a BIO owns the write lock of the zone it is targeting. This is the counterpart of the struct request flag RQF_ZONE_WRITE_LOCKED. This new BIO flag is reserved for now for zone write locking control for device mapper targets exposing a z

[dm-devel] [PATCH v4 05/11] dm: cleanup device_area_is_invalid()

2021-05-24 Thread Damien Le Moal
In device_area_is_invalid(), use bdev_is_zoned() instead of open coding the test on the zoned model returned by bdev_zoned_model(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm-table.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[dm-devel] [PATCH v4 07/11] dm: Introduce dm_report_zones()

2021-05-24 Thread Damien Le Moal
To simplify the implementation of the report_zones operation of a zoned target, introduce the function dm_report_zones() to set a target mapping start sector in struct dm_report_zones_args and call blkdev_report_zones(). This new function is exported and the report zones callback function dm_report

[dm-devel] [PATCH v4 09/11] dm: rearrange core declarations

2021-05-24 Thread Damien Le Moal
Move the definitions of struct dm_target_io, struct dm_io and of the bits of the flags field of struct mapped_device from dm.c to dm-core.h to make them usable from dm-zone.c. For the same reason, declare dec_pending() in dm-core.h after renaming it to dm_io_dec_pending(). And for symmetry of the f

[dm-devel] [PATCH v4 08/11] dm: Forbid requeue of writes to zones

2021-05-24 Thread Damien Le Moal
A target map method requesting the requeue of a bio with DM_MAPIO_REQUEUE or completing it with DM_ENDIO_REQUEUE can cause unaligned write errors if the bio is a write operation targeting a sequential zone. If a zoned target request such a requeue, warn about it and kill the IO. The function dm_is

[dm-devel] [PATCH v4 10/11] dm: introduce zone append emulation

2021-05-24 Thread Damien Le Moal
For zoned targets that cannot support zone append operations, implement an emulation using regular write operations. If the original BIO submitted by the user is a zone append operation, change its clone into a regular write operation directed at the target zone write pointer position. To do so, a

[dm-devel] [PATCH v4 11/11] dm crypt: Fix zoned block device support

2021-05-24 Thread Damien Le Moal
Zone append BIOs (REQ_OP_ZONE_APPEND) always specify the start sector of the zone to be written instead of the actual sector location to write. The write location is determined by the device and returned to the host upon completion of the operation. This interface, while simple and efficient for wr

[dm-devel] [PATCH v4 04/11] dm: Fix dm_accept_partial_bio()

2021-05-24 Thread Damien Le Moal
Fix dm_accept_partial_bio() to actually check that zone management commands are not passed as explained in the function documentation comment. Also, since a zone append operation cannot be split, add REQ_OP_ZONE_APPEND as a forbidden command. White lines are added around the group of BUG_ON() call

[dm-devel] [PATCH v4 06/11] dm: move zone related code to dm-zone.c

2021-05-24 Thread Damien Le Moal
Move core and table code used for zoned targets and conditionally defined with #ifdef CONFIG_BLK_DEV_ZONED to the new file dm-zone.c. This file is conditionally compiled depending on CONFIG_BLK_DEV_ZONED. The small helper dm_set_zones_restrictions() is introduced to initialize a mapped device reque

[dm-devel] [PATCH v4 02/11] block: introduce bio zone helpers

2021-05-24 Thread Damien Le Moal
Introduce the helper functions bio_zone_no() and bio_zone_is_seq(). Both are the BIO counterparts of the request helpers blk_rq_zone_no() and blk_rq_zone_is_seq(), respectively returning the number of the target zone of a bio and true if the BIO target zone is sequential. Signed-off-by: Damien Le

[dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-24 Thread Damien Le Moal
SCSI, ZNS and null_blk zoned devices support resetting all zones using a single command (REQ_OP_ZONE_RESET_ALL), as indicated using the device request queue flag QUEUE_FLAG_ZONE_RESETALL. This flag is not set for device mapper targets creating zoned devices. In this case, a user request for resetti

[dm-devel] [PATCH v4 00/11] dm: Improve zoned block device support

2021-05-24 Thread Damien Le Moal
This series improve device mapper support for zoned block devices and of targets exposing a zoned device. The first patch improve support for user requests to reset all zones of the target device. With the fix, such operation behave similarly to physical block devices implementation based on the s

Re: [dm-devel] [PATCH] multipath-tools: Remove trailing/leading whitespaces

2021-05-24 Thread Benjamin Marzinski
On Sat, May 22, 2021 at 09:17:36PM +0200, Xose Vazquez Perez wrote: > Cc: Martin Wilck > Cc: Benjamin Marzinski > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez If no one objects, I'm fine with this going in. But if anyone has objections to a whitespace only patc

Re: [dm-devel] [PATCH] libmultipath: fix build without LIBDM_API_DEFERRED

2021-05-24 Thread Benjamin Marzinski
On Thu, May 20, 2021 at 09:52:08PM +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Build fails on distributions that don't support DM_DEFERRED_REMOVE > (libdevmapper < 1.02.89). Fix it. > > Resolves: https://github.com/opensvc/multipath-tools/issues/7 > Tested-by: Paul Menzel Reviewed-by

Re: [dm-devel] [PATCH 14/26] md: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-24 Thread Hannes Reinecke
On 5/24/21 9:26 AM, Christoph Hellwig wrote: On Sun, May 23, 2021 at 10:12:49AM +0200, Hannes Reinecke wrote: + blk_set_stacking_limits(&mddev->queue->limits); blk_queue_write_cache(mddev->queue, true, true); /* Allow extended partitions. This makes the * 'mdp' de

Re: [dm-devel] [PATCH 18/26] nvme-multipath: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-24 Thread Christoph Hellwig
On Sun, May 23, 2021 at 10:20:27AM +0200, Hannes Reinecke wrote: > What about the check for GENHD_FL_UP a bit further up in line 766? > Can this still happen with the new allocation scheme, ie is there still a > difference in lifetime between ->disk and ->disk->queue? Yes, nvme_free_ns_head can s

Re: [dm-devel] [PATCH 14/26] md: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-24 Thread Christoph Hellwig
On Sun, May 23, 2021 at 10:12:49AM +0200, Hannes Reinecke wrote: >> +blk_set_stacking_limits(&mddev->queue->limits); >> blk_queue_write_cache(mddev->queue, true, true); >> /* Allow extended partitions. This makes the >> * 'mdp' device redundant, but we can't really >> > Wouldn'

Re: [dm-devel] [PATCH 13/26] dm: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-24 Thread Christoph Hellwig
On Sun, May 23, 2021 at 10:10:34AM +0200, Hannes Reinecke wrote: > Can't these conditionals be merged into a single 'if (md->disk)'? > Eg like: > > if (md->disk) { > spin_lock(&_minor_lock); > md->disk->private_data = NULL; > spin_unlock(&_minor_lock)

Re: [dm-devel] [PATCH 06/26] brd: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-24 Thread Christoph Hellwig
On Sun, May 23, 2021 at 09:58:48AM +0200, Hannes Reinecke wrote: >> +/* >> + * This is so fdisk will align partitions on 4k, because of >> + * direct_access API needing 4k alignment, returning a PFN >> + * (This is only a problem on very small devices <= 4M, >> + * otherwise fd

Re: [dm-devel] [PATCH 05/26] block: add blk_alloc_disk and blk_cleanup_disk APIs

2021-05-24 Thread Christoph Hellwig
On Fri, May 21, 2021 at 05:44:07PM +, Luis Chamberlain wrote: > Its not obvious to me why using this new API requires you then to > set minors explicitly to 1, and yet here underneath we see the minors > argument passed is 0. > > Nor is it clear from the documentation. Basically for all new d

Re: [dm-devel] [PATCH 01/26] block: refactor device number setup in __device_add_disk

2021-05-24 Thread Christoph Hellwig
On Sun, May 23, 2021 at 09:46:01AM +0200, Hannes Reinecke wrote: > ... and also fixes an issue with GENHD_FL_UP remained set in an error path > in __device_add_disk(). Well, the error path in __device_add_disk is a complete disaster right now, but Luis is looking into it fortunately. -- dm-devel

Re: [dm-devel] [PATCH 01/26] block: refactor device number setup in __device_add_disk

2021-05-24 Thread Christoph Hellwig
On Fri, May 21, 2021 at 05:16:46PM +, Luis Chamberlain wrote: > > - /* in consecutive minor range? */ > > - if (bdev->bd_partno < disk->minors) { > > - *devt = MKDEV(disk->major, disk->first_minor + bdev->bd_partno); > > - return 0; > > - } > > - > > It is not obvious