summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-04-16 09:42:26 -0400
committerDavid Sterba <dsterba@suse.cz>2012-04-18 19:22:30 +0200
commit5cf1ab56133ad7b712673c071b439d4a555a2d1e (patch)
treec7b301296750707f47487f508398f1baec81f48b /fs/btrfs/inode.c
parent48d282326b3ce5f435835f5fb0e3231c399f4f9a (diff)
downloadlwn-5cf1ab56133ad7b712673c071b439d4a555a2d1e.tar.gz
lwn-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/inode.c')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 98ee5a51aa29..d953f8820464 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1947,7 +1947,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
* extent_io.c will try to find good copies for us.
*/
static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
- struct extent_state *state)
+ struct extent_state *state, int mirror)
{
size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT);
struct inode *inode = page->mapping->host;