diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2014-08-19 23:33:13 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-05 16:34:16 -0700 |
commit | a848c23fb1e59ddcde23b7715b08ad8bfef78ee0 (patch) | |
tree | 88c9c5505afb9fd32b65c5b495f26cb2b192bdf8 /fs | |
parent | bd7c57d3ca1a55a601c9f9e2d3b0fe8be197ea8e (diff) | |
download | renesas_kernel-a848c23fb1e59ddcde23b7715b08ad8bfef78ee0.tar.gz renesas_kernel-a848c23fb1e59ddcde23b7715b08ad8bfef78ee0.tar.bz2 renesas_kernel-a848c23fb1e59ddcde23b7715b08ad8bfef78ee0.zip |
Btrfs: fix crash on endio of reading corrupted block
commit 38c1c2e44bacb37efd68b90b3f70386a8ee370ee upstream.
The crash is
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent_io.c:2124!
[...]
Workqueue: btrfs-endio normal_work_helper [btrfs]
RIP: 0010:[<ffffffffa02d6055>] [<ffffffffa02d6055>] end_bio_extent_readpage+0xb45/0xcd0 [btrfs]
This is in fact a regression.
It is because we forgot to increase @offset properly in reading corrupted block,
so that the @offset remains, and this leads to checksum errors while reading
left blocks queued up in the same bio, and then ends up with hiting the above
BUG_ON.
Reported-by: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2eea43f5067..1a858947006 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2525,6 +2525,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) test_bit(BIO_UPTODATE, &bio->bi_flags); if (err) uptodate = 0; + offset += len; continue; } } |