]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: Do not use bio->bi_bdev after submission
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Thu, 16 Jun 2011 12:37:03 +0000 (14:37 +0200)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 01:33:56 +0000 (20:33 -0500)
commit836b57b3b360498cfadf55b06cbd9be2d9c1a105
tree0e098979c6eb912741ecdde3251ec6fedf18ac47
parent78482bea6144431db1dfa7fae9e8a4e392221dcf
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>
(cherry picked from commit 1503140d3ec2be9b917d2f8f7c64cb77b79a215b)
fs/btrfs/inode.c