[PATCH] dm-mpath: Don't probe paths that are getting initialized

2025-04-30 Thread Benjamin Marzinski
__switch_pg() sets m->current_pg before initializing the pathgroup. If probe_active_paths() is called and pathgroup has not been fully initialized, IO to the paths may fail, even though they will be usable when the pathgroup has finished initializing. Instead, skip sending IO in this situation and

[PATCH 16/19] xfs: simplify xfs_rw_bdev

2025-04-30 Thread Christoph Hellwig
Delegate to bdev_rw_virt when operating on non-vmalloc memory and use bio_add_vmalloc_chunk to insulate xfs from the details of adding vmalloc memory to a bio. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bio_io.c | 30 ---

[PATCH 08/19] bcache: use bio_add_virt_nofail

2025-04-30 Thread Christoph Hellwig
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the bio_add_virt_nofail helper implementing it. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- drivers/md/bcache/super.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH 19/19] hfsplus: use bdev_rw_virt in hfsplus_submit_bio

2025-04-30 Thread Christoph Hellwig
Replace the code building a bio from a kernel direct map address and submitting it synchronously with the bdev_rw_virt helper. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- fs/hfsplus/wrapper.c | 46 +---

[PATCH 13/19] dm-bufio: use bio_add_virt_nofail

2025-04-30 Thread Christoph Hellwig
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the bio_add_virt_nofail helper implementing it. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- drivers/md/dm-bufio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 18/19] btrfs: use bdev_rw_virt in scrub_one_super

2025-04-30 Thread Christoph Hellwig
Replace the code building a bio from a kernel direct map address and submitting it synchronously with the bdev_rw_virt helper. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo --- fs/btrfs/scrub.c | 10 ++ 1 file chang

[PATCH 14/19] dm-integrity: use bio_add_virt_nofail

2025-04-30 Thread Christoph Hellwig
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the bio_add_virt_nofail helper implementing it, and do the same for the similar pattern using bio_add_page for adding the first segment after a bio allocation as that can't fail either. Signed-off-by: Christoph Hellwig Reviewed-by: D

[PATCH 17/19] xfs: simplify building the bio in xlog_write_iclog

2025-04-30 Thread Christoph Hellwig
Use the bio_add_virt_nofail and bio_add_vmalloc helpers to abstract away the details of the memory allocation. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_log.c | 32 ++-- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs

[PATCH 12/19] PM: hibernate: split and simplify hib_submit_io

2025-04-30 Thread Christoph Hellwig
Split hib_submit_io into a sync and async version. The sync version is a small wrapper around bdev_rw_virt which implements all the logic to add a kernel direct mapping range to a bio and synchronously submits it, while the async version is slightly simplified using the bio_add_virt_nofail for add

[PATCH 15/19] xfs: simplify xfs_buf_submit_bio

2025-04-30 Thread Christoph Hellwig
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the bio_add_virt_nofail helper implementing it and use bio_add_vmalloc to insulate xfs from the details of adding vmalloc memory to a bio. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_buf.c | 43 --

[PATCH 11/19] zonefs: use bdev_rw_virt in zonefs_read_super

2025-04-30 Thread Christoph Hellwig
Switch zonefs_read_super to allocate the superblock buffer using kmalloc which falls back to the page allocator for PAGE_SIZE allocation but gives us a kernel virtual address and then use bdev_rw_virt to perform the synchronous read into it. Signed-off-by: Christoph Hellwig Acked-by: Damien Le Mo

[PATCH 10/19] gfs2: use bdev_rw_virt in gfs2_read_super

2025-04-30 Thread Christoph Hellwig
Switch gfs2_read_super to allocate the superblock buffer using kmalloc which falls back to the page allocator for PAGE_SIZE allocation but gives us a kernel virtual address and then use bdev_rw_virt to perform the synchronous read into it. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Gru

[PATCH 07/19] block: simplify bio_map_kern

2025-04-30 Thread Christoph Hellwig
Rewrite bio_map_kern using the new bio_add_* helpers and drop the kerneldoc comment that is superfluous for an internal helper. Signed-off-by: Christoph Hellwig --- block/blk-map.c | 56 - 1 file changed, 9 insertions(+), 47 deletions(-) diff --gi

[PATCH 09/19] rnbd-srv: use bio_add_virt_nofail

2025-04-30 Thread Christoph Hellwig
Use the bio_add_virt_nofail to add a single kernel virtual address to a bio as that can't fail. Signed-off-by: Christoph Hellwig Acked-by: Jack Wang Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- drivers/block/rnbd/rnbd-srv.c | 7 +-- 1 file changed, 1 insertion(+), 6 del

[PATCH 04/19] block: add a bio_add_vmalloc helpers

2025-04-30 Thread Christoph Hellwig
Add a helper to add a vmalloc region to a bio, abstracting away the vmalloc addresses from the underlying pages and another one wrapping it for the simple case where all data fits into a single bio. Signed-off-by: Christoph Hellwig --- block/bio.c | 55 +++

[PATCH 05/19] block: remove the q argument from blk_rq_map_kern

2025-04-30 Thread Christoph Hellwig
Remove the q argument from blk_rq_map_kern and the internal helpers called by it as the queue can trivially be derived from the request. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- block/blk-map.c| 2

[PATCH 06/19] block: pass the operation to bio_{map,copy}_kern

2025-04-30 Thread Christoph Hellwig
That way the bio can be allocated with the right operation already set and there is no need to pass the separated 'reading' argument. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- block/blk-map.c | 30

add more bio helpers v2

2025-04-30 Thread Christoph Hellwig
Hi all, this series adds more block layer helpers to remove boilerplate code when adding memory to a bio or to even do the entire synchronous I/O. The main aim is to avoid having to convert to a struct page in the caller when adding kernel direct mapping or vmalloc memory. Changes since v1: - t

[PATCH 02/19] block: add a bdev_rw_virt helper

2025-04-30 Thread Christoph Hellwig
Add a helper to perform synchronous I/O on a kernel direct map range. Currently this is implemented in various places in usually not very efficient ways, so provide a generic helper instead. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: J

[PATCH 03/19] block: add a bio_add_max_vecs helper

2025-04-30 Thread Christoph Hellwig
Add a helper to check how many bio_vecs are needed to add a kernel virtual address range to a bio, accounting for the always contiguous direct mapping and vmalloc mappings that usually need a bio_vec per page sized chunk. Signed-off-by: Christoph Hellwig --- include/linux/bio.h | 15

[PATCH 01/19] block: add a bio_add_virt_nofail helper

2025-04-30 Thread Christoph Hellwig
Add a helper to add a directly mapped kernel virtual address to a bio so that callers don't have to convert to pages or folios. For now only the _nofail variant is provided as that is what all the obvious callers want. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Ha

Re: [PATCH] dm: add missing unlock on in dm_keyslot_evict()

2025-04-30 Thread Mikulas Patocka
On Wed, 30 Apr 2025, Dan Carpenter wrote: > On Wed, Apr 30, 2025 at 09:50:37AM -0700, Eric Biggers wrote: > > On Wed, Apr 30, 2025 at 11:05:54AM +0300, Dan Carpenter wrote: > > > We need to call dm_put_live_table() even if dm_get_live_table() returns > > > NULL. > > > > > > Fixes: 9355a9eb21a5

Re: Coding stye (was Re: [PATCH 1/2] libmutipath: handle blacklisted paths on map_discovery)

2025-04-30 Thread Martin Wilck
On Wed, 2025-04-30 at 11:22 -0400, Benjamin Marzinski wrote: > On Wed, Apr 30, 2025 at 09:55:43AM +0200, Martin Wilck wrote: > > On Tue, 2025-04-29 at 16:27 -0400, Benjamin Marzinski wrote: > > > On Tue, Apr 29, 2025 at 09:59:40PM +0200, Martin Wilck wrote: > > > > On Mon, 2025-04-28 at 17:45 -0400

Re: [PATCH] dm: add missing unlock on in dm_keyslot_evict()

2025-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2025 at 09:50:37AM -0700, Eric Biggers wrote: > On Wed, Apr 30, 2025 at 11:05:54AM +0300, Dan Carpenter wrote: > > We need to call dm_put_live_table() even if dm_get_live_table() returns > > NULL. > > > > Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of > >

Re: [PATCH] dm: add missing unlock on in dm_keyslot_evict()

2025-04-30 Thread Eric Biggers
On Wed, Apr 30, 2025 at 11:05:54AM +0300, Dan Carpenter wrote: > We need to call dm_put_live_table() even if dm_get_live_table() returns > NULL. > > Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of > underlying devices") > Signed-off-by: Dan Carpenter > --- > drivers/md/d

Re: Coding stye (was Re: [PATCH 1/2] libmutipath: handle blacklisted paths on map_discovery)

2025-04-30 Thread Benjamin Marzinski
On Wed, Apr 30, 2025 at 09:55:43AM +0200, Martin Wilck wrote: > On Tue, 2025-04-29 at 16:27 -0400, Benjamin Marzinski wrote: > > On Tue, Apr 29, 2025 at 09:59:40PM +0200, Martin Wilck wrote: > > > On Mon, 2025-04-28 at 17:45 -0400, Benjamin Marzinski wrote: > > > > If the multipath configuration is

[PATCH 1/2] multipath-tools: hwtable: remove .pgfailback from QUANTUM/F1

2025-04-30 Thread Xose Vazquez Perez
Useless without a prio Cc: Martin Wilck Cc: Benjamin Marzinski Cc: Christophe Varoqui Cc: DM-DEVEL ML Signed-off-by: Xose Vazquez Perez --- libmultipath/hwtable.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c index 8b43c14d..f76d9180 10064

[PATCH 1/2] multipath-tools: hwtable: change AStor/NeoSapphire to work also with ALUA

2025-04-30 Thread Xose Vazquez Perez
Some devices supoorts also ALUA Cc: Martin Wilck Cc: Benjamin Marzinski Cc: Christophe Varoqui Cc: DM-DEVEL ML Signed-off-by: Xose Vazquez Perez --- libmultipath/hwtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c in

[PATCH] dm: add missing unlock on in dm_keyslot_evict()

2025-04-30 Thread Dan Carpenter
We need to call dm_put_live_table() even if dm_get_live_table() returns NULL. Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices") Signed-off-by: Dan Carpenter --- drivers/md/dm-table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Coding stye (was Re: [PATCH 1/2] libmutipath: handle blacklisted paths on map_discovery)

2025-04-30 Thread Martin Wilck
On Tue, 2025-04-29 at 16:27 -0400, Benjamin Marzinski wrote: > On Tue, Apr 29, 2025 at 09:59:40PM +0200, Martin Wilck wrote: > > On Mon, 2025-04-28 at 17:45 -0400, Benjamin Marzinski wrote: > > > If the multipath configuration is changed to blacklist existing > > > devices, > > > and multipathd is

Re: [PATCH] multipath-tools: replace dead url

2025-04-30 Thread Martin Wilck
On Sun, 2025-04-27 at 11:12 +0200, Xose Vazquez Perez wrote: > Original url at Wayback Machine: > https://web.archive.org/web/20230820174630/https://listman.redhat.com/archives/dm-devel/2017-September/msg00326.html > > Cc: Martin Wilck > Cc: Benjamin Marzinski > Cc: Christophe Varoqui > Cc: DM-

Re: [PATCH] multipath-tools: add Quantum devices to hwtable

2025-04-30 Thread Martin Wilck
On Fri, 2025-04-25 at 15:46 +0200, Xose Vazquez Perez wrote: > Info from: > https://qsupport.quantum.com/kb/Flare/Content/appliances/common/InfoHubDocSite/shared_SN_appliances/Topics/overview-MultipathConf.htm > > Cc: Martin Wilck > Cc: Benjamin Marzinski > Cc: Christophe Varoqui > Cc: DM-DEVEL