From: Kent Overstreet <kent.overstreet@gmail.com>
To: Denis Bychkov <manover@gmail.com>
Cc: Vojtech Pavlik <vojtech@suse.com>,
linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org,
Emmanuel Florac <eflorac@intellique.com>,
Jiri Kosina <jkosina@suse.com>, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] bcache: Fix writeback_thread never writing back incomplete stripes.
Date: Thu, 17 Sep 2015 08:40:54 -0800 [thread overview]
Message-ID: <20150917164054.GA28032@kmo-pixel> (raw)
In-Reply-To: <CAO2mnowurDEfqaZZk6MLmCtTFJ4MkgGEG9DKYytwkDSv1W4dnQ@mail.gmail.com>
On Thu, Sep 17, 2015 at 11:30:17AM -0400, Denis Bychkov wrote:
> Well, it turns out my celebration was a bit premature.
>
> PLEASE, DO NOT APPLY THE PATCH POSTED BY KENT (not the one Vojtech
> posted) ON A PRODUCTION SYSTEM, IT CAUSES DATA CORRUPTION.
>
> The interesting thing is that it somehow damaged the partition that
> was not supposed to receive any writes (the file system was mounted
> read-only), so my guess is that the patch causes the blocks residing
> in the write-back cache to flush to the wrong blocks on the backing
> device.
> Everything was going great until I rebooted and saw this in the log:
>
> [ 19.639082] attempt to access beyond end of device
> [ 19.643984] md1p2: rw=1, want=75497520, limit=62914560
> [ 19.659033] attempt to access beyond end of device
> [ 19.663929] md1p2: rw=1, want=75497624, limit=62914560
> [ 19.669447] attempt to access beyond end of device
> [ 19.674338] md1p2: rw=1, want=75497752, limit=62914560
> [ 19.679195] attempt to access beyond end of device
> [ 19.679199] md1p2: rw=1, want=75498080, limit=62914560
> [ 19.689007] attempt to access beyond end of device
> [ 19.689011] md1p2: rw=1, want=75563376, limit=62914560
> [ 19.699055] attempt to access beyond end of device
> [ 19.699059] md1p2: rw=1, want=79691816, limit=62914560
> [ 19.719246] attempt to access beyond end of device
> [ 19.724144] md1p2: rw=1, want=79691928, limit=62914560
> ......
> (it's a small example, the list was much longer)
> And the next thing I found out the super block on my 10-Tb XFS RAID was gone. :)
> Oh well, it's a good thing I have backups.
> I knew what I was doing when trying the untested patches. I should
> have made the RAID md partition read-only, not the file system. I kind
> of expected that something could have gone wrong with the file system
> I was testing, just did not expect it would fire nukes at the innocent
> bystanders.
Aw, shit. That's just _bizzare_.
I have a theory - it appears that last_scanned isn't getting initialized before
it's used, so it's going to be all 0s the very first time... which it appears
could cause it to slurp up keys from the wrong device (and if that device was
bigger than the correct device, that could explain the accesses beyond the end
of the device).
Currently just a theory though, and I have no clue why it would only be exposed
with my patch.
next prev parent reply other threads:[~2015-09-17 16:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-05 11:10 [PATCH] bcache: Fix writeback_thread never writing back incomplete stripes Vojtech Pavlik
2015-09-16 11:32 ` Kent Overstreet
2015-09-16 21:08 ` Denis Bychkov
2015-09-17 15:30 ` Denis Bychkov
2015-09-17 16:40 ` Kent Overstreet [this message]
2015-09-17 18:31 ` Kent Overstreet
2015-09-17 20:54 ` Denis Bychkov
2015-09-19 4:47 ` Denis Bychkov
2015-10-01 9:01 ` Tim Small
2015-09-29 23:00 ` Peter Kieser
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=20150917164054.GA28032@kmo-pixel \
--to=kent.overstreet@gmail.com \
--cc=axboe@kernel.dk \
--cc=eflorac@intellique.com \
--cc=jkosina@suse.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manover@gmail.com \
--cc=vojtech@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).