Skip to content

Commit

Permalink
[BLOCK] bio: init ->bi_bdev in bio_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Jan 9, 2006
1 parent 769db45 commit 0ea60b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static void bio_fs_destructor(struct bio *bio)
inline void bio_init(struct bio *bio)
{
bio->bi_next = NULL;
bio->bi_bdev = NULL;
bio->bi_flags = 1 << BIO_UPTODATE;
bio->bi_rw = 0;
bio->bi_vcnt = 0;
Expand Down

0 comments on commit 0ea60b5

Please sign in to comment.