From: Chi Zhiling <chizhiling@163.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: exfat@lists.linux.dev, linux-kernel@vger.kernel.org,
Yuezhang.Mo@sony.com, chenxiaosong@chenxiaosong.com,
dxdt@dev.snart.me, hyc.lee@gmail.com, liubaolin12138@163.com,
sj1557.seo@samsung.com, Chi Zhiling <chizhiling@kylinos.cn>
Subject: Re: [PATCH v1 0/5] exfat: fix valid_size handling and locking
Date: Sat, 3 Oct 2026 09:11:03 +0800 [thread overview]
Message-ID: <59056131-e3bd-4003-8c30-0a356cf0bd82@163.com> (raw)
In-Reply-To: <CAKYAXd9Z7opATEpHtyTp+cbzsYS_+Ym621fBHHbY1OZw=Hzt2w@mail.gmail.com>
On 10/3/26 7:42 AM, Namjae Jeon wrote:
> On Thu, Oct 1, 2026 at 11:53 AM Chi Zhiling <chizhiling@163.com> wrote:
>>
>> On 9/30/26 6:01 PM, Namjae Jeon wrote:
>>> On Sun, Sep 27, 2026 at 5:04 PM Chi Zhiling <chizhiling@163.com> wrote:
>>>>
>>>> From: Chi Zhiling <chizhiling@kylinos.cn>
>>>>
>>>> valid_size marks the on-disk up-to-date region of an exFAT file. It is
>>>> advanced from the write path, from read/zeroing completion, and via
>>>> truncate, while it is read without i_rwsem from ->iomap_begin and from bio
>>>> completion context. This series fixes several races and stale-data windows
>>>> that follow from that split ownership.
>>>>
>>>> Patches 1-2 are self-contained fixes: an append write may be moved to EOF
>>>> by generic_write_checks(), so valid_size must be advanced using the
>>>> recalculated position; and exfat_zero_new_range() must mark non-uptodate
>>>> pages dirty so the whole page is written back.
>>>>
>>>> Patches 3-4 are prerequisites for patch 5: truncate now holds the
>>>> invalidate lock so it is mutually exclusive with mmap writes, and
>>>> valid_size/zeroed_size become atomic so they can be read safely outside
>>>> i_rwsem. Patch 5 then takes exfat_page_mkwrite() out from under i_rwsem,
>>>> since blocking on the inode lock under mmap_lock could deadlock and its
>>>> VM_FAULT_RETRY result is not honored, and advances valid_size under the
>>>> folio lock to keep the page cache and valid_size consistent.
>>>>
>>>> Link: https://lore.kernel.org/exfat/10029d6f-13cc-4d17-a2f9-b093a8339dde@163.com/T/#t
>>>>
>>>> Chi Zhiling (5):
>>>> exfat: advance valid_size to EOF for append writes
>>>> exfat: dirty all new pages when extending valid_size
>>>> exfat: hold the invalidate lock while truncating
>>>> exfat: make valid_size and zeroed_size atomic
>>>> exfat: use folio lock to protect valid_size
>>> Could you check the review comments from Sashiko ?
>>>
>>> https://sashiko.dev/#/patchset/20260927080305.831641-1-chizhiling%40163.com
>>
>> Okay, I’ll take a close look at this review comment.
>>
>> I also noticed that the comment mentions that concurrent DIO and page
>> faults may lead to data corruption. I believe this is a long-standing
>> issue, and I don’t currently have a good way to fix it.
> Okay, I'll take a look at that. Will you send v2 patchset soon?
> Thanks!
Okay
prev parent reply other threads:[~2026-10-03 1:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 8:02 Chi Zhiling
2026-09-27 8:03 ` [PATCH v1 1/5] exfat: advance valid_size to EOF for append writes Chi Zhiling
2026-09-27 8:03 ` [PATCH v1 2/5] exfat: dirty all new pages when extending valid_size Chi Zhiling
2026-09-29 10:26 ` Yuezhang.Mo
2026-09-30 6:16 ` Chi Zhiling
2026-09-30 7:26 ` Chi Zhiling
2026-09-27 8:03 ` [PATCH v1 3/5] exfat: hold the invalidate lock while truncating Chi Zhiling
2026-09-27 8:03 ` [PATCH v1 4/5] exfat: make valid_size and zeroed_size atomic Chi Zhiling
2026-09-27 8:03 ` [PATCH v1 5/5] exfat: use folio lock to protect valid_size Chi Zhiling
2026-09-30 10:01 ` [PATCH v1 0/5] exfat: fix valid_size handling and locking Namjae Jeon
2026-10-01 2:52 ` Chi Zhiling
2026-10-02 23:42 ` Namjae Jeon
2026-10-03 1:11 ` Chi Zhiling [this message]
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=59056131-e3bd-4003-8c30-0a356cf0bd82@163.com \
--to=chizhiling@163.com \
--cc=Yuezhang.Mo@sony.com \
--cc=chenxiaosong@chenxiaosong.com \
--cc=chizhiling@kylinos.cn \
--cc=dxdt@dev.snart.me \
--cc=exfat@lists.linux.dev \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liubaolin12138@163.com \
--cc=sj1557.seo@samsung.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
all inboxes | Powered by JetHome®