Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: ignore __blkdev_issue_discard() return value

__blkdev_issue_discard() always returns 0, making the error check
in blkdev_issue_discard() dead code.

In function blkdev_issue_discard() initialize ret = 0, remove ret
assignment from __blkdev_issue_discard(), rely on bio == NULL check to
call submit_bio_wait(), preserve submit_bio_wait() error handling, and
preserve -EOPNOTSUPP to 0 mapping.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Chaitanya Kulkarni and committed by
Jens Axboe
7d09a8e2 3a64c46c

+3 -3
+3 -3
block/blk-lib.c
··· 87 87 { 88 88 struct bio *bio = NULL; 89 89 struct blk_plug plug; 90 - int ret; 90 + int ret = 0; 91 91 92 92 blk_start_plug(&plug); 93 - ret = __blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, &bio); 94 - if (!ret && bio) { 93 + __blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, &bio); 94 + if (bio) { 95 95 ret = submit_bio_wait(bio); 96 96 if (ret == -EOPNOTSUPP) 97 97 ret = 0;