Linux filesystem development
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <linux-fsdevel@vger.kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	aivazian.tigran@gmail.com,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Ted Tso <tytso@mit.edu>, <linux-ext4@vger.kernel.org>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 5/9] udf: Fix possibly missing inode write on fsync(2)
Date: Mon, 11 May 2026 14:13:55 +0200	[thread overview]
Message-ID: <20260511121356.241821-14-jack@suse.cz> (raw)
In-Reply-To: <20260511115725.28441-1-jack@suse.cz>

Use mmb inode buffer writeout infrastructure to reliably write out
inode's block on fsync(2).

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/udf/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 67bcf83758c8..4102d3482319 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1707,7 +1707,7 @@ void udf_update_extra_perms(struct inode *inode, umode_t mode)
 
 int udf_write_inode(struct inode *inode, struct writeback_control *wbc)
 {
-	return udf_update_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
+	return udf_update_inode(inode, 0);
 }
 
 static int udf_sync_inode(struct inode *inode)
@@ -1937,6 +1937,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
 
 	/* write the data blocks */
 	mark_buffer_dirty(bh);
+	iinfo->i_metadata_bhs.inode_blk = bh->b_blocknr;
 	if (do_sync) {
 		sync_dirty_buffer(bh);
 		if (buffer_write_io_error(bh)) {
-- 
2.51.0


  parent reply	other threads:[~2026-05-11 12:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 12:13 [PATCH 0/9] fs: Fix missed inode write during fsync Jan Kara
2026-05-11 12:13 ` [PATCH 1/9] affs: Drop support for metadata bh tracking Jan Kara
2026-05-11 12:13 ` [PATCH 2/9] ext4: Allocate mapping_metadata_bhs struct on demand Jan Kara
2026-05-11 12:13 ` [PATCH 3/9] fs: Writeout inode buffer from mmb_sync() Jan Kara
2026-05-11 13:27   ` Christian Brauner
2026-05-11 12:13 ` [PATCH 4/9] ext2: Fix possibly missing inode write on fsync(2) Jan Kara
2026-05-11 12:13 ` Jan Kara [this message]
2026-05-11 12:13 ` [PATCH 6/9] fat: " Jan Kara
2026-05-11 14:32   ` OGAWA Hirofumi
2026-05-11 17:03     ` Jan Kara
2026-05-11 18:02       ` OGAWA Hirofumi
2026-05-12  7:29         ` Jan Kara
2026-05-12 14:17           ` OGAWA Hirofumi
2026-05-11 12:13 ` [PATCH 7/9] minix: " Jan Kara
2026-05-11 12:13 ` [PATCH 8/9] bfs: " Jan Kara
2026-05-11 12:13 ` [PATCH 9/9] ext4: Use mmb infrastructure for inode buffer writeout Jan Kara
2026-05-11 13:30   ` Christian Brauner
2026-05-11 20:49 ` [syzbot ci] Re: fs: Fix missed inode write during fsync syzbot ci

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=20260511121356.241821-14-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=aivazian.tigran@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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