Thread (28 messages) 28 messages, 5 authors, 2024-07-22

Re: [PATCH v6 4/9] fs: have setattr_copy handle multigrain timestamps appropriately

From: Jan Kara <jack@suse.cz>
Date: 2024-07-17 11:24:12
Also in: linux-btrfs, linux-ext4, linux-fsdevel, linux-mm, linux-nfs, linux-trace-kernel, linux-xfs, lkml

On Mon 15-07-24 08:48:55, Jeff Layton wrote:
The setattr codepath is still using coarse-grained timestamps, even on
multigrain filesystems. To fix this, we need to 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().

Note that we don't want to 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>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Looks good to me so feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

What is a bit bothering me is that it's now confusing that ATTR_MTIME_SET /
ATTR_ATIME_SET is handled in different place for mgtime and normal inodes
and I'm concerned this will bite us in the future. But not everybody is
using setattr_copy() and unifying the handling of timestamps seems like
quite some work...

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help