Thread: [f2fs-dev] [PATCH V3 5/6] f2fs: ignore discard return value (Page 2)
Brought to you by:
kjgkr
|
From: Chaitanya K. <cku...@gm...> - 2025-11-24 23:48:34
|
__blkdev_issue_discard() always returns 0, making the error assignment
in __submit_discard_cmd() dead code.
Initialize err to 0 and remove the error assignment from the
__blkdev_issue_discard() call to err. Move fault injection code into
already present if branch where err is set to -EIO.
This preserves the fault injection behavior while removing dead error
handling.
Reviewed-by: Martin K. Petersen <mar...@or...>
Reviewed-by: Johannes Thumshirn <joh...@wd...>
Reviewed-by: Christoph Hellwig <hc...@ls...>
Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
---
fs/f2fs/segment.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index b45eace879d7..22b736ec9c51 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1343,15 +1343,9 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
dc->di.len += len;
+ err = 0;
if (time_to_inject(sbi, FAULT_DISCARD)) {
err = -EIO;
- } else {
- err = __blkdev_issue_discard(bdev,
- SECTOR_FROM_BLOCK(start),
- SECTOR_FROM_BLOCK(len),
- GFP_NOFS, &bio);
- }
- if (err) {
spin_lock_irqsave(&dc->lock, flags);
if (dc->state == D_PARTIAL)
dc->state = D_SUBMIT;
@@ -1360,6 +1354,8 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
break;
}
+ __blkdev_issue_discard(bdev, SECTOR_FROM_BLOCK(start),
+ SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio);
f2fs_bug_on(sbi, !bio);
/*
--
2.40.0
|
|
From: Chaitanya K. <cku...@gm...> - 2025-11-24 23:48:34
|
__blkdev_issue_discard() always returns 0, making all error checking at
call sites dead code.
Simplify md to only check !discard_bio by ignoring the
__blkdev_issue_discard() value.
Reviewed-by: Martin K. Petersen <mar...@or...>
Reviewed-by: Johannes Thumshirn <joh...@wd...>
Reviewed-by: Christoph Hellwig <hc...@ls...>
Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
---
drivers/md/md.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7b5c5967568f..aeb62df39828 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9132,8 +9132,8 @@ void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
{
struct bio *discard_bio = NULL;
- if (__blkdev_issue_discard(rdev->bdev, start, size, GFP_NOIO,
- &discard_bio) || !discard_bio)
+ __blkdev_issue_discard(rdev->bdev, start, size, GFP_NOIO, &discard_bio);
+ if (!discard_bio)
return;
bio_chain(discard_bio, bio);
--
2.40.0
|
|
From: Chaitanya K. <cku...@gm...> - 2025-11-24 23:48:40
|
__blkdev_issue_discard() always returns 0, making all error checking
in XFS discard functions dead code.
Change xfs_discard_extents() return type to void, remove error variable,
error checking, and error logging for the __blkdev_issue_discard() call
in same function.
Update xfs_trim_perag_extents() and xfs_trim_rtgroup_extents() to
ignore the xfs_discard_extents() return value and error checking
code.
Update xfs_discard_rtdev_extents() to ignore __blkdev_issue_discard()
return value and error checking code.
Reviewed-by: Johannes Thumshirn <joh...@wd...>
Reviewed-by: Christoph Hellwig <hc...@ls...>
Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
---
fs/xfs/xfs_discard.c | 27 +++++----------------------
fs/xfs/xfs_discard.h | 2 +-
2 files changed, 6 insertions(+), 23 deletions(-)
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 6917de832191..b6ffe4807a11 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -108,7 +108,7 @@ xfs_discard_endio(
* list. We plug and chain the bios so that we only need a single completion
* call to clear all the busy extents once the discards are complete.
*/
-int
+void
xfs_discard_extents(
struct xfs_mount *mp,
struct xfs_busy_extents *extents)
@@ -116,7 +116,6 @@ xfs_discard_extents(
struct xfs_extent_busy *busyp;
struct bio *bio = NULL;
struct blk_plug plug;
- int error = 0;
blk_start_plug(&plug);
list_for_each_entry(busyp, &extents->extent_list, list) {
@@ -126,18 +125,10 @@ xfs_discard_extents(
trace_xfs_discard_extent(xg, busyp->bno, busyp->length);
- error = __blkdev_issue_discard(btp->bt_bdev,
+ __blkdev_issue_discard(btp->bt_bdev,
xfs_gbno_to_daddr(xg, busyp->bno),
XFS_FSB_TO_BB(mp, busyp->length),
GFP_KERNEL, &bio);
- if (error && error != -EOPNOTSUPP) {
- xfs_info(mp,
- "discard failed for extent [0x%llx,%u], error %d",
- (unsigned long long)busyp->bno,
- busyp->length,
- error);
- break;
- }
}
if (bio) {
@@ -148,8 +139,6 @@ xfs_discard_extents(
xfs_discard_endio_work(&extents->endio_work);
}
blk_finish_plug(&plug);
-
- return error;
}
/*
@@ -385,9 +374,7 @@ xfs_trim_perag_extents(
* list after this function call, as it may have been freed by
* the time control returns to us.
*/
- error = xfs_discard_extents(pag_mount(pag), extents);
- if (error)
- break;
+ xfs_discard_extents(pag_mount(pag), extents);
if (xfs_trim_should_stop())
break;
@@ -496,12 +483,10 @@ xfs_discard_rtdev_extents(
trace_xfs_discard_rtextent(mp, busyp->bno, busyp->length);
- error = __blkdev_issue_discard(bdev,
+ __blkdev_issue_discard(bdev,
xfs_rtb_to_daddr(mp, busyp->bno),
XFS_FSB_TO_BB(mp, busyp->length),
GFP_NOFS, &bio);
- if (error)
- break;
}
xfs_discard_free_rtdev_extents(tr);
@@ -741,9 +726,7 @@ xfs_trim_rtgroup_extents(
* list after this function call, as it may have been freed by
* the time control returns to us.
*/
- error = xfs_discard_extents(rtg_mount(rtg), tr.extents);
- if (error)
- break;
+ xfs_discard_extents(rtg_mount(rtg), tr.extents);
low = tr.restart_rtx;
} while (!xfs_trim_should_stop() && low <= high);
diff --git a/fs/xfs/xfs_discard.h b/fs/xfs/xfs_discard.h
index 2b1a85223a56..8c5cc4af6a07 100644
--- a/fs/xfs/xfs_discard.h
+++ b/fs/xfs/xfs_discard.h
@@ -6,7 +6,7 @@ struct fstrim_range;
struct xfs_mount;
struct xfs_busy_extents;
-int xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy);
+void xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy);
int xfs_ioc_trim(struct xfs_mount *mp, struct fstrim_range __user *fstrim);
#endif /* XFS_DISCARD_H */
--
2.40.0
|
|
From: Chao Yu <ch...@ke...> - 2025-11-25 01:10:10
|
On 11/25/2025 7:48 AM, Chaitanya Kulkarni wrote: > __blkdev_issue_discard() always returns 0, making the error assignment > in __submit_discard_cmd() dead code. > > Initialize err to 0 and remove the error assignment from the > __blkdev_issue_discard() call to err. Move fault injection code into > already present if branch where err is set to -EIO. > > This preserves the fault injection behavior while removing dead error > handling. > > Reviewed-by: Martin K. Petersen <mar...@or...> > Reviewed-by: Johannes Thumshirn <joh...@wd...> > Reviewed-by: Christoph Hellwig <hc...@ls...> > Signed-off-by: Chaitanya Kulkarni <cku...@gm...> Reviewed-by: Chao Yu <ch...@ke...> Thanks, |
|
From: Christoph H. <hc...@ls...> - 2025-11-25 06:34:13
|
On Tue, Nov 25, 2025 at 09:10:00AM +0800, Chao Yu wrote: > Reviewed-by: Chao Yu <ch...@ke...> Sending these all as a series might be confusing - it would be good if the individual patches get picked through the subsystem trees so that the function signature can be cleaned up after -rc1. Can we get this queued up in the f2fs tree? |
|
From: Chao Yu <ch...@ke...> - 2025-11-25 07:12:07
|
On 11/25/2025 2:33 PM, Christoph Hellwig wrote: > On Tue, Nov 25, 2025 at 09:10:00AM +0800, Chao Yu wrote: >> Reviewed-by: Chao Yu <ch...@ke...> > > Sending these all as a series might be confusing - it would be good > if the individual patches get picked through the subsystem trees > so that the function signature can be cleaned up after -rc1. > > Can we get this queued up in the f2fs tree? Yes, I think it's clean to queue this patch into f2fs tree. Thanks, |
|
From: Chaitanya K. <cha...@nv...> - 2025-12-01 13:01:48
|
Hi Jaegeuk Kim and Chao Yu, On 11/24/25 23:11, Chao Yu wrote: > On 11/25/2025 2:33 PM, Christoph Hellwig wrote: >> On Tue, Nov 25, 2025 at 09:10:00AM +0800, Chao Yu wrote: >>> Reviewed-by: Chao Yu <ch...@ke...> >> >> Sending these all as a series might be confusing - it would be good >> if the individual patches get picked through the subsystem trees >> so that the function signature can be cleaned up after -rc1. >> >> Can we get this queued up in the f2fs tree? > > Yes, I think it's clean to queue this patch into f2fs tree. > > Thanks, Gentle ping on this, if it's not already queued up, otherwise please ignore this email. -ck |
|
From: Anuj g. <anu...@gm...> - 2025-11-25 13:21:33
|
Reviewed-by: Anuj Gupta <anu...@sa...> |
|
From: Jens A. <ax...@ke...> - 2025-11-25 18:01:01
|
On 11/24/25 4:48 PM, Chaitanya Kulkarni wrote: > __blkdev_issue_discard() always returns 0, making the error check > in blkdev_issue_discard() dead code. Shouldn't it be a void instead then? -- Jens Axboe |
|
From: Chaitanya K. <cku...@gm...> - 2025-11-25 19:09:48
|
On 11/25/25 09:38, Jens Axboe wrote: > On 11/24/25 4:48 PM, Chaitanya Kulkarni wrote: >> __blkdev_issue_discard() always returns 0, making the error check >> in blkdev_issue_discard() dead code. > Shouldn't it be a void instead then? > Yes, we have decided to clean up the callers first [1]. Once they are merged safely, after rc1 I'll send a patch [2] to make it void since it touches many different subsystems. -ck [1] https://marc.info/?l=linux-block&m=176405170918235&w=2 https://marc.info/?l=dm-devel&m=176345232320530&w=2 [2] From abdf4d1863a02d4be816aaab9a789f44bfca568f Mon Sep 17 00:00:00 2001 From: Chaitanya Kulkarni <cku...@gm...> Date: Tue, 18 Nov 2025 10:35:58 -0800 Subject: [PATCH 6/6] block: change discar return type to void Now that all callers have been updated to not check the return value of __blkdev_issue_discard(), change its return type from int to void and remove the return 0 statement. This completes the cleanup of dead error checking code around __blkdev_issue_discard(). Signed-off-by: Chaitanya Kulkarni <cku...@gm...> --- block/blk-lib.c | 3 +-- include/linux/blkdev.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 19e0203cc18a..0a5f39325b2d 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -60,7 +60,7 @@ struct bio *blk_alloc_discard_bio(struct block_device *bdev, return bio; } -int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, +void __blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct bio **biop) { struct bio *bio; @@ -68,7 +68,6 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, while ((bio = blk_alloc_discard_bio(bdev, §or, &nr_sects, gfp_mask))) *biop = bio_chain_and_submit(*biop, bio); - return 0; } EXPORT_SYMBOL(__blkdev_issue_discard); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f0ab02e0a673..b05c37d20b09 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1258,7 +1258,7 @@ extern void blk_io_schedule(void); int blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask); -int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, +void __blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct bio **biop); int blkdev_issue_secure_erase(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp); -- 2.40.0 |
|
From: Jens A. <ax...@ke...> - 2025-11-25 19:19:24
|
On 11/25/25 12:09 PM, Chaitanya Kulkarni wrote: > On 11/25/25 09:38, Jens Axboe wrote: >> On 11/24/25 4:48 PM, Chaitanya Kulkarni wrote: >>> __blkdev_issue_discard() always returns 0, making the error check >>> in blkdev_issue_discard() dead code. >> Shouldn't it be a void instead then? >> > Yes, we have decided to clean up the callers first [1]. Once they are > merged safely, after rc1 I'll send a patch [2] to make it void since > it touches many different subsystems. OK, that make sense. I'll queue patch 1. -- Jens Axboe |
|
From: Jens A. <ax...@ke...> - 2025-11-25 19:20:12
|
On Mon, 24 Nov 2025 15:48:00 -0800, Chaitanya Kulkarni wrote:
> __blkdev_issue_discard() only returns value 0, that makes post call
> error checking code dead. This patch series revmoes this dead code at
> all the call sites and adjust the callers.
>
> Please note that it doesn't change the return type of the function from
> int to void in this series, it will be done once this series gets merged
> smoothly.
>
> [...]
Applied, thanks!
[1/6] block: ignore discard return value
(no commit info)
Best regards,
--
Jens Axboe
|
|
From: Yongpeng Y. <yan...@gm...> - 2025-11-26 02:37:27
|
On 11/25/25 07:48, Chaitanya Kulkarni wrote:
> __blkdev_issue_discard() always returns 0, making all error checking
> in XFS discard functions dead code.
>
> Change xfs_discard_extents() return type to void, remove error variable,
> error checking, and error logging for the __blkdev_issue_discard() call
> in same function.
>
> Update xfs_trim_perag_extents() and xfs_trim_rtgroup_extents() to
> ignore the xfs_discard_extents() return value and error checking
> code.
>
> Update xfs_discard_rtdev_extents() to ignore __blkdev_issue_discard()
> return value and error checking code.
>
> Reviewed-by: Johannes Thumshirn <joh...@wd...>
> Reviewed-by: Christoph Hellwig <hc...@ls...>
> Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
> ---
> fs/xfs/xfs_discard.c | 27 +++++----------------------
> fs/xfs/xfs_discard.h | 2 +-
> 2 files changed, 6 insertions(+), 23 deletions(-)
>
> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
> index 6917de832191..b6ffe4807a11 100644
> --- a/fs/xfs/xfs_discard.c
> +++ b/fs/xfs/xfs_discard.c
> @@ -108,7 +108,7 @@ xfs_discard_endio(
> * list. We plug and chain the bios so that we only need a single completion
> * call to clear all the busy extents once the discards are complete.
> */
> -int
> +void
> xfs_discard_extents(
> struct xfs_mount *mp,
> struct xfs_busy_extents *extents)
> @@ -116,7 +116,6 @@ xfs_discard_extents(
> struct xfs_extent_busy *busyp;
> struct bio *bio = NULL;
> struct blk_plug plug;
> - int error = 0;
>
> blk_start_plug(&plug);
> list_for_each_entry(busyp, &extents->extent_list, list) {
> @@ -126,18 +125,10 @@ xfs_discard_extents(
>
> trace_xfs_discard_extent(xg, busyp->bno, busyp->length);
>
> - error = __blkdev_issue_discard(btp->bt_bdev,
> + __blkdev_issue_discard(btp->bt_bdev,
> xfs_gbno_to_daddr(xg, busyp->bno),
> XFS_FSB_TO_BB(mp, busyp->length),
> GFP_KERNEL, &bio);
If blk_alloc_discard_bio() fails to allocate a bio inside
__blkdev_issue_discard(), this may lead to an invalid loop in
list_for_each_entry{}. Instead of using __blkdev_issue_discard(), how
about allocate and submit the discard bios explicitly in
list_for_each_entry{}?
Yongpeng,
> - if (error && error != -EOPNOTSUPP) {
> - xfs_info(mp,
> - "discard failed for extent [0x%llx,%u], error %d",
> - (unsigned long long)busyp->bno,
> - busyp->length,
> - error);
> - break;
> - }
> }
>
> if (bio) {
> @@ -148,8 +139,6 @@ xfs_discard_extents(
> xfs_discard_endio_work(&extents->endio_work);
> }
> blk_finish_plug(&plug);
> -
> - return error;
> }
>
> /*
> @@ -385,9 +374,7 @@ xfs_trim_perag_extents(
> * list after this function call, as it may have been freed by
> * the time control returns to us.
> */
> - error = xfs_discard_extents(pag_mount(pag), extents);
> - if (error)
> - break;
> + xfs_discard_extents(pag_mount(pag), extents);
>
> if (xfs_trim_should_stop())
> break;
> @@ -496,12 +483,10 @@ xfs_discard_rtdev_extents(
>
> trace_xfs_discard_rtextent(mp, busyp->bno, busyp->length);
>
> - error = __blkdev_issue_discard(bdev,
> + __blkdev_issue_discard(bdev,
> xfs_rtb_to_daddr(mp, busyp->bno),
> XFS_FSB_TO_BB(mp, busyp->length),
> GFP_NOFS, &bio);
> - if (error)
> - break;
> }
> xfs_discard_free_rtdev_extents(tr);
>
> @@ -741,9 +726,7 @@ xfs_trim_rtgroup_extents(
> * list after this function call, as it may have been freed by
> * the time control returns to us.
> */
> - error = xfs_discard_extents(rtg_mount(rtg), tr.extents);
> - if (error)
> - break;
> + xfs_discard_extents(rtg_mount(rtg), tr.extents);
>
> low = tr.restart_rtx;
> } while (!xfs_trim_should_stop() && low <= high);
> diff --git a/fs/xfs/xfs_discard.h b/fs/xfs/xfs_discard.h
> index 2b1a85223a56..8c5cc4af6a07 100644
> --- a/fs/xfs/xfs_discard.h
> +++ b/fs/xfs/xfs_discard.h
> @@ -6,7 +6,7 @@ struct fstrim_range;
> struct xfs_mount;
> struct xfs_busy_extents;
>
> -int xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy);
> +void xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy);
> int xfs_ioc_trim(struct xfs_mount *mp, struct fstrim_range __user *fstrim);
>
> #endif /* XFS_DISCARD_H */
|
|
From: Christoph H. <hc...@ls...> - 2025-11-26 10:33:35
|
On Wed, Nov 26, 2025 at 10:37:10AM +0800, Yongpeng Yang wrote: >> xfs_gbno_to_daddr(xg, busyp->bno), >> XFS_FSB_TO_BB(mp, busyp->length), >> GFP_KERNEL, &bio); > > If blk_alloc_discard_bio() fails to allocate a bio inside > __blkdev_issue_discard(), It won't, because mempool allocations will not fail if they can sleep as they can here. |
|
From: Chao Yu <ch...@ke...> - 2025-11-26 02:47:54
|
On 11/25/25 07:48, Chaitanya Kulkarni wrote:
> __blkdev_issue_discard() always returns 0, making the error assignment
> in __submit_discard_cmd() dead code.
>
> Initialize err to 0 and remove the error assignment from the
> __blkdev_issue_discard() call to err. Move fault injection code into
> already present if branch where err is set to -EIO.
>
> This preserves the fault injection behavior while removing dead error
> handling.
>
> Reviewed-by: Martin K. Petersen <mar...@or...>
> Reviewed-by: Johannes Thumshirn <joh...@wd...>
> Reviewed-by: Christoph Hellwig <hc...@ls...>
> Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
> ---
> fs/f2fs/segment.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index b45eace879d7..22b736ec9c51 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1343,15 +1343,9 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>
> dc->di.len += len;
>
> + err = 0;
> if (time_to_inject(sbi, FAULT_DISCARD)) {
> err = -EIO;
> - } else {
> - err = __blkdev_issue_discard(bdev,
> - SECTOR_FROM_BLOCK(start),
> - SECTOR_FROM_BLOCK(len),
> - GFP_NOFS, &bio);
> - }
> - if (err) {
> spin_lock_irqsave(&dc->lock, flags);
> if (dc->state == D_PARTIAL)
> dc->state = D_SUBMIT;
> @@ -1360,6 +1354,8 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
> break;
> }
>
> + __blkdev_issue_discard(bdev, SECTOR_FROM_BLOCK(start),
> + SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio);
Oh, wait, bio can be NULL? Then below f2fs_bug_on() will trigger panic or warning.
Thanks,
> f2fs_bug_on(sbi, !bio);
>
> /*
|
|
From: Chaitanya K. <cha...@nv...> - 2025-11-26 07:13:06
|
On 11/25/25 18:47, Chao Yu wrote:
> On 11/25/25 07:48, Chaitanya Kulkarni wrote:
>> __blkdev_issue_discard() always returns 0, making the error assignment
>> in __submit_discard_cmd() dead code.
>>
>> Initialize err to 0 and remove the error assignment from the
>> __blkdev_issue_discard() call to err. Move fault injection code into
>> already present if branch where err is set to -EIO.
>>
>> This preserves the fault injection behavior while removing dead error
>> handling.
>>
>> Reviewed-by: Martin K. Petersen <mar...@or...>
>> Reviewed-by: Johannes Thumshirn <joh...@wd...>
>> Reviewed-by: Christoph Hellwig <hc...@ls...>
>> Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
>> ---
>> fs/f2fs/segment.c | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index b45eace879d7..22b736ec9c51 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -1343,15 +1343,9 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>>
>> dc->di.len += len;
>>
>> + err = 0;
>> if (time_to_inject(sbi, FAULT_DISCARD)) {
>> err = -EIO;
>> - } else {
>> - err = __blkdev_issue_discard(bdev,
>> - SECTOR_FROM_BLOCK(start),
>> - SECTOR_FROM_BLOCK(len),
>> - GFP_NOFS, &bio);
>> - }
>> - if (err) {
>> spin_lock_irqsave(&dc->lock, flags);
>> if (dc->state == D_PARTIAL)
>> dc->state = D_SUBMIT;
>> @@ -1360,6 +1354,8 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>> break;
>> }
>>
>> + __blkdev_issue_discard(bdev, SECTOR_FROM_BLOCK(start),
>> + SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio);
> Oh, wait, bio can be NULL? Then below f2fs_bug_on() will trigger panic or warning.
>
> Thanks,
That will happen without this patch also or not ?
Since __blkdev_issue_discard() is always returning 0 irrespective of bio
is null or not.
The following condition in original code will only execute when err is set to
-EIO and that will only happen when time_to_inject() -> true.
Original call to __blkdev_issue_discard() without this patch will always
return 0 even for bio == NULL after __blkdev_issue_discard().
This is what we are trying to fix so caller should not rely on
__blkdev_issue_discard() return value :-
354 if (err) {
1355 spin_lock_irqsave(&dc->lock, flags);
1356 if (dc->state == D_PARTIAL)
1357 dc->state = D_SUBMIT;
1358 spin_unlock_irqrestore(&dc->lock, flags);
1359
1360 break;
1361 }
which will lead f2fs_bug_on() for bio == NULL even without this patch.
This patch is not changing exiting behavior, correct me if I'm wrong.
>
>> f2fs_bug_on(sbi, !bio);
>>
>> /*
-ck
|
|
From: Chao Yu <ch...@ke...> - 2025-11-26 03:58:41
|
On 11/26/25 11:37, Chaitanya Kulkarni wrote:
> On 11/25/25 18:47, Chao Yu wrote:
>> On 11/25/25 07:48, Chaitanya Kulkarni wrote:
>>> __blkdev_issue_discard() always returns 0, making the error assignment
>>> in __submit_discard_cmd() dead code.
>>>
>>> Initialize err to 0 and remove the error assignment from the
>>> __blkdev_issue_discard() call to err. Move fault injection code into
>>> already present if branch where err is set to -EIO.
>>>
>>> This preserves the fault injection behavior while removing dead error
>>> handling.
>>>
>>> Reviewed-by: Martin K. Petersen <mar...@or...>
>>> Reviewed-by: Johannes Thumshirn <joh...@wd...>
>>> Reviewed-by: Christoph Hellwig <hc...@ls...>
>>> Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
>>> ---
>>> fs/f2fs/segment.c | 10 +++-------
>>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>> index b45eace879d7..22b736ec9c51 100644
>>> --- a/fs/f2fs/segment.c
>>> +++ b/fs/f2fs/segment.c
>>> @@ -1343,15 +1343,9 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>>>
>>> dc->di.len += len;
>>>
>>> + err = 0;
>>> if (time_to_inject(sbi, FAULT_DISCARD)) {
>>> err = -EIO;
>>> - } else {
>>> - err = __blkdev_issue_discard(bdev,
>>> - SECTOR_FROM_BLOCK(start),
>>> - SECTOR_FROM_BLOCK(len),
>>> - GFP_NOFS, &bio);
>>> - }
>>> - if (err) {
>>> spin_lock_irqsave(&dc->lock, flags);
>>> if (dc->state == D_PARTIAL)
>>> dc->state = D_SUBMIT;
>>> @@ -1360,6 +1354,8 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
>>> break;
>>> }
>>>
>>> + __blkdev_issue_discard(bdev, SECTOR_FROM_BLOCK(start),
>>> + SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio);
>> Oh, wait, bio can be NULL? Then below f2fs_bug_on() will trigger panic or warning.
>>
>> Thanks,
>
> That will happen without this patch also or not ?
>
> Since __blkdev_issue_discard() is always returning 0 irrespective of bio
> is null or not.
>
> The following condition in original code will only execute when err is set to
> -EIO and that will only happen when time_to_inject() -> true.
> Original call to __blkdev_issue_discard() without this patch will always
> return 0 even for bio == NULL after __blkdev_issue_discard().
>
> This is what we are trying to fix so caller should not rely on
> __blkdev_issue_discard() return value :-
>
> 354 if (err) {
> 1355 spin_lock_irqsave(&dc->lock, flags);
> 1356 if (dc->state == D_PARTIAL)
> 1357 dc->state = D_SUBMIT;
> 1358 spin_unlock_irqrestore(&dc->lock, flags);
> 1359
> 1360 break;
> 1361 }
>
> which will lead f2fs_bug_on() for bio == NULL even without this patch.
>
> This patch is not changing exiting behavior, correct me if I'm wrong.
Yes, I think you're right, thanks for the explanation.
So it's fine to leave this cleanup patch as it is, and let's fix this bug in
a separated patch.
Thanks,
>
>
>>
>>> f2fs_bug_on(sbi, !bio);
>>>
>>> /*
>
> -ck
>
>
|
|
From: Chaitanya K. <cha...@nv...> - 2025-11-26 08:21:53
|
On 11/25/25 18:37, Yongpeng Yang wrote:
>> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
>> index 6917de832191..b6ffe4807a11 100644
>> --- a/fs/xfs/xfs_discard.c
>> +++ b/fs/xfs/xfs_discard.c
>> @@ -108,7 +108,7 @@ xfs_discard_endio(
>> * list. We plug and chain the bios so that we only need a single
>> completion
>> * call to clear all the busy extents once the discards are complete.
>> */
>> -int
>> +void
>> xfs_discard_extents(
>> struct xfs_mount *mp,
>> struct xfs_busy_extents *extents)
>> @@ -116,7 +116,6 @@ xfs_discard_extents(
>> struct xfs_extent_busy *busyp;
>> struct bio *bio = NULL;
>> struct blk_plug plug;
>> - int error = 0;
>> blk_start_plug(&plug);
>> list_for_each_entry(busyp, &extents->extent_list, list) {
>> @@ -126,18 +125,10 @@ xfs_discard_extents(
>> trace_xfs_discard_extent(xg, busyp->bno, busyp->length);
>> - error = __blkdev_issue_discard(btp->bt_bdev,
>> + __blkdev_issue_discard(btp->bt_bdev,
>> xfs_gbno_to_daddr(xg, busyp->bno),
>> XFS_FSB_TO_BB(mp, busyp->length),
>> GFP_KERNEL, &bio);
>
> If blk_alloc_discard_bio() fails to allocate a bio inside
> __blkdev_issue_discard(), this may lead to an invalid loop in
> list_for_each_entry{}. Instead of using __blkdev_issue_discard(), how
> about allocate and submit the discard bios explicitly in
> list_for_each_entry{}?
>
> Yongpeng,
Calling __blkdev_issue_discard() keeps managing all the bio with the
appropriate GFP mask, so the semantics stay the same. You are just
moving memory allocation to the caller and potentially looking at
implementing retry on bio allocation failure.
The retry for discard bio memory allocation is not desired I think,
since it's only a hint to the controller.
This patch is simply cleaning up dead error-handling branches at the
callers no behavioral changes intended.
What maybe useful is to stop iterating once we fail to allocate the
bio [1].
-ck
[1] Potential addition on the top of this to exit early in discard loop
on bio allocation failure.
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index b6ffe4807a11..1519f708bb79 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -129,6 +129,13 @@ xfs_discard_extents(
xfs_gbno_to_daddr(xg, busyp->bno),
XFS_FSB_TO_BB(mp, busyp->length),
GFP_KERNEL, &bio);
+ /*
+ * We failed to allocate bio instead of continuing the loop
+ * so it will lead to inconsistent discards to the disk
+ * exit early and jump into xfs_discard_busy_clear().
+ */
+ if (!bio)
+ break;
}
if (bio) {
If we keep looping after the first bio == NULL, the rest of the range is
guaranteed to be inconsistent anyways, because every subsequent iteration
will fall into one of three cases:
- The allocator keeps returning NULL, so none of the remaining LBAs receive
discard.
- Rest of the allocator succeeds, but we’ve already skipped a chunk, leaving
a hole in the discard range.
- We get intermittent successes, which produces alternating chunks of
discarded and undiscarded blocks.
In each of those scenarios, the disk ends up with a partially discarded
range, so the correct fix is to break out of the loop immediately and
proceed to xfs_discard_busy_clear() once the very first allocation fails.
|
|
From: <hc...@ls...> - 2025-11-26 10:34:16
|
On Wed, Nov 26, 2025 at 08:07:21AM +0000, Chaitanya Kulkarni wrote: > The retry for discard bio memory allocation is not desired I think, > since it's only a hint to the controller. Yes, it is. The command is defined as a hint, but it's required for a lot of workloads to work. It's not just a speculative readahead. |
|
From: Yongpeng Y. <yan...@gm...> - 2025-11-26 09:15:02
|
On 11/26/25 16:07, Chaitanya Kulkarni via Linux-f2fs-devel wrote:
> On 11/25/25 18:37, Yongpeng Yang wrote:
>>> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
>>> index 6917de832191..b6ffe4807a11 100644
>>> --- a/fs/xfs/xfs_discard.c
>>> +++ b/fs/xfs/xfs_discard.c
>>> @@ -108,7 +108,7 @@ xfs_discard_endio(
>>> * list. We plug and chain the bios so that we only need a single
>>> completion
>>> * call to clear all the busy extents once the discards are complete.
>>> */
>>> -int
>>> +void
>>> xfs_discard_extents(
>>> struct xfs_mount *mp,
>>> struct xfs_busy_extents *extents)
>>> @@ -116,7 +116,6 @@ xfs_discard_extents(
>>> struct xfs_extent_busy *busyp;
>>> struct bio *bio = NULL;
>>> struct blk_plug plug;
>>> - int error = 0;
>>> blk_start_plug(&plug);
>>> list_for_each_entry(busyp, &extents->extent_list, list) {
>>> @@ -126,18 +125,10 @@ xfs_discard_extents(
>>> trace_xfs_discard_extent(xg, busyp->bno, busyp->length);
>>> - error = __blkdev_issue_discard(btp->bt_bdev,
>>> + __blkdev_issue_discard(btp->bt_bdev,
>>> xfs_gbno_to_daddr(xg, busyp->bno),
>>> XFS_FSB_TO_BB(mp, busyp->length),
>>> GFP_KERNEL, &bio);
>>
>> If blk_alloc_discard_bio() fails to allocate a bio inside
>> __blkdev_issue_discard(), this may lead to an invalid loop in
>> list_for_each_entry{}. Instead of using __blkdev_issue_discard(), how
>> about allocate and submit the discard bios explicitly in
>> list_for_each_entry{}?
>>
>> Yongpeng,
>
>
> Calling __blkdev_issue_discard() keeps managing all the bio with the
> appropriate GFP mask, so the semantics stay the same. You are just
> moving memory allocation to the caller and potentially looking at
> implementing retry on bio allocation failure.
>
> The retry for discard bio memory allocation is not desired I think,
> since it's only a hint to the controller.
Agreed. I'm not trying to retry bio allocation inside the
list_for_each_entry{} loop. Instead, since blk_alloc_discard_bio()
returning NULL cannot reliably indicate whether the failure is due to
bio allocation failure, it could also be caused by 'bio_sects == 0', I'd
like to allocate the bio explicitly.
>
> This patch is simply cleaning up dead error-handling branches at the
> callers no behavioral changes intended.
>
> What maybe useful is to stop iterating once we fail to allocate the
> bio [1].
>
> -ck
>
> [1] Potential addition on the top of this to exit early in discard loop
> on bio allocation failure.
>
> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
> index b6ffe4807a11..1519f708bb79 100644
> --- a/fs/xfs/xfs_discard.c
> +++ b/fs/xfs/xfs_discard.c
> @@ -129,6 +129,13 @@ xfs_discard_extents(
> xfs_gbno_to_daddr(xg, busyp->bno),
> XFS_FSB_TO_BB(mp, busyp->length),
> GFP_KERNEL, &bio);
> + /*
> + * We failed to allocate bio instead of continuing the loop
> + * so it will lead to inconsistent discards to the disk
> + * exit early and jump into xfs_discard_busy_clear().
> + */
> + if (!bio)
> + break;
I noticed that as long as XFS_FSB_TO_BB(mp, busyp->length) is greater
than 0 and there is no bio allocation failure, __blkdev_issue_discard()
will never return NULL. I'm not familiar with this part of the xfs, so
I'm not sure whether there are cases where 'XFS_FSB_TO_BB(mp,
busyp->length)' could be 0. If such cases do not exist, then
checking whether the bio is NULL should be sufficient.
Yongpeng,
> }
>
> if (bio) {
> > If we keep looping after the first bio == NULL, the rest of the range is
> guaranteed to be inconsistent anyways, because every subsequent iteration
> will fall into one of three cases:
>
> - The allocator keeps returning NULL, so none of the remaining LBAs receive
> discard.
> - Rest of the allocator succeeds, but we’ve already skipped a chunk, leaving
> a hole in the discard range.
> - We get intermittent successes, which produces alternating chunks of
> discarded and undiscarded blocks.
>
> In each of those scenarios, the disk ends up with a partially discarded
> range, so the correct fix is to break out of the loop immediately and
> proceed to xfs_discard_busy_clear() once the very first allocation fails.
|
|
From: Yongpeng Y. <yan...@gm...> - 2025-11-26 09:48:41
|
On 11/26/25 17:14, Yongpeng Yang wrote:
> On 11/26/25 16:07, Chaitanya Kulkarni via Linux-f2fs-devel wrote:
>> On 11/25/25 18:37, Yongpeng Yang wrote:
>>>> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
>>>> index 6917de832191..b6ffe4807a11 100644
>>>> --- a/fs/xfs/xfs_discard.c
>>>> +++ b/fs/xfs/xfs_discard.c
>>>> @@ -108,7 +108,7 @@ xfs_discard_endio(
>>>> * list. We plug and chain the bios so that we only need a single
>>>> completion
>>>> * call to clear all the busy extents once the discards are
>>>> complete.
>>>> */
>>>> -int
>>>> +void
>>>> xfs_discard_extents(
>>>> struct xfs_mount *mp,
>>>> struct xfs_busy_extents *extents)
>>>> @@ -116,7 +116,6 @@ xfs_discard_extents(
>>>> struct xfs_extent_busy *busyp;
>>>> struct bio *bio = NULL;
>>>> struct blk_plug plug;
>>>> - int error = 0;
>>>> blk_start_plug(&plug);
>>>> list_for_each_entry(busyp, &extents->extent_list, list) {
>>>> @@ -126,18 +125,10 @@ xfs_discard_extents(
>>>> trace_xfs_discard_extent(xg, busyp->bno, busyp->length);
>>>> - error = __blkdev_issue_discard(btp->bt_bdev,
>>>> + __blkdev_issue_discard(btp->bt_bdev,
>>>> xfs_gbno_to_daddr(xg, busyp->bno),
>>>> XFS_FSB_TO_BB(mp, busyp->length),
>>>> GFP_KERNEL, &bio);
>>>
>>> If blk_alloc_discard_bio() fails to allocate a bio inside
>>> __blkdev_issue_discard(), this may lead to an invalid loop in
>>> list_for_each_entry{}. Instead of using __blkdev_issue_discard(), how
>>> about allocate and submit the discard bios explicitly in
>>> list_for_each_entry{}?
>>>
>>> Yongpeng,
>>
>>
>> Calling __blkdev_issue_discard() keeps managing all the bio with the
>> appropriate GFP mask, so the semantics stay the same. You are just
>> moving memory allocation to the caller and potentially looking at
>> implementing retry on bio allocation failure.
>>
>> The retry for discard bio memory allocation is not desired I think,
>> since it's only a hint to the controller.
>
> Agreed. I'm not trying to retry bio allocation inside the
> list_for_each_entry{} loop. Instead, since blk_alloc_discard_bio()
> returning NULL cannot reliably indicate whether the failure is due to
> bio allocation failure, it could also be caused by 'bio_sects == 0', I'd
> like to allocate the bio explicitly.
>
>>
>> This patch is simply cleaning up dead error-handling branches at the
>> callers no behavioral changes intended.
>>
>> What maybe useful is to stop iterating once we fail to allocate the
>> bio [1].
>>
>> -ck
>>
>> [1] Potential addition on the top of this to exit early in discard loop
>> on bio allocation failure.
>>
>> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
>> index b6ffe4807a11..1519f708bb79 100644
>> --- a/fs/xfs/xfs_discard.c
>> +++ b/fs/xfs/xfs_discard.c
>> @@ -129,6 +129,13 @@ xfs_discard_extents(
>> xfs_gbno_to_daddr(xg, busyp->bno),
>> XFS_FSB_TO_BB(mp, busyp->length),
>> GFP_KERNEL, &bio);
>> + /*
>> + * We failed to allocate bio instead of continuing the
>> loop
>> + * so it will lead to inconsistent discards to the disk
>> + * exit early and jump into xfs_discard_busy_clear().
>> + */
>> + if (!bio)
>> + break;
>
> I noticed that as long as XFS_FSB_TO_BB(mp, busyp->length) is greater
> than 0 and there is no bio allocation failure, __blkdev_issue_discard()
> will never return NULL. I'm not familiar with this part of the xfs, so
> I'm not sure whether there are cases where 'XFS_FSB_TO_BB(mp,
> busyp->length)' could be 0. If such cases do not exist, then
> checking whether the bio is NULL should be sufficient.
>
> Yongpeng,
If __blkdev_issue_discard() requires multiple calls to
blk_alloc_discard_bio(), once the first bio allocation succeeds, it will
never result in bio == NULL, meaning that any subsequent bio allocation
failures cannot be detected.
Yongpeng,
>
>> }
>> if (bio) {
>> > If we keep looping after the first bio == NULL, the rest of the
>> range is
>> guaranteed to be inconsistent anyways, because every subsequent iteration
>> will fall into one of three cases:
>>
>> - The allocator keeps returning NULL, so none of the remaining LBAs
>> receive
>> discard.
>> - Rest of the allocator succeeds, but we’ve already skipped a chunk,
>> leaving
>> a hole in the discard range.
>> - We get intermittent successes, which produces alternating chunks of
>> discarded and undiscarded blocks.
>>
>> In each of those scenarios, the disk ends up with a partially discarded
>> range, so the correct fix is to break out of the loop immediately and
>> proceed to xfs_discard_busy_clear() once the very first allocation fails.
|
|
From: Yongpeng Y. <yan...@gm...> - 2025-11-26 10:14:50
|
On 11/25/25 07:48, Chaitanya Kulkarni wrote:
> __blkdev_issue_discard() always returns 0, making the error checking
> in nvmet_bdev_discard_range() dead code.
>
> Kill the function nvmet_bdev_discard_range() and call
> __blkdev_issue_discard() directly from nvmet_bdev_execute_discard(),
> since no error handling is needed anymore for __blkdev_issue_discard()
> call.
>
> Reviewed-by: Martin K. Petersen <mar...@or...>
> Reviewed-by: Johannes Thumshirn <joh...@wd...>
> Reviewed-by: Christoph Hellwig <hc...@ls...>
> Signed-off-by: Chaitanya Kulkarni <cku...@gm...>
> ---
> drivers/nvme/target/io-cmd-bdev.c | 28 +++++++---------------------
> 1 file changed, 7 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
> index 8d246b8ca604..ca7731048940 100644
> --- a/drivers/nvme/target/io-cmd-bdev.c
> +++ b/drivers/nvme/target/io-cmd-bdev.c
> @@ -362,29 +362,14 @@ u16 nvmet_bdev_flush(struct nvmet_req *req)
> return 0;
> }
>
> -static u16 nvmet_bdev_discard_range(struct nvmet_req *req,
> - struct nvme_dsm_range *range, struct bio **bio)
> -{
> - struct nvmet_ns *ns = req->ns;
> - int ret;
> -
> - ret = __blkdev_issue_discard(ns->bdev,
> - nvmet_lba_to_sect(ns, range->slba),
> - le32_to_cpu(range->nlb) << (ns->blksize_shift - 9),
> - GFP_KERNEL, bio);
> - if (ret && ret != -EOPNOTSUPP) {
> - req->error_slba = le64_to_cpu(range->slba);
> - return errno_to_nvme_status(req, ret);
> - }
> - return NVME_SC_SUCCESS;
> -}
> -
> static void nvmet_bdev_execute_discard(struct nvmet_req *req)
> {
> + struct nvmet_ns *ns = req->ns;
> struct nvme_dsm_range range;
> struct bio *bio = NULL;
> + sector_t nr_sects;
> int i;
> - u16 status;
> + u16 status = NVME_SC_SUCCESS;
>
> for (i = 0; i <= le32_to_cpu(req->cmd->dsm.nr); i++) {
> status = nvmet_copy_from_sgl(req, i * sizeof(range), &range,
> @@ -392,9 +377,10 @@ static void nvmet_bdev_execute_discard(struct nvmet_req *req)
> if (status)
> break;
>
> - status = nvmet_bdev_discard_range(req, &range, &bio);
> - if (status)
> - break;
> + nr_sects = le32_to_cpu(range.nlb) << (ns->blksize_shift - 9);
> + __blkdev_issue_discard(ns->bdev,
> + nvmet_lba_to_sect(ns, range.slba), nr_sects,
> + GFP_KERNEL, &bio);
We also need to check for memory allocation errors in
__blkdev_issue_discard(). However, this cannot be done by simply
checking if bio is NULL. Similar to the issue with xfs_discard_extents,
once __blkdev_issue_discard()->blk_alloc_discard_bio() succeeds once,
any subsequent memory allocation failures cannot be detected by checking
if bio is NULL.
Yongpeng,
> }
>
> if (bio) {
|
|
From: Christoph H. <hc...@ls...> - 2025-11-26 10:37:10
|
On Wed, Nov 26, 2025 at 06:14:32PM +0800, Yongpeng Yang wrote: > We also need to check for memory allocation errors in > __blkdev_issue_discard(). No, we still don't. What is so hard to grasp about mempool allocations even after repeated explanations? |
|
From: <pat...@ke...> - 2025-12-03 21:53:13
|
Hello:
This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <ja...@ke...>:
On Mon, 24 Nov 2025 15:48:00 -0800 you wrote:
> Hi,
>
> __blkdev_issue_discard() only returns value 0, that makes post call
> error checking code dead. This patch series revmoes this dead code at
> all the call sites and adjust the callers.
>
> Please note that it doesn't change the return type of the function from
> int to void in this series, it will be done once this series gets merged
> smoothly.
>
> [...]
Here is the summary with links:
- [f2fs-dev,V3,1/6] block: ignore discard return value
(no matching commit)
- [f2fs-dev,V3,2/6] md: ignore discard return value
(no matching commit)
- [f2fs-dev,V3,3/6] dm: ignore discard return value
(no matching commit)
- [f2fs-dev,V3,4/6] nvmet: ignore discard return value
(no matching commit)
- [f2fs-dev,V3,5/6] f2fs: ignore discard return value
https://git.kernel.org/jaegeuk/f2fs/c/807e755c468a
- [f2fs-dev,V3,6/6] xfs: ignore discard return value
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
|
|
From: Christoph H. <hc...@ls...> - 2025-11-24 06:29:10
|
> + nvmet_lba_to_sect(ns, range.slba), > + nr_sects, > + GFP_KERNEL, &bio); This can be condensed a bit to: nvmet_lba_to_sect(ns, range.slba), nr_sects, GFP_KERNEL, &bio); Otherwise looks good: Reviewed-by: Christoph Hellwig <hc...@ls...> |