From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linan122@huawei.com>, <song@kernel.org>, <yukuai@fnnas.com>,
<hch@lst.de>, <sagi@grimberg.me>, <axboe@kernel.dk>
Cc: <linux-raid@vger.kernel.org>, <linux-nvme@lists.infradead.org>,
<linux-block@vger.kernel.org>,
Chaitanya Kulkarni <kch@nvidia.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH V4 1/3] md: ignore discard return value
Date: Wed, 11 Feb 2026 12:44:36 -0800 [thread overview]
Message-ID: <20260211204438.22568-2-kch@nvidia.com> (raw)
In-Reply-To: <20260211204438.22568-1-kch@nvidia.com>
__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 <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
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 59cd303548de..89c9e63a9139 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9179,8 +9179,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.39.5
next prev parent reply other threads:[~2026-02-11 20:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 20:44 [PATCH V4 0/3] block: ignore discard return value Chaitanya Kulkarni
2026-02-11 20:44 ` Chaitanya Kulkarni [this message]
2026-02-11 20:44 ` [PATCH V4 2/3] nvmet: " Chaitanya Kulkarni
2026-02-11 20:44 ` [PATCH V4 3/3] block: change return type to void Chaitanya Kulkarni
2026-02-12 10:15 ` [PATCH V4 0/3] block: ignore discard return value Christoph Hellwig
2026-02-12 11:27 ` Jens Axboe
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=20260211204438.22568-2-kch@nvidia.com \
--to=kch@nvidia.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=johannes.thumshirn@wdc.com \
--cc=linan122@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
--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