diff options
author | Josef Bacik <josef@redhat.com> | 2012-04-16 09:42:26 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-04-18 19:22:30 +0200 |
commit | 5cf1ab56133ad7b712673c071b439d4a555a2d1e (patch) | |
tree | c7b301296750707f47487f508398f1baec81f48b /fs/btrfs/extent_io.h | |
parent | 48d282326b3ce5f435835f5fb0e3231c399f4f9a (diff) | |
download | linux-5cf1ab56133ad7b712673c071b439d4a555a2d1e.tar.gz linux-5cf1ab56133ad7b712673c071b439d4a555a2d1e.tar.bz2 linux-5cf1ab56133ad7b712673c071b439d4a555a2d1e.zip |
Btrfs: always store the mirror we read the eb from
A user reported a panic where we were trying to fix a bad mirror but the
mirror number we were giving was 0, which is invalid. This is because we
don't do the transid verification until after the read, so as far as the
read code is concerned the read was a success. So instead store the mirror
we read from so that if there is some failure post read we know which mirror
to try next and which mirror needs to be fixed if we find a good copy of the
block. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index faf10eb57f75..b516c3b8dec6 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -79,7 +79,7 @@ struct extent_io_ops { u64 start, u64 end, struct extent_state *state); int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end, - struct extent_state *state); + struct extent_state *state, int mirror); int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, struct extent_state *state, int uptodate); void (*set_bit_hook)(struct inode *inode, struct extent_state *state, @@ -135,7 +135,7 @@ struct extent_buffer { spinlock_t refs_lock; atomic_t refs; atomic_t io_pages; - int failed_mirror; + int read_mirror; struct list_head leak_list; struct rcu_head rcu_head; pid_t lock_owner; |