Re: [PATCH V3 2/6] md: ignore discard return value

Chaitanya Kulkarni <[email protected]>
Newsgroups gmane.linux.raid
Message-ID <[email protected]>
On 11/30/25 22:22, Chaitanya Kulkarni wrote:
> Hi Song Liu and Yu Kuai,
>
> On 11/24/25 15:48, Chaitanya Kulkarni wrote:
>> __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 <[email protected]>
>> Reviewed-by: Johannes Thumshirn <[email protected]>
>> Reviewed-by: Christoph Hellwig <[email protected]>
>> Signed-off-by: Chaitanya Kulkarni <[email protected]>
>> ---
>>   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);
>
>
> Gentle ping on this.
>
> -ck
>
>
Hi Song Liu and Yu Kuai,

Just pulled latest changes I don't see this patch been applied [1].
Unless my git repo is messed up.

Can you please provide review comments and let me know the blocker ?

-ck

  9169 /* This is used by raid0 and raid10 */
  9170 void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
  9171                         struct bio *bio, sector_t start, sector_t size)
  9172 {
  9173         struct bio *discard_bio = NULL;
  9174
  9175         if (__blkdev_issue_discard(rdev->bdev, start, size, GFP_NOIO,
  9176                         &discard_bio) || !discard_bio)
  9177                 return;
  9178
  9179         bio_chain(discard_bio, bio);
  9180         bio_clone_blkg_association(discard_bio, bio);
  9181         mddev_trace_remap(mddev, discard_bio, bio->bi_iter.bi_sector);
  9182         submit_bio_noacct(discard_bio);
  9183 }
  9184 EXPORT_SYMBOL_GPL(md_submit_discard_bio);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.