Re: [dm-devel] [PATCH v6 15/20] md: raid1: check if adding pages to resync bio fails

2023-05-31 Thread Paul Menzel
Dear Johannes, Thank you for your patches. Am 31.05.23 um 06:58 schrieb Song Liu: On Tue, May 30, 2023 at 9:25 PM Christoph Hellwig wrote: To me these look like __bio_add_page candidates, but I guess Song preferred it this way? It'll add a bit pointless boilerplate code, but I'm ok with

Re: [dm-devel] [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible

2023-05-31 Thread Dave Chinner
On Thu, Jun 01, 2023 at 06:20:21AM +0200, Christoph Hellwig wrote: > On Thu, Jun 01, 2023 at 08:36:59AM +1000, Dave Chinner wrote: > > We lose adjacent page merging with this change. > > This is only used for adding the first folio to a brand new bio, > so there is nothing to merge with yet at

Re: [dm-devel] [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible

2023-05-31 Thread Christoph Hellwig
On Thu, Jun 01, 2023 at 08:36:59AM +1000, Dave Chinner wrote: > We lose adjacent page merging with this change. This is only used for adding the first folio to a brand new bio, so there is nothing to merge with yet at this point. -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible

2023-05-31 Thread Dave Chinner
On Wed, May 31, 2023 at 04:50:42AM -0700, Johannes Thumshirn wrote: > When the iomap buffered-io code can't add a folio to a bio, it allocates a > new bio and adds the folio to that one. This is done using bio_add_folio(), > but doesn't check for errors. > > As adding a folio to a newly created

Re: [dm-devel] [PATCH v7 1/5] block: Don't invalidate pagecache for invalid falloc modes

2023-05-31 Thread Mike Snitzer
On Thu, May 18 2023 at 6:33P -0400, Sarthak Kukreti wrote: > Only call truncate_bdev_range() if the fallocate mode is > supported. This fixes a bug where data in the pagecache > could be invalidated if the fallocate() was called on the > block device with an invalid mode. > > Fixes:

Re: [dm-devel] [PATCH 4/5] multipathd: reload map if the path groups are out of order

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-24 at 18:21 -0500, Benjamin Marzinski wrote: > need_switch_pathgroup() only checks if the currently used pathgroup > is > not the highest priority pathgroup. If it isn't, all multipathd does > is > instruct the kernel to switch to the correct pathgroup.  However, the > kernel

Re: [dm-devel] [PATCH 5/5] multipathd: don't assume mpp->paths will exist in need_switch_pathgroup

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-24 at 18:21 -0500, Benjamin Marzinski wrote: > When need_switch_pathgroup() is called by deferred_failback_tick(), > there is a chance that mpp->paths will be NULL, even if there are > paths > in the multipath device's pathgroups. Instead check if there are > multiple pathgroups,

Re: [dm-devel] [PATCH 3/5] multipathd: refresh all priorities if one has changed

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-24 at 18:21 -0500, Benjamin Marzinski wrote: > For multipath devices with path group policies other than > group_by_prio, > multipathd wasn't updating all the paths' priorities when calling > need_switch_pathgroup(), even in cases where it likely was necessary. > When a path just

Re: [dm-devel] [PATCH 2/5] multipath-tools tests: add tests to verify PRIO_UDEF changes

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-24 at 18:21 -0500, Benjamin Marzinski wrote: > Make sure that pathgroups that include paths with a prio_UNDEF > priority > are properly sorted. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck > --- >  tests/pgpolicy.c | 42

Re: [dm-devel] [PATCH 1/5] libmultipath: don't count PRIO_UNDEF paths for pathgroup priority

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-24 at 18:21 -0500, Benjamin Marzinski wrote: > When multipath is not set to group_by_prio, different paths in a > pathgroup can have different priorities. If there is a problem > getting > the priority of an active path, its priority will be set to > PRIO_UNDEF. > This will change

Re: [dm-devel] [PATCH] multipath-tools: adapt HITACHI/OPEN- config to work with alua and multibus

2023-05-31 Thread Martin Wilck
On Wed, 2023-05-31 at 15:57 +0200, Xose Vazquez Perez wrote: > ALUA is needed by Hitachi Global-Active Device (GAD): > https://knowledge.hitachivantara.com/Documents/Management_Software/SVOS/8.1/Global-Active_Device/Overview_of_global-active_device Thanks, but where exactly did you find this

Re: [dm-devel] [PATCH 0/5] multipath: Add a group_by_tgp path grouping policy

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > This patchset is adds a new path grouping policy that can be used > with > ALUA devices. The goal is to avoid the temporary incorrect path > groupings that can happen when paths change priorities. > Thanks a lot for doing this. It

Re: [dm-devel] [PATCH v7 00/20] bio: check return values of bio_add_page

2023-05-31 Thread Jens Axboe
On Wed, 31 May 2023 04:50:23 -0700, Johannes Thumshirn wrote: > We have two functions for adding a page to a bio, __bio_add_page() which is > used to add a single page to a freshly created bio and bio_add_page() which is > used to add a page to an existing bio. > > While __bio_add_page() is

Re: [dm-devel] [PATCH 5/5] libmultipath: add "detect_pgpolicy" config option

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > This allows configuations to use "group_by_tpg" if alua is > autodetected > and another policy if it isn't, so they can work with detect_prio. This is a bit confusing. We might have introduced this kind of autodetection without

Re: [dm-devel] [PATCH 4/5] multipath-tools tests: add tests for group_by_tpg policy

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > Signed-off-by: Benjamin Marzinski I wonder if it might make sense for group_by_tpg to mock calls to getprio (assigning the prio from the path's TPG ID) rather than calling set_priority() directly. > --- >  tests/pgpolicy.c | 201 >

Re: [dm-devel] [PATCH 2/5] libmultipath: don't copy pgpolicy string in get_pgpolicy_name

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > copying the value into a passed in buffer doesn't help any of the > callers of this function. It's just wasted work. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck > --- >  libmultipath/dict.c   |  6 +- >  

Re: [dm-devel] [PATCH 1/5] libmultipath: add group_by_tpg path_grouping_policy

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > When we group paths by prio and the priority changes, paths can end > up > temporarily in the wrong path groups.  This usually happens when some > paths are down, so their priority can't be updated. To avoid this for > ALUA paths,

Re: [dm-devel] [PATCH 3/5] libmultipath: add ALUA tpg path wildcard

2023-05-31 Thread Martin Wilck
On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote: > Make it possible to easily check a path's target port group. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck > --- >  libmultipath/print.c | 9 + >  1 file changed, 9 insertions(+) > > diff --git

[dm-devel] [PATCH 05/24] init: remove pointless Root_* values

2023-05-31 Thread Christoph Hellwig
Remove all unused defines, and just use the expanded versions for the SCSI disk majors. I've decided to keep Root_RAM0 even if it could be expanded as there is a lot of special casing for it in the init code. Signed-off-by: Christoph Hellwig --- arch/alpha/kernel/setup.c | 2 +-

[dm-devel] [PATCH 08/24] init: pass root_device_name explicitly

2023-05-31 Thread Christoph Hellwig
Instead of declaring root_device_name as a global variable pass it as an argument to the functions using it. Signed-off-by: Christoph Hellwig --- init/do_mounts.c| 29 - init/do_mounts.h| 14 +++--- init/do_mounts_initrd.c | 11 ++- 3

[dm-devel] [PATCH 01/24] driver core: return bool from driver_probe_done

2023-05-31 Thread Christoph Hellwig
bool is the most sensible return value for a yes/no return. Also add __init as this funtion is only called from the early boot code. Signed-off-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman --- drivers/base/dd.c | 6 ++ include/linux/device/driver.h | 2 +-

[dm-devel] [PATCH 02/24] PM: hibernate: factor out a helper to find the resume device

2023-05-31 Thread Christoph Hellwig
Split the logic to find the resume device out software_resume and into a separate helper to start unwindig the convoluted goto logic. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki --- kernel/power/hibernate.c | 72 +--- 1 file changed, 37

[dm-devel] [PATCH 06/24] init: rename mount_block_root to mount_root_generic

2023-05-31 Thread Christoph Hellwig
mount_block_root is also used to mount non-block file systems, so give it a better name. Signed-off-by: Christoph Hellwig --- init/do_mounts.c| 6 +++--- init/do_mounts.h| 2 +- init/do_mounts_initrd.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git

[dm-devel] [PATCH 04/24] PM: hibernate: move finding the resume device out of software_resume

2023-05-31 Thread Christoph Hellwig
software_resume can be called either from an init call in the boot code, or from sysfs once the system has finished booting, and the two invocation methods this can't race with each other. For the latter case we did just parse the suspend device manually, while the former might not have one.

[dm-devel] [PATCH] multipath-tools: adapt HITACHI/OPEN- config to work with alua and multibus

2023-05-31 Thread Xose Vazquez Perez
ALUA is needed by Hitachi Global-Active Device (GAD): https://knowledge.hitachivantara.com/Documents/Management_Software/SVOS/8.1/Global-Active_Device/Overview_of_global-active_device Cc: Matthias Rudolph Cc: Martin Wilck Cc: Benjamin Marzinski Cc: Christophe Varoqui Cc: DM-DEVEL ML

[dm-devel] [PATCH 07/24] init: refactor mount_root

2023-05-31 Thread Christoph Hellwig
Provide stubs for all the lower level mount helpers, and just switch on ROOT_DEV in the main function. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 104 +-- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/init/do_mounts.c

[dm-devel] [PATCH 11/24] init: factor the root_wait logic in prepare_namespace into a helper

2023-05-31 Thread Christoph Hellwig
The root_wait logic is a bit obsfucated right now. Expand it and move it into a helper. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index

[dm-devel] fix the name_to_dev_t mess v2

2023-05-31 Thread Christoph Hellwig
Hi all, this series tries to sort out accumulated mess around the name_to_dev_t function. This function is intended to allow looking up the dev_t of a block device based on a name string before the root file systems is mounted and thus the normal path based lookup is available. Unfortunately a

[dm-devel] [PATCH 03/24] PM: hibernate: remove the global snapshot_test variable

2023-05-31 Thread Christoph Hellwig
Passing call dependent variable in global variables is a huge antipattern. Fix it up. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki --- kernel/power/hibernate.c | 17 ++--- kernel/power/power.h | 3 +-- kernel/power/swap.c | 2 +- 3 files changed, 8

[dm-devel] [PATCH 09/24] init: don't remove the /dev/ prefix from error messages

2023-05-31 Thread Christoph Hellwig
Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git

[dm-devel] [PATCH 17/24] dm-snap: simplify the origin_dev == cow_dev check in snapshot_ctr

2023-05-31 Thread Christoph Hellwig
Use the block_device acquired in dm_get_device for the check instead of doing an extra lookup. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer --- drivers/md/dm-snap.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm-snap.c

[dm-devel] [PATCH 20/24] dm: only call early_lookup_bdev from early boot context

2023-05-31 Thread Christoph Hellwig
early_lookup_bdev is supposed to only be called from the early boot code, but dm_get_device calls it as a general fallback when lookup_bdev fails, which is problematic because early_lookup_bdev bypasses all normal path based permission checking, and might cause problems with certain container

[dm-devel] [PATCH 14/24] init: clear root_wait on all invalid root= strings

2023-05-31 Thread Christoph Hellwig
Instead of only clearing root_wait in devt_from_partuuid when the UUID format was invalid, do that in parse_root_device for all strings that failed to parse. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff

[dm-devel] [PATCH 18/24] dm: open code dm_get_dev_t in dm_init_init

2023-05-31 Thread Christoph Hellwig
dm_init_init is called from early boot code, and thus lookup_bdev will never succeed. Just open code that call to early_lookup_bdev instead. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer --- drivers/md/dm-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[dm-devel] [PATCH 23/24] mtd: block2mtd: don't call early_lookup_bdev after the system is running

2023-05-31 Thread Christoph Hellwig
early_lookup_bdev is supposed to only be called from the early boot code, but mdtblock_early_get_bdev is called as a general fallback when lookup_bdev fails, which is problematic because early_lookup_bdev bypasses all normal path based permission checking, and might cause problems with certain

[dm-devel] [PATCH 22/24] mtd: block2mtd: factor the early block device open logic into a helper

2023-05-31 Thread Christoph Hellwig
Simplify add_device a bit by splitting out the cumbersome early boot logic into a separate helper. Signed-off-by: Christoph Hellwig Reviewed-by: Miquel Raynal --- drivers/mtd/devices/block2mtd.c | 53 +++-- 1 file changed, 30 insertions(+), 23 deletions(-) diff

Re: [dm-devel] [PATCH v2 00/16] Diskseq support in loop, device-mapper, and blkback

2023-05-31 Thread Christoph Hellwig
On Tue, May 30, 2023 at 04:31:00PM -0400, Demi Marie Obenour wrote: > This work aims to allow userspace to create and destroy block devices > in a race-free way, and to allow them to be exposed to other Xen VMs via > blkback without races. > > Changes since v1: > > - Several device-mapper fixes

[dm-devel] [PATCH 12/24] init: move the nfs/cifs/ram special cases out of name_to_dev_t

2023-05-31 Thread Christoph Hellwig
The nfs/cifs/ram special case only needs to be parsed once, and only in the boot code. Move them out of name_to_dev_t and into prepare_namespace. Signed-off-by: Christoph Hellwig --- Documentation/admin-guide/kernel-parameters.txt | 7 ++- init/do_mounts.c|

[dm-devel] [PATCH 24/24] block: mark early_lookup_bdev as __init

2023-05-31 Thread Christoph Hellwig
early_lookup_bdev is now only used during the early boot code as it should, so mark it __init to not waste run time memory on it. Signed-off-by: Christoph Hellwig --- block/early-lookup.c | 19 +-- include/linux/blkdev.h | 2 +- 2 files changed, 10 insertions(+), 11

[dm-devel] [PATCH 15/24] block: move the code to do early boot lookup of block devices to block/

2023-05-31 Thread Christoph Hellwig
Create a new block/early-lookup.c to keep the early block device lookup code instead of having this code sit with the early mount code. Signed-off-by: Christoph Hellwig --- .../admin-guide/kernel-parameters.txt | 4 +- block/Makefile| 2 +-

[dm-devel] [PATCH 19/24] dm: remove dm_get_dev_t

2023-05-31 Thread Christoph Hellwig
Open code dm_get_dev_t in the only remaining caller, and propagate the exact error code from lookup_bdev and early_lookup_bdev. Signed-off-by: Christoph Hellwig --- drivers/md/dm-table.c | 22 +- include/linux/device-mapper.h | 2 -- 2 files changed, 5

[dm-devel] [PATCH 10/24] init: handle ubi/mtd root mounting like all other root types

2023-05-31 Thread Christoph Hellwig
Assign a Root_Generic magic value for UBI/MTD root and handle the root mounting in mount_root like all other root types. Besides making the code more clear this also means that UBI/MTD root can be used together with an initrd (not that anyone should care). Also factor parsing of the root name

Re: [dm-devel] [PATCH v7 17/20] block: mark bio_add_page as __must_check

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 21/24] PM: hibernate: don't use early_lookup_bdev in resume_store

2023-05-31 Thread Christoph Hellwig
resume_store is a sysfs attribute written during normal kernel runtime, and it should not use the early_lookup_bdev API that bypasses all normal path based permission checking, and might cause problems with certain container environments renaming devices. Switch to lookup_bdev, which does a

[dm-devel] [PATCH 13/24] init: improve the name_to_dev_t interface

2023-05-31 Thread Christoph Hellwig
name_to_dev_t has a very misleading name, that doesn't make clear it should only be used by the early init code, and also has a bad calling convention that doesn't allow returning different kinds of errors. Rename it to early_lookup_bdev to make the use case clear, and return an errno, where

[dm-devel] [PATCH 16/24] block: move more code to early-lookup.c

2023-05-31 Thread Christoph Hellwig
blk_lookup_devt is only used by code in early-lookup.c, so move it there. printk_all_partitions and it's helper bdevt_str are only used by the early init code in init/do_mounts.c, so they should go there as well. Signed-off-by: Christoph Hellwig --- block/early-lookup.c | 92

Re: [dm-devel] [PATCH v7 18/20] block: add bio_add_folio_nofail

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v7 20/20] block: mark bio_add_folio as __must_check

2023-05-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH v7 14/20] md: raid1: use __bio_add_page for adding single page to bio

2023-05-31 Thread Johannes Thumshirn
The sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as

[dm-devel] [PATCH v7 12/20] floppy: use __bio_add_page for adding single page to bio

2023-05-31 Thread Johannes Thumshirn
The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as

[dm-devel] [PATCH v7 10/20] zonefs: use __bio_add_page for adding single page to bio

2023-05-31 Thread Johannes Thumshirn
The zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking

[dm-devel] [PATCH v7 06/20] md: raid5-log: use __bio_add_page to add single page

2023-05-31 Thread Johannes Thumshirn
The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking

[dm-devel] [PATCH v7 20/20] block: mark bio_add_folio as __must_check

2023-05-31 Thread Johannes Thumshirn
Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn --- include/linux/bio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bio.h

[dm-devel] [PATCH v7 18/20] block: add bio_add_folio_nofail

2023-05-31 Thread Johannes Thumshirn
Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn --- block/bio.c | 8 include/linux/bio.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/block/bio.c b/block/bio.c index

[dm-devel] [PATCH v7 13/20] md: check for failure when adding pages in alloc_behind_master_bio

2023-05-31 Thread Johannes Thumshirn
alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Reviewed-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Damien Le Moal

[dm-devel] [PATCH v7 11/20] zram: use __bio_add_page for adding single page to bio

2023-05-31 Thread Johannes Thumshirn
The zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page()

[dm-devel] [PATCH v7 17/20] block: mark bio_add_page as __must_check

2023-05-31 Thread Johannes Thumshirn
Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- include/linux/bio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bio.h

[dm-devel] [PATCH v7 09/20] gfs2: use __bio_add_page for adding single page to bio

2023-05-31 Thread Johannes Thumshirn
The GFS2 superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking

[dm-devel] [PATCH v7 15/20] md: raid1: check if adding pages to resync bio fails

2023-05-31 Thread Johannes Thumshirn
Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. Technically __bio_add_pages() would be sufficient here, but asserting the pages actually get added to the bio is preferred. This way we can mark bio_add_pages

Re: [dm-devel] [PATCH v6 00/20] bio: check return values of bio_add_page

2023-05-31 Thread Johannes Thumshirn
Oops I've accidentally re-send v6 instead of v7. My apologies. -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH v7 01/20] swap: use __bio_add_page to add page to bio

2023-05-31 Thread Johannes Thumshirn
The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Johannes

[dm-devel] [PATCH v7 00/20] bio: check return values of bio_add_page

2023-05-31 Thread Johannes Thumshirn
We have two functions for adding a page to a bio, __bio_add_page() which is used to add a single page to a freshly created bio and bio_add_page() which is used to add a page to an existing bio. While __bio_add_page() is expected to succeed, bio_add_page() can fail. This series converts the

[dm-devel] [PATCH v7 07/20] md: raid5: use __bio_add_page to add single page to new bio

2023-05-31 Thread Johannes Thumshirn
The raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding

[dm-devel] [PATCH v7 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page

2023-05-31 Thread Johannes Thumshirn
dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Reviewed-by: Damien Le Moal

[dm-devel] [PATCH v7 16/20] dm-crypt: use __bio_add_page to add single page to clone bio

2023-05-31 Thread Johannes Thumshirn
crypt_alloc_buffer() already allocates enough entries in the clone bio's vector, so adding a page to the bio can't fail. Use __bio_add_page() to reflect this. Signed-off-by: Johannes Thumshirn --- drivers/md/dm-crypt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[dm-devel] [PATCH v7 05/20] md: use __bio_add_page to add single page

2023-05-31 Thread Johannes Thumshirn
The md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking

[dm-devel] [PATCH v7 08/20] jfs: logmgr: use __bio_add_page to add single page to bio

2023-05-31 Thread Johannes Thumshirn
The JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as

[dm-devel] [PATCH v7 02/20] drbd: use __bio_add_page to add page to bio

2023-05-31 Thread Johannes Thumshirn
The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn ---

[dm-devel] [PATCH v7 19/20] fs: iomap: use bio_add_folio_nofail where possible

2023-05-31 Thread Johannes Thumshirn
When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced bio_add_folio_nofail() function.

[dm-devel] [PATCH v7 04/20] fs: buffer: use __bio_add_page to add single page to bio

2023-05-31 Thread Johannes Thumshirn
The buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking

Re: [dm-devel] [PATCH v6 04/20] fs: buffer: use __bio_add_page to add single page to bio

2023-05-31 Thread Gou Hao
On 5/30/23 23:49, Johannes Thumshirn wrote: The buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed.