Message ID | 56B44AF6.2090003@huawei.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/block/blk-lib.c b/block/blk-lib.c index 9ebf653..e4f02f1 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -19,7 +19,9 @@ static void bio_batch_end_io(struct bio *bio) { struct bio_batch *bb = bio->bi_private; - if (bio->bi_error && bio->bi_error != -EOPNOTSUPP) + /* ignore -EOPNOTSUPP only when issue a discard request */ + if (bio->bi_error && (!(bio->bi_rw & REQ_DISCARD) || + (bio->bi_error != -EOPNOTSUPP))) bb->error = bio->bi_error; if (atomic_dec_and_test(&bb->done)) complete(bb->wait);