Re: [dm-devel] [PATCH v2] dm-zero, dm-error: support discards

2023-03-30 Thread Milan Broz
On 3/10/23 09:05, Milan Broz wrote: On 3/7/23 18:32, Mikulas Patocka wrote: dm-zero, dm-error: support discards This patch adds discard support to dm-zero and dm-error. dm-zero ignores the discards, dm-error return -EIO. It is useful when the user combines dm-zero or dm-error with other discard

Re: [dm-devel] [PATCH 17/19] md: raid1: check if adding pages to resync bio fails

2023-03-30 Thread Johannes Thumshirn
On 30.03.23 01:44, Damien Le Moal wrote: > On 3/30/23 02:06, Johannes Thumshirn wrote: >> 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. >> >

[dm-devel] [PATCH v2 00/19] bio: check return values of bio_add_page

2023-03-30 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 v2 01/19] swap: use __bio_add_page to add page to bio

2023-03-30 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- mm/page_io.c | 8

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

2023-03-30 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/dr

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

2023-03-30 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 Signed-off-by: Johannes Thumshirn Revie

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

2023-03-30 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 v2 06/19] md: raid5-log: use __bio_add_page to add single page

2023-03-30 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 v2 08/19] btrfs: repair: use __bio_add_page for adding single page

2023-03-30 Thread Johannes Thumshirn
The btrfs repair bio 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_

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

2023-03-30 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 v2 07/19] md: raid5: use __bio_add_page to add single page to new bio

2023-03-30 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 v2 09/19] btrfs: raid56: use __bio_add_page to add single page

2023-03-30 Thread Johannes Thumshirn
The btrfs raid58 sector 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 b

[dm-devel] [PATCH v2 10/19] jfs: logmgr: use __bio_add_page to add single page to bio

2023-03-30 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 v2 11/19] gfs: use __bio_add_page for adding single page to bio

2023-03-30 Thread Johannes Thumshirn
The GFS 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_p

[dm-devel] [PATCH v2 12/19] zonefs: use __bio_add_page for adding single page to bio

2023-03-30 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 v2 13/19] zram: use __bio_add_page for adding single page to bio

2023-03-30 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 v2 14/19] floppy: use __bio_add_page for adding single page to bio

2023-03-30 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 v2 15/19] md: check for failure when adding pages in alloc_behind_master_bio

2023-03-30 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/rai

[dm-devel] [PATCH v2 16/19] md: raid1: use __bio_add_page for adding single page to bio

2023-03-30 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 v2 17/19] md: raid1: check if adding pages to resync bio fails

2023-03-30 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/raid1-10.c | 7 ++- d

[dm-devel] [PATCH v2 18/19] dm-crypt: check if adding pages to clone bio fails

2023-03-30 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/md/dm-crypt.c | 9 +++

[dm-devel] [PATCH v2 19/19] block: mark bio_add_page as __must_check

2023-03-30 Thread Johannes Thumshirn
Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 "dm crypt: avoid accessing uninitialized tasklet" has been added to the 5.10-stable tree

2023-03-30 Thread Sasha Levin
This is a note to let you know that I've just added the patch titled dm crypt: avoid accessing uninitialized tasklet to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-crypt

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

2023-03-30 Thread Johannes Thumshirn
On 30.03.23 17:52, David Sterba wrote: > On Thu, Mar 30, 2023 at 03:43:42AM -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

[dm-devel] [git pull] device mapper fixes for 6.3-rc5

2023-03-30 Thread Mike Snitzer
Hi Linus, The following changes since commit 197b6b60ae7bc51dd0814953c562833143b292aa: Linux 6.3-rc4 (2023-03-26 14:40:20 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git tags/for-6.3/dm-fixes-2 for you to fetch change

Re: [dm-devel] [git pull] device mapper fixes for 6.3-rc5

2023-03-30 Thread pr-tracker-bot
The pull request you sent on Thu, 30 Mar 2023 16:31:28 -0400: > git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git > tags/for-6.3/dm-fixes-2 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/b527ac44eb1782cf179d4e08ceda7d2a9643aff5 Thank you! --

[dm-devel] [PATCH] dm raid: remove unused d variable

2023-03-30 Thread Tom Rix
clang with W=1 reports drivers/md/dm-raid.c:2212:15: error: variable 'd' set but not used [-Werror,-Wunused-but-set-variable] unsigned int d; ^ This variable is not used so remove it. Signed-off-by: Tom Rix --- drivers/md/dm-raid.c | 4 1 file changed, 4 delet

Re: [dm-devel] [PATCH 18/19] dm-crypt: check if adding pages to clone bio fails

2023-03-30 Thread Yang Shi
On Wed, Mar 29, 2023 at 5:24 PM Damien Le Moal wrote: > > On 3/30/23 09:17, Yang Shi wrote: > > On Wed, Mar 29, 2023 at 4:49 PM Damien Le Moal > > wrote: > >> > >> On 3/30/23 02:06, Johannes Thumshirn wrote: > >>> Check if adding pages to clone bio fails and if bail out. > >> > >> Nope. The code

Re: [dm-devel] [PATCH v8 4/9] fs, block: copy_file_range for def_blk_ops for direct block device.

2023-03-30 Thread Nitesh Shetty
On Thu, Mar 30, 2023 at 11:18 AM Christian Brauner wrote: > > On Wed, Mar 29, 2023 at 06:12:36PM +0530, Nitesh Shetty wrote: > > On Wed, Mar 29, 2023 at 02:14:40PM +0200, Christian Brauner wrote: > > > On Mon, Mar 27, 2023 at 02:10:52PM +0530, Anuj Gupta wrote: > > > > From: Nitesh Shetty > > > >

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

2023-03-30 Thread David Sterba
On Thu, Mar 30, 2023 at 04:41:58PM +, Johannes Thumshirn wrote: > On 30.03.23 17:52, David Sterba wrote: > > On Thu, Mar 30, 2023 at 03:43:42AM -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 f

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

2023-03-30 Thread David Sterba
On Thu, Mar 30, 2023 at 03:43:42AM -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 v2 3/7] fs: Introduce FALLOC_FL_PROVISION

2023-03-30 Thread Sarthak Kukreti
On Mon, Jan 9, 2023 at 7:06 AM Brian Foster wrote: > > On Thu, Jan 05, 2023 at 11:35:36AM -0800, Darrick J. Wong wrote: > > On Thu, Jan 05, 2023 at 09:46:06AM -0500, Brian Foster wrote: > > > On Wed, Jan 04, 2023 at 01:22:06PM -0800, Sarthak Kukreti wrote: > > > > (Resend; the text flow made the l

Re: [dm-devel] [PATCH v2 3/7] fs: Introduce FALLOC_FL_PROVISION

2023-03-30 Thread Sarthak Kukreti
On Thu, Jan 5, 2023 at 7:49 AM Theodore Ts'o wrote: > > On Wed, Jan 04, 2023 at 01:22:06PM -0800, Sarthak Kukreti wrote: > > > How expensive is this expected to be? Is this why you wanted a separate > > > mode flag? > > > > Yes, the exact latency will depend on the stacked block devices and > > t

Re: [dm-devel] [PATCH v2 10/19] jfs: logmgr: use __bio_add_page to add single page to bio

2023-03-30 Thread Dave Kleikamp
On 3/30/23 5:43AM, Johannes Thumshirn wrote: 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 s

Re: [dm-devel] [PATCH v2 3/7] fs: Introduce FALLOC_FL_PROVISION

2023-03-30 Thread Sarthak Kukreti
On Thu, Jan 5, 2023 at 6:45 AM Brian Foster wrote: > > On Wed, Jan 04, 2023 at 01:22:06PM -0800, Sarthak Kukreti wrote: > > (Resend; the text flow made the last reply unreadable) > > > > On Wed, Jan 4, 2023 at 8:39 AM Darrick J. Wong wrote: > > > > > > On Thu, Dec 29, 2022 at 12:12:48AM -0800, Sa

Re: [dm-devel] [PATCH v2 2/7] dm: Add support for block provisioning

2023-03-30 Thread Sarthak Kukreti
On Thu, Jan 5, 2023 at 6:42 AM Brian Foster wrote: > > On Thu, Dec 29, 2022 at 12:12:47AM -0800, Sarthak Kukreti wrote: > > Add support to dm devices for REQ_OP_PROVISION. The default mode > > is to pass through the request and dm-thin will utilize it to provision > > blocks. > > > > Signed-off-by