aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blk-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index b9a252cae4df..5bf806adc770 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1817,7 +1817,7 @@ static int blk_end_io(struct request *rq, int error, unsigned int nr_bytes,
1817 struct request_queue *q = rq->q; 1817 struct request_queue *q = rq->q;
1818 unsigned long flags = 0UL; 1818 unsigned long flags = 0UL;
1819 1819
1820 if (bio_has_data(rq->bio) || blk_discard_rq(rq)) { 1820 if (rq->bio) {
1821 if (__end_that_request_first(rq, error, nr_bytes)) 1821 if (__end_that_request_first(rq, error, nr_bytes))
1822 return 1; 1822 return 1;
1823 1823
@@ -1875,8 +1875,7 @@ EXPORT_SYMBOL_GPL(blk_end_request);
1875 **/ 1875 **/
1876int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes) 1876int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
1877{ 1877{
1878 if ((bio_has_data(rq->bio) || blk_discard_rq(rq)) && 1878 if (rq->bio && __end_that_request_first(rq, error, nr_bytes))
1879 __end_that_request_first(rq, error, nr_bytes))
1880 return 1; 1879 return 1;
1881 1880
1882 add_disk_randomness(rq->rq_disk); 1881 add_disk_randomness(rq->rq_disk);