FAILED: patch "[PATCH] ocfs2: update inode fsync transaction id in ocfs2_unlink and" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-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 <[email protected]>.
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-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 8c40984eeb8804cffcd28640f427f4fe829243fc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024061802-poplar-edging-43a0@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
8c40984eeb88 ("ocfs2: update inode fsync transaction id in ocfs2_unlink and ocfs2_link") fd6acbbc4d1e ("ocfs2: convert to new timestamp accessors")6861de979fa0 ("ocfs2: convert to ctime accessor functions")f2d40141d5d9 ("fs: port inode_init_owner() to mnt_idmap")011e2b717b1b ("fs: port ->tmpfile() to pass mnt_idmap")5ebb29bee8d5 ("fs: port ->mknod() to pass mnt_idmap")c54bd91e9eab ("fs: port ->mkdir() to pass mnt_idmap")7a77db95511c ("fs: port ->symlink() to pass mnt_idmap")6c960e68aaed ("fs: port ->create() to pass mnt_idmap")abf08576afe3 ("fs: port vfs_*() helpers to struct mnt_idmap")041fae9c105a ("Merge tag 'f2fs-for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 8c40984eeb8804cffcd28640f427f4fe829243fc Mon Sep 17 00:00:00 2001
From: Su Yue <[email protected]>
Date: Mon, 8 Apr 2024 16:20:40 +0800
Subject: [PATCH] ocfs2: update inode fsync transaction id in ocfs2_unlink and
ocfs2_link
transaction id should be updated in ocfs2_unlink and ocfs2_link. Otherwise, inode link will be wrong after journal replay even fsync was called before power failure:
=======================================================================
$ touch testdir/bar $ ln testdir/bar testdir/bar_link $ fsync testdir/bar $ stat -c %h $SCRATCH_MNT/testdir/bar 1 $ stat -c %h $SCRATCH_MNT/testdir/bar 1 =======================================================================
fs/ocfs2/namei.c +2 -0
@@ -797,6 +797,7 @@ static int ocfs2_link(struct dentry *old_dentry,ocfs2_set_links_count (fe, inode->i_nlink); fe->i_ctime =cpu_to_le64 (inode_get_ctime_sec (inode)); fe->i_ctime_nsec =cpu_to_le32 (inode_get_ctime_nsec (inode)); +ocfs2_update_inode_fsync_trans (handle, inode,0 );ocfs2_journal_dirty (handle, fe_bh); err = ocfs2_add_entry(handle, dentry, inode,
@@ -993,6 +994,7 @@ static int ocfs2_unlink(struct inode *dir,drop_nlink (inode);drop_nlink (inode);ocfs2_set_links_count (fe, inode->i_nlink); +ocfs2_update_inode_fsync_trans (handle, inode,0 );ocfs2_journal_dirty (handle, fe_bh);inode_set_mtime_to_ts (dir,inode_set_ctime_current (dir));