]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs: have setattr_copy handle multigrain timestamps appropriately
authorJeff Layton <jlayton@kernel.org>
Wed, 2 Oct 2024 21:27:19 +0000 (17:27 -0400)
committerChristian Brauner <brauner@kernel.org>
Mon, 7 Oct 2024 10:48:57 +0000 (12:48 +0200)
commitb82f92d5dd1a365ab1e13518c8bf799f6fec4518
tree576966317e5584d002a2e18a740c1b54bf66e3b4
parent4e40eff0b5737c0de39e1ae5812509efbc0b986e
fs: have setattr_copy handle multigrain timestamps appropriately

The setattr codepath is still using coarse-grained timestamps, even on
multigrain filesystems. To fix this, fetch the timestamp for ctime
updates later, at the point where the assignment occurs in setattr_copy.

On a multigrain inode, ignore the ia_ctime in the attrs, and always
update the ctime to the current clock value. Update the atime and mtime
with the same value (if needed) unless they are being set to other
specific values, a'la utimes().

Do not do this universally however, as some filesystems (e.g. most
networked fs) want to do an explicit update elsewhere before updating
the local inode.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # documentation bits
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20241002-mgtime-v10-4-d1c4717f5284@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/attr.c