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

Chaitanya Kulkarni <[email protected]>
Newsgroups gmane.linux.raid
Message-ID <[email protected]>
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
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.