[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240812-btrfs-unlink-v1-1-ee5c2ef538eb@kernel.org>
Date: Mon, 12 Aug 2024 12:30:52 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>
Cc: linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, Jeff Layton <jlayton@...nel.org>
Subject: [PATCH] btrfs: update target inode's ctime on unlink
Unlink changes the link count on the target inode. POSIX mandates that
the ctime must also change when this occurs.
Signed-off-by: Jeff Layton <jlayton@...nel.org>
---
Found using the nfstest_posix testsuite with knfsd exporting btrfs.
---
fs/btrfs/inode.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 333b0e8587a2..b1b6564ab68f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4195,6 +4195,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
btrfs_i_size_write(dir, dir->vfs_inode.i_size - name->len * 2);
inode_inc_iversion(&inode->vfs_inode);
+ inode_set_ctime_current(&inode->vfs_inode);
inode_inc_iversion(&dir->vfs_inode);
inode_set_mtime_to_ts(&dir->vfs_inode, inode_set_ctime_current(&dir->vfs_inode));
ret = btrfs_update_inode(trans, dir);
---
base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba
change-id: 20240812-btrfs-unlink-77293421e416
Best regards,
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists