ocfs2: update inode fsync transaction id in ocfs2_unlink and ocfs2_link
authorSu Yue <glass.su@suse.com>
Mon, 8 Apr 2024 08:20:40 +0000 (16:20 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 04:07:07 +0000 (21:07 -0700)
commit8c40984eeb8804cffcd28640f427f4fe829243fc
tree231d5547e32d53851cca4eb9167208e1fce58a19
parent952b023f06a24b2ad6ba67304c4c84d45bea2f18
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
=======================================================================

Link: https://lkml.kernel.org/r/20240408082041.20925-4-glass.su@suse.com
Fixes: ccd979bdbce9 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem")
Signed-off-by: Su Yue <glass.su@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/namei.c