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

[BLOCK] bio: init ->bi_bdev in bio_init()

For SG_IO requests, bio->bi_bdev may not be explicitly initialized. So make
bio_init() clear the field to make sure it's always NULL or valid.

Signed-off-by: Jens Axboe <axboe@suse.de>

+1
+1
fs/bio.c
··· 126 inline void bio_init(struct bio *bio) 127 { 128 bio->bi_next = NULL; 129 bio->bi_flags = 1 << BIO_UPTODATE; 130 bio->bi_rw = 0; 131 bio->bi_vcnt = 0;
··· 126 inline void bio_init(struct bio *bio) 127 { 128 bio->bi_next = NULL; 129 + bio->bi_bdev = NULL; 130 bio->bi_flags = 1 << BIO_UPTODATE; 131 bio->bi_rw = 0; 132 bio->bi_vcnt = 0;