Re: [dm-devel] [PATCH blktests v2] tests/dm: add a regression test

2023-05-02 Thread Shinichiro Kawasaki
Yu, thanks for the patch. I have three minor comments below. Other than that, the patch looks good to me. If you do not mind, I can do these edits. Please let me know your thoughts. 1) Let's describe a bit more in the commit title, like, "tests/dm: add dm test group and a test for self-map" 2)

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

2023-05-02 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 caller

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

2023-05-02 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 Signed-off-by: Johannes Thumshirn --- mm/page_io.c | 8

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

2023-05-02 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 --- drivers/block/dr

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

2023-05-02 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 Signed-off-

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

2023-05-02 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 bio_add_p

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

2023-05-02 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 bio_a

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

2023-05-02 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 a

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

2023-05-02 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 bi

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

2023-05-02 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 bio_add_

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

2023-05-02 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 __must_

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

2023-05-02 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 bio_ad

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

2023-05-02 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() as

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

2023-05-02 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 __must_

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

2023-05-02 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: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/rai

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

2023-05-02 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 v5 15/20] md: raid1: check if adding pages to resync bio fails

2023-05-02 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. This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid1-

[dm-devel] [PATCH v5 16/20] dm-crypt: check if adding pages to clone bio fails

2023-05-02 Thread Johannes Thumshirn
Check if adding pages to clone bio fails and if it does retry with reclaim. This mirrors the behaviour of page allocation in crypt_alloc_buffer(). This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-crypt.c | 9 +++

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

2023-05-02 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h i

[dm-devel] [PATCH v5 18/20] block: add __bio_add_folio

2023-05-02 Thread Johannes Thumshirn
Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Signed-off-by: Johannes Thumshirn --- block/bio.c | 8 include/linux/bio.h | 1 + 2 files changed, 9 insertions(+) diff --git a/block/bio.c b/block/bio.c index 043944fd46eb..350c653d4a57 100644 --- a/block

[dm-devel] [PATCH v5 19/20] fs: iomap: use __bio_add_folio where possible

2023-05-02 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() function. Signed-off

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

2023-05-02 Thread Johannes Thumshirn
Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Signed-off-by: Johannes Thumshirn --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 4232a17e6b10..fef9f3085a02 100644

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

2023-05-02 Thread Johannes Thumshirn
On 02.05.23 13:51, Bob Peterson wrote: > On 5/2/23 6:19 AM, Johannes Thumshirn wrote: >> 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 pag