From: Ernest Borowski <ernest.borowski.git@proton.me>
To: liubaolin <liubaolin12138@163.com>
Cc: ernest.borowski.git@proton.me,
Namjae Jeon <linkinjeon@kernel.org>,
Hyunchul Lee <hyc.lee@gmail.com>,
Christian Brauner <brauner@kernel.org>,
Christoph Hellwig <hch@lst.de>,
"Darrick J. Wong" <djwong@kernel.org>,
ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhan Xusheng <zhanxusheng1024@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 10/11] ntfs: zero the rest of a new cluster after a short buffered write
Date: Tue, 01 Dec 2026 17:42:26 +0000 [thread overview]
Message-ID: <179614694023.3867606.441277987058381329.b4-reply@b4> (raw)
In-Reply-To: <7bba2d49-ef11-4fe8-b949-1f396c3207b0@163.com>
On Tue, Dec 01, 2026 at 10:26:49AM +0800, Baolin Liu wrote:
> Could we also call mapping_set_error(inode->i_mapping, err) here?
> The write can still return a positive short count when the tail
> zeroing fails, and ntfs_file_fsync() doesn't check NVolErrors, so a
> subsequent fsync() could succeed without reporting this error.
Yes, thank you. ntfs_file_fsync() ignores NVolErrors() and sees only
the errors that file_write_and_wait_range() returns, so fsync() returned
0 after a failed zeroing. v4 records the error in the mapping:
if (err) {
ntfs_error(vol->sb,
"Failed to zero [%lld, %lld) of inode 0x%llx after a short write: %d",
start, end, NTFS_I(inode)->mft_no, err);
NVolSetErrors(vol);
/* the write returns the bytes copied; let fsync() see it */
mapping_set_error(inode->i_mapping, err);
}
fsync() then returns that error instead of 0.
A new test checks this [1]. It does a short buffered write into a
hole, uses fail-nth to inject a failure at each fault site of that
write, and checks fsync() whenever the zeroing fails. The zeroing
failed 33 times, with 16 KiB and 64 KiB clusters on Ubuntu and Arch.
After each of them fsync() returned 0 on v3, and it fails with ENOMEM
on v4.
v4 also drops this patch's own copy of ntfs_zero_range_unkillable().
Now that Zhan's short write fix is in ntfs-next, the patch uses the
copy in file.c instead. It also adds the lockdep check of the
invalidate lock that its own copy had, as both callers hold the lock.
[1] https://github.com/xerrni/linux-ntfs/blob/master/tests/delalloc_tail_zero_failure.sh
next prev parent reply other threads:[~2026-12-01 17:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 12:58 [PATCH v3 00/11] ntfs: delayed allocation accounting and stale data fixes, part 1 Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 01/11] iomap: punch out a run of clean blocks in one call Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 02/11] iomap: add a helper to mark a range of a folio dirty Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 03/11] ntfs: release delalloc reservations cut off by truncate Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 04/11] ntfs: do not consume delalloc reservations when filling holes Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 05/11] ntfs: keep delalloc reservations when a cluster allocation fails Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 06/11] ntfs: release the delalloc reservations of an evicted inode Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 07/11] ntfs: do not shift the cluster number of a delalloc run on split Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 08/11] ntfs: punch out the delalloc reservation of a failed buffered write Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 09/11] ntfs: zero new delalloc clusters even when writeback allocates them Ernest Borowski via B4 Relay
2026-11-30 12:58 ` [PATCH v3 10/11] ntfs: zero the rest of a new cluster after a short buffered write Ernest Borowski via B4 Relay
2026-12-01 2:26 ` liubaolin
2026-12-01 17:42 ` Ernest Borowski [this message]
2026-11-30 12:58 ` [PATCH v3 11/11] ntfs: revalidate a buffered write's mapping after its clusters were allocated Ernest Borowski via B4 Relay
2026-12-04 9:35 ` [PATCH v3 00/11] ntfs: delayed allocation accounting and stale data fixes, part 1 Christoph Hellwig
2026-12-04 9:35 ` Christoph Hellwig
2026-12-04 18:14 ` Ernest Borowski
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=179614694023.3867606.441277987058381329.b4-reply@b4 \
--to=ernest.borowski.git@proton.me \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=liubaolin12138@163.com \
--cc=ntfs@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=zhanxusheng1024@gmail.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®