diff --git a/block/blk-lib.c b/block/blk-lib.c index ccbce2b2ea053a7d22f9e06c4ad6587a2ccafdc6..23d7f301a1967483ec79a383a1a317881caf3358 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -109,11 +109,14 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, blk_start_plug(&plug); ret = __blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, type, &bio); - if (!ret && bio) + if (!ret && bio) { ret = submit_bio_wait(type, bio); + if (ret == -EOPNOTSUPP) + ret = 0; + } blk_finish_plug(&plug); - return ret != -EOPNOTSUPP ? ret : 0; + return ret; } EXPORT_SYMBOL(blkdev_issue_discard);