From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL 18/18 for v7.3] vfs sync
Date: Fri, 14 Aug 2026 15:15:02 +0200 [thread overview]
Message-ID: <20260814-vfs-7.3-rc1.sync-55166eaa0000@brauner> (raw)
In-Reply-To: <20260814-vfs-v73-6e884cb31ac9@brauner>
Hey Linus,
/* Summary */
This makes sync_inode_metadata() and writeback_single_inode() persist
not only the inode but all metadata associated with it.
A new .sync_inode_metadata superblock operation is called from
__writeback_single_inode(). Alongside it a new I_METADATA_WRITEBACK
state flag is added.
Filesystems no longer need their own mmb_fsync() implementations and can
just use simple_fsync(). All metadata is now written for IS_SYNC and
IS_DIRSYNC inodes. Races where several fsyncs raced and mmb_sync() could
return before all buffers were really persisted are fixed since I_SYNC
now serializes properly.
The I_METADATA_WRITEBACK scheme also fixes the case where a
WB_SYNC_NONE writeback landing between write(2) and fsync(2) left
fsync(2) failing to persist the inode. That problem is not specific to
filesystems using the generic metadata bh tracking, and the ones that
do not are left alone.
ext2, udf, bfs, minix, fat and ext4 in nojournal mode have their data
integrity writeout fixed and are converted. affs drops metadata bh
tracking and mmb_fsync() is removed.
A few other fixes came out of this:
- a UAF in mark_buffer_write_io_error()
- missed inode writeback when racing with __writeback_single_inode()
- ext4 allocating the mapping_metadata_bhs struct on demand
- three fat fixes: a lost inode update in do_msdos_rename() with
DIRSYNC, inode buffer write errors not propagating out of
fat_sync_inode_metadata() and directory entries not being persisted on
fsync(2) of the root directory.
/* Testing */
No build failures or warnings were observed.
/* Conflicts */
Merge conflicts with mainline
=============================
No known conflicts.
Merge conflicts with other trees
================================
[1]: https://lore.kernel.org/linux-next/ams9K7q5NMj9ifmm@sirena.org.uk
This conflicts with the ext3 tree in fs/ext2/xattr.c between commit
6abf69e2e7f91 ("ext2: Simplify error handling of IO error when adding
xattr") from the ext3 tree and commit 356984d1a5c32 ("ext2: Fix lost
inode updates for IS_SYNC inodes") from this tree:
diff --cc fs/ext2/xattr.c
index 5f49ec4afc36f,be63f89402a38..0000000000000
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@@ -777,16 -777,20 +777,16 @@@ ext2_xattr_set2(struct inode *inode, st
/* Update the inode. */
EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0;
inode_set_ctime_current(inode);
+ mark_inode_dirty(inode);
if (IS_SYNC(inode)) {
error = sync_inode_metadata(inode, 1);
- /* In case sync failed due to ENOSPC the inode was actually
- * written (only some dirty data were not) so we just proceed
- * as if nothing happened and cleanup the unused block */
- if (error && error != -ENOSPC) {
- if (new_bh && new_bh != old_bh) {
- dquot_free_block_nodirty(inode, 1);
- mark_inode_dirty(inode);
- }
+ /*
+ * Inode writeout failed. Backing everything out is complex so
+ * let's just leave it for e2fsck to cleanup the mess.
+ */
+ if (error)
goto cleanup;
- } else
- mark_inode_dirty(inode);
- }
+ }
error = 0;
if (old_bh && old_bh != new_bh) {
The following changes since commit 1590cf0329716306e948a8fc29f1d3ee87d3989f:
Linux 7.2-rc4 (2026-07-19 13:54:41 -0700)
are available in the Git repository at:
git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.3-rc1.sync
for you to fetch changes up to 974d0be0cb8e48d63b9d413a2e1a8fba16cd2583:
writeback: Export __inode_attach_wb() (2026-07-28 14:08:52 +0200)
----------------------------------------------------------------
vfs-7.3-rc1.sync
Please consider pulling these changes from the signed vfs-7.3-rc1.sync tag.
Thanks!
Christian
----------------------------------------------------------------
Christian Brauner (5):
Merge patch series "fs: Fix missed inode write during fsync"
fat: Fix lost inode update in do_msdos_rename() with DIRSYNC
fat: Propagate inode buffer write errors from fat_sync_inode_metadata()
fat: Fix persisting directory entries on fsync(2) of the root directory
writeback: Export __inode_attach_wb()
Jan Kara (20):
affs: Drop support for metadata bh tracking
fs: Fix possible UAF in mark_buffer_write_io_error()
fs: Fix missed inode writeback when racing with __writeback_single_inode
ext4: Allocate mapping_metadata_bhs struct on demand
fs: Provide way for filesystem to wait for metadata writeback
ext2: Fix lost inode updates for IS_SYNC inodes
ext2: Drop __ext2_write_inode()
ext2: Avoid unnecessary inode buffer writeback for sync(2)
ext2: Fix data integrity writeout issues
udf: Fix data integrity writeout issues
udf: Use sync_inode_metadata() to writeout IS_SYNC inode
udf: Drop udf_sync_inode()
udf: Use sync_inode_metadata() in udf_evict_inode()
udf: Fold udf_update_inode() into udf_write_inode()
bfs: Fix data integrity writeout issues
minix: Fix data integrity writeout issues
ext4: Fix data integrity writeout issues in nojournal mode
fat: Fix missed inode writeback during fsync(2)
fat: Replace fat_sync_inode() with sync_inode_metadata()
vfs: Remove mmb_fsync()
fs/affs/affs.h | 2 -
fs/affs/amigaffs.c | 12 ++---
fs/affs/file.c | 25 +++++-----
fs/affs/inode.c | 13 ++----
fs/affs/namei.c | 9 ++--
fs/affs/super.c | 1 -
fs/bfs/dir.c | 9 +---
fs/bfs/inode.c | 30 +++++++++---
fs/buffer.c | 83 ++++-----------------------------
fs/ext2/dir.c | 2 +-
fs/ext2/ext2.h | 3 +-
fs/ext2/file.c | 17 +------
fs/ext2/inode.c | 49 ++++++++++++--------
fs/ext2/super.c | 1 +
fs/ext2/xattr.c | 4 +-
fs/ext4/ext4.h | 14 +++++-
fs/ext4/ext4_jbd2.c | 25 ++++++++--
fs/ext4/fsync.c | 24 ++--------
fs/ext4/inode.c | 102 +++++++++++++++++++++++++++--------------
fs/ext4/super.c | 16 +++++--
fs/fat/dir.c | 6 +--
fs/fat/fat.h | 1 -
fs/fat/file.c | 9 ++--
fs/fat/inode.c | 63 ++++++++++++++++++-------
fs/fat/misc.c | 7 +--
fs/fat/namei_msdos.c | 33 +++++++------
fs/fat/namei_vfat.c | 20 ++++----
fs/fs-writeback.c | 34 +++++++++++---
fs/libfs.c | 7 ++-
fs/minix/dir.c | 2 +-
fs/minix/file.c | 9 +---
fs/minix/inode.c | 52 ++++++++++++++-------
fs/minix/minix.h | 1 -
fs/udf/dir.c | 2 +-
fs/udf/file.c | 11 ++---
fs/udf/inode.c | 54 +++++++++++-----------
fs/udf/super.c | 1 +
fs/udf/udfdecl.h | 2 +-
include/linux/buffer_head.h | 4 --
include/linux/fs.h | 10 +++-
include/linux/fs/super_types.h | 2 +
41 files changed, 409 insertions(+), 362 deletions(-)
next prev parent reply other threads:[~2026-08-14 13:15 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 13:07 [GIT PULL 00/18 for v7.3] v7.3 Christian Brauner
2026-08-14 13:10 ` [GIT PULL 01/18 for v7.3] ipc misc Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:11 ` [GIT PULL 02/18 for v7.3] kernel misc Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:11 ` [GIT PULL 03/18 for v7.3] vfs binfmt Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:11 ` [GIT PULL 04/18 for v7.3] vfs efs Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:11 ` [GIT PULL 05/18 for v7.3] vfs failfs Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:12 ` [GIT PULL 06/18 for v7.3] vfs fat Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:12 ` [GIT PULL 07/18 for v7.3] vfs freevxfs Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:12 ` [GIT PULL 08/18 for v7.3] vfs iomap Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:12 ` [GIT PULL 09/18 for v7.3] vfs kfunc Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:12 ` [GIT PULL 10/18 for v7.3] vfs kthread Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:13 ` [GIT PULL 11/18 for v7.3] vfs lookup Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:13 ` [GIT PULL 12/18 for v7.3] vfs misc Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:13 ` [GIT PULL 13/18 for v7.3] vfs mount Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:14 ` [GIT PULL 14/18 for v7.3] vfs netfs Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:14 ` [GIT PULL 15/18 for v7.3] vfs nilfs2 Christian Brauner
2026-08-14 17:26 ` Viacheslav Dubeyko
2026-08-17 7:30 ` Christian Brauner
2026-08-14 13:14 ` [GIT PULL 16/18 for v7.3] vfs ovl Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:14 ` [GIT PULL 17/18 for v7.3] vfs super Christian Brauner
2026-08-17 22:25 ` pr-tracker-bot
2026-08-14 13:15 ` Christian Brauner [this message]
2026-08-17 22:25 ` [GIT PULL 18/18 for v7.3] vfs sync pr-tracker-bot
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=20260814-vfs-7.3-rc1.sync-55166eaa0000@brauner \
--to=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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