From: Nanzhe Zhao <nzzhao@126.com>
To: Chao Yu <chao@kernel.org>, Barry Song <21cnbao@gmail.com>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to prevent clearing immutable for large folio supported inode
Date: Thu, 22 Jan 2026 10:02:00 +0800 [thread overview]
Message-ID: <83419982-77ba-4dac-880e-bf59669a006f@126.com> (raw)
In-Reply-To: <8c13ca69-a08a-41c7-bbef-0a79a5f44f93@kernel.org>
Hi all:
在 2026/1/9 16:44, Chao Yu via Linux-f2fs-devel 写道:
> w/ above locks, it seems there is still a race condition as below:
>
> f2fs_fileattr_set read
> - f2fs_setflags_common
> - truncate_pagecache
> - f2fs_read_data_large_folio
> : read large folios
> - mapping_set_folio_order_range
>
> Thanks,
I noticed that the comment for `mapping_set_folio_order_range()` says:
> "Context: This should not be called while the inode is active as it is non-atomic."
I'm not sure whether cases like f2fs_fileattr_set falls into the inode
active case.
>>
>>
>> If clearing immutable is indeed rare, we may leave this as is, since
>> writes are not supported until the page cache is fully dropped.
>> Eventually, we will support large folios on non-immutable files.
>>
>> Thanks
>> Barry
Also, I couldn’t find any API in `include/linux/pagemap.h` that can
atomically set the
folio order range. However, I think dynamically setting large folio
order while an inode
is active is a reasonable requirement. In my non immutable file large
folio write work, I need to enable large folio support for a file when
it is converted from an inline file to a non-inline file. The lack of an
atomic API seems to be a blocker for moving large folio write forward.
Any idea on that?
Thanks,
Nanzhe Zhao
next prev parent reply other threads:[~2026-01-22 2:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 2:47 Chao Yu
2026-01-09 3:05 ` Barry Song
2026-01-09 3:45 ` Chao Yu
2026-01-09 3:57 ` Barry Song
2026-01-09 8:44 ` Chao Yu
2026-01-22 2:02 ` Nanzhe Zhao [this message]
2026-01-22 23:10 ` [f2fs-dev] " Jaegeuk Kim
2026-01-23 6:30 ` Nanzhe Zhao
2026-02-24 3:55 ` Jaegeuk Kim
2026-01-23 4:04 ` Chao Yu
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=83419982-77ba-4dac-880e-bf59669a006f@126.com \
--to=nzzhao@126.com \
--cc=21cnbao@gmail.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®