Project

General

Profile

Bug #36171

mds: ctime should not use client provided ctime/mtime

Added by Patrick Donnelly 3 months ago. Updated 3 months ago.

Status:
Need Review
Priority:
Urgent
Category:
-
Target version:
Start date:
09/24/2018
Due date:
% Done:

0%

Source:
Development
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client, MDS, kceph
Labels (FS):
task(easy)
Pull request ID:

Description

Otherwise, you can set a ctime that is far in the future and it cannot be rolled back.

pdonnell@senta02 ~/ceph$ cd /home/pdonnell/mnt/tmp.9cYgpRTGXD
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ mkdir foo
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ touch foo/bar
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ getfattr -n ceph.dir.rctime foo
# file: foo
ceph.dir.rctime="1537838662.09897717617" 
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ stat foo/bar
  File: 'foo/bar'
  Size: 0               Blocks: 0          IO Block: 4194304 regular empty file
Device: 2ch/44d Inode: 1099511627777  Links: 1
Access: (0640/-rw-r-----)  Uid: ( 1163/pdonnell)   Gid: ( 1163/pdonnell)
Access: 2018-09-24 21:24:22.893455885 -0400
Modify: 2018-09-24 21:24:22.893455885 -0400
Change: 2018-09-24 21:24:22.897717617 -0400
 Birth: -
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ touch foo/derp
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ date +%s
1537838726
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ getfattr -n ceph.dir.rctime foo
# file: foo
ceph.dir.rctime="1537838725.0981013223" 

pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ touch -m --date='Jan 01 2022' foo/derp
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ getfattr -n ceph.dir.rctime foo
# file: foo
ceph.dir.rctime="1641013200.090" 

pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ rm foo/derp
pdonnell@senta02 ~/mnt/tmp.9cYgpRTGXD$ getfattr -n ceph.dir.rctime foo
# file: foo
ceph.dir.rctime="1641013200.090" 

Partially caused by 60f73cde4e04be2685eaf7cd04e03c045e1f9977 and #35945.

I think the right approach here is to have the client set its own ctime so that it's locally useful but not to transmit it to the MDS. The MDS always uses its own clock to update the ctime/rctime. This means from the client's perspective that the ctime changes twice for a single metadata operation but I think that's acceptable. The standards provide no guarantees or guidance on this.

History

#1 Updated by Patrick Donnelly 3 months ago

  • Subject changed from mds: ctime should not use mtime value to mds: ctime should not client provided ctime/mtime

#2 Updated by Patrick Donnelly 3 months ago

  • Subject changed from mds: ctime should not client provided ctime/mtime to mds: ctime should not use client provided ctime/mtime
  • Status changed from New to In Progress
  • Assignee set to Patrick Donnelly

#3 Updated by Patrick Donnelly 3 months ago

  • Status changed from In Progress to Need Review

Also available in: Atom PDF