fs: multigrain timestamps for XFS's change_cookie
Get series with b4
b4 am [email protected] change-id 20230921-ctime-5b7a628a4b95Versions newest first
- v8 Latest5 patches 22 repliesIn review
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | fs: add infrastructure for multigrain timestampsfs/ include/ | +160 | 2 replies | |
| 2/5 | fs: optimize away some fine-grained timestamp updatesfs/ | +23 | 0 replies | |
| 3/5 | fs: have setattr_copy handle multigrain timestamps appropriatelyfs/ | +46 | 0 replies | |
| 4/5 | fs: add timestamp_truncate_to_gran helperfs/ include/ | +28 | 0 replies | |
| 5/5 | xfs: switch to multigrain timestampsfs/ fs/ fs/ | +23 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.
Cover letter [PATCH v8 0/5] fs: multigrain timestamps for XFS's change_cookie
My initial goal was to implement multigrain timestamps on most major filesystems, so we could present them to userland, and use them for NFSv3, etc.
With the current implementation however, we can't guarantee that a file with a coarse grained timestamp modified after one with a fine grained timestamp will always appear to have a later value. This could confuse some programs like make, rsync, find, etc. that depend on strict ordering requirements for timestamps.
The goal of this version is more modest: fix XFS' change attribute. XFS's change attribute is bumped on atime updates in addition to other deliberate changes. This makes it unsuitable for export via nfsd.
Jan Kara suggested keeping this functionality internal-only for now and plumbing the fine grained timestamps through getattr [1]. This set takes a slightly different approach and has XFS use the fine-grained attr to fake up STATX_CHANGE_COOKIE in its getattr routine itself.
While we keep fine-grained timestamps in struct inode, when presenting the timestamps via getattr, we truncate them at a granularity of number of ns per jiffy, which allows us to smooth over the fuzz that causes ordering problems.
This set only converts XFS to use this scheme. All of the other commonly-exported local filesystems have a native change attribute and wouldn't clearly benefit from mgtime support at this time. Still, it should be possible to add this support to other filesystems in the future, as the need arises (bcachefs?).
I'd like to see this go in for v6.7 if possible, so getting it into linux-next now would be great if there are no objections.
[1]: https://lore.kernel.org/linux-fsdevel/20230920124823.ghl6crb5sh4x2pmt@quack3/
---
Jeff Layton (5):
fs: add infrastructure for multigrain timestamps
fs: optimize away some fine-grained timestamp updates
fs: have setattr_copy handle multigrain timestamps appropriately
fs: add timestamp_truncate_to_gran helper
xfs: switch to multigrain timestamps
fs/attr.c | 52 ++++++++++++-- fs/inode.c | 151 ++++++++++++++++++++++++++++++++++++---- fs/xfs/libxfs/xfs_trans_inode.c | 6 +- fs/xfs/xfs_iops.c | 26 +++++-- fs/xfs/xfs_super.c | 2 +- include/linux/fs.h | 64 ++++++++++++++++- 6 files changed, 269 insertions(+), 32 deletions(-)
---
base-commit: f8f2d6d669b91ea98ec8f182c22e06d3d0663e15
change-id: 20230921-ctime-5b7a628a4b95
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>