Project

General

Profile

Actions

Bug #36171

open

mds: ctime should not use client provided ctime/mtime

Added by Patrick Donnelly over 5 years ago. Updated 7 months ago.

Status:
New
Priority:
Urgent
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client, MDS, kceph
Labels (FS):
task(intern), task(medium)
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.

Actions

Also available in: Atom PDF