* FAILED: patch "[PATCH] fuse: clear the old EOF tail before writeback-cache writes" failed to apply to 6.6-stable tree
@ 2026-12-02 13:03 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-12-02 13:03 UTC (permalink / raw)
To: dennylin0707, mszeredi; +Cc: stable
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x d9013d15b9379b323f1bcdfff7e7d96df537268a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026120207-occupant-screen-0076@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From d9013d15b9379b323f1bcdfff7e7d96df537268a Mon Sep 17 00:00:00 2001
From: Hungyu Lin <dennylin0707@gmail.com>
Date: Tue, 3 Nov 2026 08:34:25 +0000
Subject: [PATCH] fuse: clear the old EOF tail before writeback-cache writes
Buffered writeback-cache writes go through iomap_file_buffered_write(),
but do not clear cached data between the old EOF and the write position.
If a shared mapping dirtied the tail of the old EOF page, an extending
write can expose those bytes as file contents instead of zeros. A later
writeback can also send them to the server.
Clear the gap under the existing inode lock before the buffered write.
Use the same page-cache cleanup as fuse_perform_write() does for
write-through writes, leaving the write range itself untouched.
Fixes: 4d99ff8f12eb ("fuse: Turn writeback cache on")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index dcf333aaec17..9e64fe040277 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1580,6 +1580,11 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from)
written = direct_write_fallback(iocb, from, written,
fuse_perform_write(iocb, from));
} else if (writeback) {
+ loff_t old_size = i_size_read(inode);
+
+ if (iocb->ki_pos > old_size)
+ truncate_pagecache_range(inode, old_size, iocb->ki_pos - 1);
+
/*
* Use iomap so that we can do granular uptodate reads
* and granular dirty tracking for large folios.
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-02 14:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 13:03 FAILED: patch "[PATCH] fuse: clear the old EOF tail before writeback-cache writes" failed to apply to 6.6-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.