From: Greg KH <gregkh@linuxfoundation.org>
To: Nikolay Borisov <nborisov@suse.com>
Cc: stable@vger.kernel.org, dsterba@suse.com, wqu@suse.com
Subject: Re: [PATCH] btrfs: Always try all copies when reading extent buffers
Date: Thu, 6 Dec 2018 11:48:16 +0100 [thread overview]
Message-ID: <20181206104816.GF19891@kroah.com> (raw)
In-Reply-To: <20181204124818.31216-1-nborisov@suse.com>
On Tue, Dec 04, 2018 at 02:48:18PM +0200, Nikolay Borisov wrote:
> When a metadata read is served the endio routine btree_readpage_end_io_hook
> is called which eventually runs the tree-checker. If tree-checker fails
> to validate the read eb then it sets EXTENT_BUFFER_CORRUPT flag. This
> leads to btree_read_extent_buffer_pages wrongly assuming that all
> available copies of this extent buffer are wrong and failing prematurely.
> Fix this modify btree_read_extent_buffer_pages to read all copies of
> the data.
>
> This failure was exhibitted in xfstests btrfs/124 which would
> spuriously fail its balance operations. The reason was that when balance
> was run following re-introduction of the missing raid1 disk
> __btrfs_map_block would map the read request to stripe 0, which
> corresponded to devid 2 (the disk which is being removed in the test):
>
> item 2 key (FIRST_CHUNK_TREE CHUNK_ITEM 3553624064) itemoff 15975 itemsize 112
> length 1073741824 owner 2 stripe_len 65536 type DATA|RAID1
> io_align 65536 io_width 65536 sector_size 4096
> num_stripes 2 sub_stripes 1
> stripe 0 devid 2 offset 2156920832
> dev_uuid 8466c350-ed0c-4c3b-b17d-6379b445d5c8
> stripe 1 devid 1 offset 3553624064
> dev_uuid 1265d8db-5596-477e-af03-df08eb38d2ca
>
> This caused read requests for a checksum item that to be routed to the
> stale disk which triggered the aforementioned logic involving
> EXTENT_BUFFER_CORRUPT flag. This then triggered cascading failures of
> the balance operation.
>
> Fixes: a826d6dcb32d ("Btrfs: check items for correctness as we search")
> CC: stable@vger.kernel.org # 4.4+
> Suggested-by: Qu Wenruo <wqu@suse.com>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> Hi Gregk,
>
> Please apply this backport of upstream commit f8397d69daef06d358430d3054662fb597e37c00
> to 4.9.y
I think this was the 4.14.y version of the patch :(
I took the 4.4.y version and fixed it up by hand...
greg k-h
next prev parent reply other threads:[~2018-12-06 10:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 10:02 FAILED: patch "[PATCH] btrfs: Always try all copies when reading extent buffers" failed to apply to 4.9-stable tree gregkh
2018-12-04 12:48 ` [PATCH] btrfs: Always try all copies when reading extent buffers Nikolay Borisov
2018-12-06 10:45 ` Greg KH
2018-12-06 10:48 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-12-03 10:02 FAILED: patch "[PATCH] btrfs: Always try all copies when reading extent buffers" failed to apply to 4.4-stable tree gregkh
2018-12-04 12:49 ` [PATCH] btrfs: Always try all copies when reading extent buffers Nikolay Borisov
2018-12-06 10:47 ` Greg KH
2018-12-03 10:02 FAILED: patch "[PATCH] btrfs: Always try all copies when reading extent buffers" failed to apply to 4.14-stable tree gregkh
2018-12-04 12:47 ` [PATCH] btrfs: Always try all copies when reading extent buffers Nikolay Borisov
2018-12-06 10:47 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181206104816.GF19891@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dsterba@suse.com \
--cc=nborisov@suse.com \
--cc=stable@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).