From: Matthew Wilcox <willy@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-fsdevel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: The proper handling of failed IO error?
Date: Mon, 10 Jun 2024 04:49:39 +0100 [thread overview]
Message-ID: <ZmZ3001_gcjAryte@casper.infradead.org> (raw)
In-Reply-To: <960aa841-8d7c-413f-9a1b-0364ae3b9493@gmx.com>
On Mon, Jun 10, 2024 at 06:50:11AM +0930, Qu Wenruo wrote:
> Hi,
>
> There is a recent (well a year ago) change in btrfs to remove the usage
> of page/folio error, which gets me wondering what would happen if we got
> a lot of write errors and high memory pressure?
>
> Yes, all file systems calls mapping_set_error() so that fsync call would
> return error, but I'm wondering what would happen to those folios that
> failed to be written?
>
> Those folios has their DIRTY flag cleared before submission, and and
> their endio functions, the WRITEBACK flags is also cleared.
>
> Meaning after such write failure, the page/folio has UPTODATE flag, and
> no DIRTY/ERROR/WRITEBACK flags (at least for btrfs and ext4, meanwhile
> iomap still set the ERROR flag).
>
> Would any memory pressure just reclaim those pages/folios without them
> really reaching the disk?
Yes.
Core code doesn't (and hasn't in some time) checked the page/folio
error flag. That's why it's being removed.
Also, btrfs was using it incorrectly to indicate a write error.
It was supposed to be used for read errors, not write errors.
Another good reason to remove it.
next parent reply other threads:[~2024-06-10 3:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <960aa841-8d7c-413f-9a1b-0364ae3b9493@gmx.com>
2024-06-10 3:49 ` Matthew Wilcox [this message]
2024-06-10 5:24 ` Qu Wenruo
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=ZmZ3001_gcjAryte@casper.infradead.org \
--to=willy@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=quwenruo.btrfs@gmx.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