From: Omar Sandoval <osandov@osandov.com>
To: Christoph Anton Mitterer <calestyo@scientia.org>
Cc: Linux BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs: fix space cache corruption and potential double allocations
Date: Wed, 17 Aug 2022 17:30:27 -0700 [thread overview]
Message-ID: <Yv2IIwNQBb3ivK7D@relinquished.localdomain> (raw)
In-Reply-To: <b5d37d4d059e220313341d2804cbf1daf2956563.camel@scientia.org>
On Thu, Aug 18, 2022 at 02:22:00AM +0200, Christoph Anton Mitterer wrote:
> On Wed, 2022-08-17 at 16:59 -0700, Omar Sandoval wrote:
> > I'm working on a tool that can be run on a mounted filesystem to
> > detect
> > most of the corruptions that could result from this bug. I'll share
> > that
> > in the next couple of days.
>
> That sounds quite good.
>
> Maybe such thing should find it's way into btrfs-progs.
>
> I remember back then whether there were some corruption issues that
> occurred with holes in compressed files, there were also some ways to
> search for files which may have been affected.
>
> So I mean such things wouldn't be the day2day tools of btrfs-progs, but
> could be helpful to those who'd like to investigate more... and having
> it as part of btrfs-progrs would make them much more accessible to end-
> users (no need to search for it, no need to compile it, no need to
> trust their author (well at least not more than they anyway need to
> trust btrfs-progs)).
>
>
> >
> > From what I've found, it's much more likely to happen if you delete a
> > lot of data soon after boot with space_cache=v2/nospace_cache and
> > discard/discard=sync. I can't say that it'd never happen outside of
> > those conditions, but I suspect that it's much harder to hit
> > otherwise.
>
> Okay, but deletion *is* necessary, right?
Yes, but metadata deletions also count, so basically any modification
results in a deletion. We haven't seen this in practice, but I couldn't
find anything that would make it impossible.
In place modifications of files also result in COW and deletion of the
old data, so that also technically counts.
next prev parent reply other threads:[~2022-08-18 0:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-16 23:12 [PATCH 0/2] btrfs: fix filesystem corruption caused by space cache race Omar Sandoval
2022-08-16 23:12 ` [PATCH 1/2] btrfs: fix space cache corruption and potential double allocations Omar Sandoval
2022-08-17 6:21 ` Andrea Gelmini
2022-08-17 16:53 ` Christoph Anton Mitterer
2022-08-17 23:59 ` Omar Sandoval
2022-08-18 0:22 ` Christoph Anton Mitterer
2022-08-18 0:30 ` Omar Sandoval [this message]
2022-08-19 0:16 ` Christoph Anton Mitterer
2022-09-01 16:59 ` Christoph Anton Mitterer
2022-09-01 18:18 ` Omar Sandoval
2022-09-01 18:52 ` Holger Hoffstätte
2022-09-01 18:57 ` Omar Sandoval
2022-09-02 15:43 ` Christoph Anton Mitterer
2022-09-02 21:25 ` Christoph Anton Mitterer
2022-08-18 6:21 ` Andrea Gelmini
2022-08-18 6:40 ` Omar Sandoval
2022-08-17 9:47 ` Filipe Manana
2022-08-17 15:32 ` Omar Sandoval
2022-08-17 15:46 ` Filipe Manana
2022-08-22 13:26 ` David Sterba
2022-08-16 23:12 ` [PATCH 2/2] btrfs: get rid of block group caching progress logic Omar Sandoval
2022-08-17 9:47 ` Filipe Manana
2025-02-20 19:26 ` Alex Lyakas
2025-02-20 21:59 ` Omar Sandoval
2025-02-23 11:31 ` Alex Lyakas
2022-08-22 13:36 ` [PATCH 0/2] btrfs: fix filesystem corruption caused by space cache race David Sterba
2022-08-23 17:27 ` David Sterba
2022-08-23 19:20 ` Christoph Anton Mitterer
2022-08-23 20:29 ` David Sterba
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=Yv2IIwNQBb3ivK7D@relinquished.localdomain \
--to=osandov@osandov.com \
--cc=calestyo@scientia.org \
--cc=linux-btrfs@vger.kernel.org \
/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