From: Matthew Wilcox <willy@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>, Baokun Li <libaokun1@huawei.com>,
linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca,
ritesh.list@gmail.com, linux-kernel@vger.kernel.org,
jun.nie@linaro.org, ebiggers@kernel.org, yi.zhang@huawei.com,
yangerkun@huawei.com, yukuai3@huawei.com,
syzbot+a158d886ca08a3fecca4@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2] ext4: fix race condition between buffer write and page_mkwrite
Date: Mon, 5 Jun 2023 15:55:35 +0100 [thread overview]
Message-ID: <ZH33ZzwyLFY48tfA@casper.infradead.org> (raw)
In-Reply-To: <20230605122141.4njwwx3mrapqhvt4@quack3>
On Mon, Jun 05, 2023 at 02:21:41PM +0200, Jan Kara wrote:
> On Mon 05-06-23 11:16:55, Jan Kara wrote:
> > Yeah, I agree, that is also the conclusion I have arrived at when thinking
> > about this problem now. We should be able to just remove the conversion
> > from ext4_page_mkwrite() and rely on write(2) or truncate(2) doing it when
> > growing i_size.
>
> OK, thinking more about this and searching through the history, I've
> realized why the conversion is originally in ext4_page_mkwrite(). The
> problem is described in commit 7b4cc9787fe35b ("ext4: evict inline data
> when writing to memory map") but essentially it boils down to the fact that
> ext4 writeback code does not expect dirty page for a file with inline data
> because ext4_write_inline_data_end() should have copied the data into the
> inode and cleared the folio's dirty flag.
>
> Indeed messing with xattrs from the writeback path to copy page contents
> into inline data xattr would be ... interesting. Hum, out of good ideas for
> now :-|.
Is it so bad? Now that we don't have writepage in ext4, only
writepages, it seems like we have a considerably more benign locking
environment to work in.
next prev parent reply other threads:[~2023-06-05 14:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 13:44 [PATCH v2] ext4: fix race condition between buffer write and page_mkwrite Baokun Li
2023-05-31 13:15 ` Jan Kara
2023-06-04 3:04 ` Theodore Ts'o
2023-06-04 21:08 ` Theodore Ts'o
2023-06-05 1:58 ` Matthew Wilcox
2023-06-05 9:16 ` Jan Kara
2023-06-05 12:21 ` Jan Kara
2023-06-05 14:55 ` Matthew Wilcox [this message]
2023-06-05 15:08 ` Jan Kara
2023-06-06 12:19 ` Baokun Li
2024-04-15 4:28 ` Baokun Li
2024-04-15 12:34 ` Jan Kara
2024-04-15 14:07 ` Baokun Li
2023-06-05 2:17 ` Baokun Li
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=ZH33ZzwyLFY48tfA@casper.infradead.org \
--to=willy@infradead.org \
--cc=adilger.kernel@dilger.ca \
--cc=ebiggers@kernel.org \
--cc=jack@suse.cz \
--cc=jun.nie@linaro.org \
--cc=libaokun1@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ritesh.list@gmail.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+a158d886ca08a3fecca4@syzkaller.appspotmail.com \
--cc=tytso@mit.edu \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.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