From: Chaitanya Kulkarni <ckulkarnilinux@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com,
song@kernel.org, yukuai@fnnas.com, hch@lst.de, sagi@grimberg.me,
kch@nvidia.com, jaegeuk@kernel.org, chao@kernel.org,
cem@kernel.org
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
dm-devel@lists.linux.dev, linux-raid@vger.kernel.org,
linux-nvme@lists.infradead.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-xfs@vger.kernel.org, bpf@vger.kernel.org,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH V3 1/6] block: ignore discard return value
Date: Tue, 25 Nov 2025 11:09:35 -0800 [thread overview]
Message-ID: <851516d5-a5e8-47dd-82e0-3e34090e600d@gmail.com> (raw)
In-Reply-To: <e3f09e0c-63f4-4887-8e3a-1fb24963b627@kernel.dk>
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 <ckulkarnilinux@gmail.com>
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 <ckulkarnilinux@gmail.com>
---
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
next prev parent reply other threads:[~2025-11-25 19:09 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 23:48 [PATCH V3 0/6] block: ignore __blkdev_issue_discard() ret value Chaitanya Kulkarni
2025-11-24 23:48 ` [PATCH V3 1/6] block: ignore discard return value Chaitanya Kulkarni
2025-11-25 17:38 ` Jens Axboe
2025-11-25 19:09 ` Chaitanya Kulkarni [this message]
2025-11-25 19:19 ` Jens Axboe
2025-11-24 23:48 ` [PATCH V3 2/6] md: " Chaitanya Kulkarni
2025-12-01 6:22 ` Chaitanya Kulkarni
2026-01-24 21:29 ` Chaitanya Kulkarni
2025-11-24 23:48 ` [PATCH V3 3/6] dm: " Chaitanya Kulkarni
2025-11-24 23:48 ` [PATCH V3 4/6] nvmet: " Chaitanya Kulkarni
2025-11-26 10:14 ` [f2fs-dev] " Yongpeng Yang
2025-11-26 10:37 ` Christoph Hellwig
2026-01-24 21:35 ` Chaitanya Kulkarni
2026-01-26 4:57 ` hch
2026-01-27 22:40 ` Chaitanya Kulkarni
2025-11-24 23:48 ` [PATCH V3 5/6] f2fs: " Chaitanya Kulkarni
2025-11-25 1:10 ` Chao Yu
2025-11-25 6:33 ` Christoph Hellwig
2025-11-25 7:11 ` Chao Yu
2025-11-26 2:47 ` Chao Yu
2025-11-26 3:37 ` Chaitanya Kulkarni
2025-11-26 3:58 ` Chao Yu
2025-11-24 23:48 ` [PATCH V3 6/6] xfs: " Chaitanya Kulkarni
2025-11-26 2:37 ` [f2fs-dev] " Yongpeng Yang
2025-11-26 8:07 ` Chaitanya Kulkarni
2025-11-26 9:14 ` Yongpeng Yang
2025-11-26 9:48 ` Yongpeng Yang
2025-11-26 10:34 ` hch
2025-11-26 10:33 ` Christoph Hellwig
2025-11-25 13:20 ` [PATCH V3 0/6] block: ignore __blkdev_issue_discard() ret value Anuj gupta
2025-11-25 19:20 ` (subset) " Jens Axboe
2025-12-03 21:50 ` [f2fs-dev] " patchwork-bot+f2fs
2025-12-09 17:18 ` patchwork-bot+f2fs
2025-12-16 0:50 ` patchwork-bot+f2fs
2026-02-17 21:14 ` patchwork-bot+f2fs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=851516d5-a5e8-47dd-82e0-3e34090e600d@gmail.com \
--to=ckulkarnilinux@gmail.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=cem@kernel.org \
--cc=chao@kernel.org \
--cc=dm-devel@lists.linux.dev \
--cc=hch@lst.de \
--cc=jaegeuk@kernel.org \
--cc=johannes.thumshirn@wdc.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpatocka@redhat.com \
--cc=sagi@grimberg.me \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=yukuai@fnnas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox