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.

bcache: fix improper use of bi_end_io

Don't call bio->bi_end_io() directly. Use the bio_endio() helper
function instead, which handles completion more safely and uniformly.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Shida Zhang and committed by
Jens Axboe
53280e39 87213b0d

+3 -3
+3 -3
drivers/md/bcache/request.c
··· 1104 1104 } 1105 1105 1106 1106 kfree(ddip); 1107 - bio->bi_end_io(bio); 1107 + bio_endio(bio); 1108 1108 } 1109 1109 1110 1110 static void detached_dev_do_request(struct bcache_device *d, struct bio *bio, ··· 1121 1121 ddip = kzalloc(sizeof(struct detached_dev_io_private), GFP_NOIO); 1122 1122 if (!ddip) { 1123 1123 bio->bi_status = BLK_STS_RESOURCE; 1124 - bio->bi_end_io(bio); 1124 + bio_endio(bio); 1125 1125 return; 1126 1126 } 1127 1127 ··· 1136 1136 1137 1137 if ((bio_op(bio) == REQ_OP_DISCARD) && 1138 1138 !bdev_max_discard_sectors(dc->bdev)) 1139 - bio->bi_end_io(bio); 1139 + detached_dev_end_io(bio); 1140 1140 else 1141 1141 submit_bio_noacct(bio); 1142 1142 }