From: "John Stoffel" <john@stoffel.org>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-bcachefs@vger.kernel.org, linux-block@vger.kernel.org,
Roland Vet <vet.roland@protonmail.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 00/14] better handling of checksum errors/bitrot
Date: Mon, 17 Mar 2025 16:55:24 -0400 [thread overview]
Message-ID: <26584.35900.850011.320586@quad.stoffel.home> (raw)
In-Reply-To: <20250311201518.3573009-1-kent.overstreet@linux.dev>
>>>>> "Kent" == Kent Overstreet <kent.overstreet@linux.dev> writes:
> Roland Vet spotted a good one: currently, rebalance/copygc get stuck if
> we've got an extent that can't be read, due to checksum error/bitrot.
> This took some doing to fix properly, because
> - We don't want to just delete such data (replace it with
> KEY_TYPE_error); we never want to delete anything except when
> explicitly told to by the user, and while we don't yet have an API for
> "read this file even though there's errors, just give me what you
> have" we definitely will in the future.
So will open() just return an error? How will this look from
userspace?
> - Not being able to move data is a non-option: that would block copygc,
> device removal, etc.
> - And, moving said extent requires giving it a new checksum - strictly
> required if the move has to fragment it, teaching the write/move path
> about extents with bad checksums is unpalateable, and anyways we'd
> like to be able to guard against more bitrot, if we can.
Why does it need a new checksum if there are read errors? What
happens if there are more read errors? If I have a file on a
filesystem which is based in spinning rust and I get a single bit
flip, I'm super happy you catch it.
But now you re-checksum the file, with the read error, and return it?
I'm stupid and just a user/IT guy. I want notifications, but I don't
want my application to block so I can't kill it, or unmount the
filesystem. Or continue to use it if I like.
> So that means:
> - Extents need a poison bit: "reads return errors, even though it now
> has a good checksum" - this was added in a separate patch queued up
> for 6.15.
Sorry for being dense, but does a file have one or more extents? Or
is this at a level below that?
> It's an incompat feature because it's a new extent field, and old
> versions can't parse extents with unknown field types, since they
> won't know their sizes - meaning users will have to explicitly do an
> incompat upgrade to make use of this stuff.
> - The read path needs to do additional retries after checksum errors
> before giving up and marking it poisoned, so that we don't
> accidentally convert a transient error to permanent corruption.
When doing these retries, is the filesystem locked up or will the
process doing the read() be blocked from being killed?
> - The read path gets a whole bunch of work to plumb precise modern error
> codes around, so that e.g. the retry path, the data move path, and the
> "mark extent poisoned" path all know exactly what's going on.
> - Read path is responsible for marking extents poisoned after sufficient
> retry attempts (controlled by a new filesystem option)
> - Data move path is allowed to move extents after a read error, if it's
> a checksum error (giving it a new checksum) if it's been poisoned
> (i.e. the extent flags feature is enabled).
So if just a single bit flips, the extent gets moved onto better
storage, and the file gets re-checksummed. But what about if more
bits go bad afterwards?
> Code should be more or less finalized - still have more tests for corner
> cases to write, but "write corrupt data and then tell rebalance to move
> it to another device" works as expected.
> TODO:
> - NVME has a "read recovery level" attribute that controlls how hard the
> erasure coding algorithms work - we want that plumbed.
> Before we give up and move data that we know is bad, we need to try
> _as hard as possible_ to get a successful read.
What does this mean exactly in terms of end user and SysAdmin point of
view? Locking up the system (no new writes to the now problematic
storage) that I can't kill would be annoyingly painful.
Don't get me wrong, I'm happy to see data integrity stuff get added,
I'm just trying to understand how it interacts with userspace.
John
next prev parent reply other threads:[~2025-03-17 21:04 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 20:15 [PATCH 00/14] better handling of checksum errors/bitrot Kent Overstreet
2025-03-11 20:15 ` [PATCH 13/14] block: Allow REQ_FUA|REQ_READ Kent Overstreet
2025-03-15 16:47 ` Jens Axboe
2025-03-15 17:01 ` Kent Overstreet
2025-03-15 17:03 ` Jens Axboe
2025-03-15 17:27 ` Kent Overstreet
2025-03-15 17:43 ` Jens Axboe
2025-03-15 18:07 ` Kent Overstreet
2025-03-15 18:32 ` Jens Axboe
2025-03-15 18:41 ` Kent Overstreet
2025-03-17 6:00 ` Christoph Hellwig
2025-03-17 12:15 ` Kent Overstreet
2025-03-17 14:13 ` Keith Busch
2025-03-17 14:49 ` Kent Overstreet
2025-03-17 15:15 ` Keith Busch
2025-03-17 15:22 ` Kent Overstreet
2025-03-17 15:30 ` Martin K. Petersen
2025-03-17 15:43 ` Kent Overstreet
2025-03-17 17:57 ` Martin K. Petersen
2025-03-17 18:21 ` Kent Overstreet
2025-03-17 19:24 ` Keith Busch
2025-03-17 19:40 ` Kent Overstreet
2025-03-17 20:39 ` Keith Busch
2025-03-17 21:13 ` Bart Van Assche
2025-03-18 1:06 ` Kent Overstreet
2025-03-18 6:16 ` Christoph Hellwig
2025-03-18 17:49 ` Bart Van Assche
2025-03-18 18:00 ` Kent Overstreet
2025-03-18 18:10 ` Keith Busch
2025-03-18 18:13 ` Kent Overstreet
2025-03-20 5:40 ` Christoph Hellwig
2025-03-20 10:28 ` Kent Overstreet
2025-03-18 0:27 ` Kent Overstreet
2025-03-18 6:11 ` Christoph Hellwig
2025-03-18 21:33 ` Kent Overstreet
2025-03-17 17:32 ` Keith Busch
2025-03-18 6:19 ` Christoph Hellwig
2025-03-18 6:01 ` Christoph Hellwig
2025-03-17 20:55 ` John Stoffel [this message]
2025-03-18 1:15 ` [PATCH 00/14] better handling of checksum errors/bitrot Kent Overstreet
2025-03-18 14:47 ` John Stoffel
2025-03-20 17:15 ` Kent Overstreet
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=26584.35900.850011.320586@quad.stoffel.home \
--to=john@stoffel.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=vet.roland@protonmail.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