From: liubaolin <liubaolin12138@163.com>
To: Ernest Borowski <ernest.borowski.git@proton.me>
Cc: linkinjeon@kernel.org, hyc.lee@gmail.com, ntfs@lists.linux.dev,
linux-kernel@vger.kernel.org, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v1 01/13] ntfs: limit writeback allocation to the dirty range
Date: Sat, 5 Dec 2026 18:29:50 +0800 [thread overview]
Message-ID: <4018ee2f-0e68-403e-9dfa-848429bc5671@163.com> (raw)
In-Reply-To: <179640993906.154108.3521906504217124720.b4-reply@b4>
在 2026/12/5 02:45, Ernest Borowski 写道:
> Hi Baolin,
>
> On Thu, Dec 03, 2026 at 12:03:40PM +0800, Baolin Liu wrote:
>> A buffered write into a hole reserves space before copying user data.
>> If the copy faults partway through, writeback can allocate the clean
>> remainder of the reservation because it maps up to allocated_size.
>> After fsync and cache eviction, reads can expose old disk contents
>> instead of zeros.
>
> Patch 13 of my delalloc series v5 [1] fixes the same bug in a different
> way: writeback maps up to the end of the dirty folios that follow the
> one being written, and zeroes a cluster larger than a page on the disk
> only when some of its folios below initialized_size are not dirty. I
> ran your patch, ported onto patches 1-12 of v5, through our reproducers
> on the current ntfs-next. It passes the same ones as patch 13
> (killed_short_write_wb, hole_fill_stale, stale_wb_race and the others).
>
> Mapping one dirty range at a time costs time with clusters larger than
> a page, because every new cluster is zeroed on the disk before its
> first folio is written. fsync() of 384 MiB written into new space, 3
> runs each, on a kernel without debug options:
>
> cluster size your patch patch 13 ntfs-next
> 512 B, 4 KiB 98-113 ms 111-140 ms 172-204 ms
> 64 KiB 242-260 ms 110-120 ms 170-177 ms
>
> Your patch also makes mkwrite_past_init pass, which patch 13 does not.
> That test stores through a shared mapping 2 MiB into a file whose
> initialized size is 4 KiB, and then reads the tail of the first cluster.
> Your patch zeroes the whole first cluster when the first 4 KiB are
> written back, so the tail happens to be zero. From reading the code, a
> cluster allocated another way, for example by fallocate(), would still
> show old data there; I have not tested that. Zhan's "ntfs: zero up to a
> page that a shared mapping makes writable" [2] fixes that case where it
> starts, when the write fault moves the initialized size.
>
> Would you be fine with dropping 1/13 from the large folio series and
> basing it on the delalloc series instead? I have not tested the large
> folio patches on top of v5.
>
> [1] https://lore.kernel.org/all/20261204-b4-ntfs-delalloc-fixes-v5-0-1cd0267df2cd@proton.me/
> [2] https://lore.kernel.org/all/20261201125126.1651071-1-zhanxusheng1024@gmail.com/
>
> Thanks,
> Ernest
Hi Ernest,
Thanks for checking this and testing my patch.
I ran into these issues while developing and testing the large folio
series against ntfs-next as it stood at the time.
I should have checked for overlap with your delalloc series before
posting. Sorry about that.
After going through both series again, I see that my patches 1 and 5
address the same issues as patches 13 and 4, respectively, of your v5
series.
I'm happy to drop those two patches and build on your fixes.
I'll hold off on posting v2 until your series lands in ntfs-next,
then rebase the remaining patches and rerun the tests before sending it.
Thanks again for your help. You've done a really thorough job with
these fixes, and I appreciate the time you've taken to check my changes too.
Thanks,
Baolin.
next prev parent reply other threads:[~2026-12-05 10:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 4:03 [PATCH v1 00/13] ntfs: add large folio support for ordinary files Baolin Liu
2026-12-03 4:03 ` [PATCH v1 01/13] ntfs: limit writeback allocation to the dirty range Baolin Liu
2026-12-04 18:45 ` Ernest Borowski
2026-12-05 10:29 ` liubaolin [this message]
2026-12-03 4:03 ` [PATCH v1 02/13] ntfs: read compression units without the block device page cache Baolin Liu
2026-12-03 4:03 ` [PATCH v1 03/13] ntfs: snapshot resident data for direct reads Baolin Liu
2026-12-03 4:03 ` [PATCH v1 04/13] ntfs: allow vmalloc for large runlist backups Baolin Liu
2026-12-03 4:03 ` [PATCH v1 05/13] ntfs: preserve delalloc reservations when allocating holes Baolin Liu
2026-12-03 4:03 ` [PATCH v1 06/13] ntfs: serialize delalloc reservations with cluster allocation Baolin Liu
2026-12-03 4:03 ` [PATCH v1 07/13] ntfs: respect space reservations when writing compressed data Baolin Liu
2026-12-03 4:03 ` [PATCH v1 08/13] ntfs: keep space for MFT growth during delayed allocation Baolin Liu
2026-12-03 4:03 ` [PATCH v1 09/13] ntfs: serialize compression changes with file access Baolin Liu
2026-12-03 4:03 ` [PATCH v1 10/13] ntfs: complete compressed reads at folio granularity Baolin Liu
2026-12-03 4:03 ` [PATCH v1 11/13] ntfs: stop compressed reads at EOF within a base page Baolin Liu
2026-12-03 4:03 ` [PATCH v1 12/13] ntfs: preserve large folios during compressed writes Baolin Liu
2026-12-03 4:03 ` [PATCH v1 13/13] ntfs: enable large folios for ordinary files Baolin Liu
2026-12-03 4:23 ` [PATCH v1 00/13] ntfs: add large folio support " liubaolin
2026-12-03 5:30 ` Namjae Jeon
2026-12-03 10:10 ` liubaolin
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=4018ee2f-0e68-403e-9dfa-848429bc5671@163.com \
--to=liubaolin12138@163.com \
--cc=ernest.borowski.git@proton.me \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liubaolin@kylinos.cn \
--cc=ntfs@lists.linux.dev \
/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®