]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vfs: add ATTR_CTIME_SET flag
authorJeff Layton <jlayton@kernel.org>
Wed, 30 Jul 2025 13:24:32 +0000 (09:24 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 21 Sep 2025 23:24:50 +0000 (19:24 -0400)
commitafc5b36e29b95fbd31a60b9630d148857e5e513d
tree7c2974f34dc19631738649bd3dd5dd51f88e7163
parent5affb498e70bba3053b835c478a199bf92c99c4d
vfs: add ATTR_CTIME_SET flag

When ATTR_ATIME_SET and ATTR_MTIME_SET are set in the ia_valid mask, the
notify_change() logic takes that to mean that the request should set
those values explicitly, and not override them with "now".

With the advent of delegated timestamps, similar functionality is needed
for the ctime. Add a ATTR_CTIME_SET flag, and use that to indicate that
the ctime should be accepted as-is. Also, clean up the if statements to
eliminate the extra negatives.

In setattr_copy() and setattr_copy_mgtime() use inode_set_ctime_deleg()
when ATTR_CTIME_SET is set, instead of basing the decision on ATTR_DELEG.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/attr.c
include/linux/fs.h