btrfs: update target inode's ctime on unlink
authorJeff Layton <jlayton@kernel.org>
Mon, 12 Aug 2024 16:30:52 +0000 (12:30 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 Aug 2024 18:35:44 +0000 (20:35 +0200)
commit3bc2ac2f8f0b78a13140fc72022771efe0c9b778
tree9e76fc7c339646aadcf53501d8e5fbc3eddc136a
parentc0247d289e73e18f6ddb0895de30c09770fbed95
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.

According to https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html:

"Upon successful completion, unlink() shall mark for update the last data
 modification and last file status change timestamps of the parent
 directory. Also, if the file's link count is not 0, the last file status
 change timestamp of the file shall be marked for update."

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add link to the opengroup docs ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c