diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-06-16 08:37:03 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-09-29 07:38:42 -0400 |
commit | 1503140d3ec2be9b917d2f8f7c64cb77b79a215b (patch) | |
tree | 6138ec14ae6301c69687a769cc96a39044ee49aa /fs/btrfs | |
parent | a1d3c4786a4b9c71c0767aa656a759968f7554b6 (diff) |
btrfs: Do not use bio->bi_bdev after submission
The block layer modifies bio->bi_bdev and bio->bi_sector while working on
the bio, they do _not_ come back unmodified in the completion callback.
To call add_page, we need at least some bi_bdev set, which is why the code
was working, previously. With this patch, we use the latest_bdev from
fsinfo instead of the leftover in the bio. This gives us the possibility to
use the bi_bdev field for another purpose.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index efee8c7cfa45..936a6fabaa9f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1915,7 +1915,7 @@ static int btrfs_io_failed_hook(struct bio *failed_bio, | |||
1915 | bio->bi_private = state; | 1915 | bio->bi_private = state; |
1916 | bio->bi_end_io = failed_bio->bi_end_io; | 1916 | bio->bi_end_io = failed_bio->bi_end_io; |
1917 | bio->bi_sector = failrec->logical >> 9; | 1917 | bio->bi_sector = failrec->logical >> 9; |
1918 | bio->bi_bdev = failed_bio->bi_bdev; | 1918 | bio->bi_bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; |
1919 | bio->bi_size = 0; | 1919 | bio->bi_size = 0; |
1920 | 1920 | ||
1921 | bio_add_page(bio, page, failrec->len, start - page_offset(page)); | 1921 | bio_add_page(bio, page, failrec->len, start - page_offset(page)); |