aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-11-08 12:24:34 -0500
committerSage Weil <sage@newdream.net>2010-11-08 12:24:34 -0500
commitd8672d64b88cdb7aa8139fb6d218f40b8cbf60af (patch)
tree71d955bc89b33df3f838f8e1e8c0cbcd3f2bfc62 /fs/ceph
parent8bd59e0188c04f6540f00e13f633f22e4804ce06 (diff)
ceph: fix update of ctime from MDS
The client can have a newer ctime than the MDS due to AUTH_EXCL and XATTR_EXCL caps as well; update the check in ceph_fill_file_time appropriately. This fixes cases where ctime/mtime goes backward under the right sequence of local updates (e.g. chmod) and mds replies (e.g. subsequent stat that goes to the MDS). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 425c5b1f944e..7bc0fbd26af2 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -471,7 +471,9 @@ void ceph_fill_file_time(struct inode *inode, int issued,
471 471
472 if (issued & (CEPH_CAP_FILE_EXCL| 472 if (issued & (CEPH_CAP_FILE_EXCL|
473 CEPH_CAP_FILE_WR| 473 CEPH_CAP_FILE_WR|
474 CEPH_CAP_FILE_BUFFER)) { 474 CEPH_CAP_FILE_BUFFER|
475 CEPH_CAP_AUTH_EXCL|
476 CEPH_CAP_XATTR_EXCL)) {
475 if (timespec_compare(ctime, &inode->i_ctime) > 0) { 477 if (timespec_compare(ctime, &inode->i_ctime) > 0) {
476 dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n", 478 dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n",
477 inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, 479 inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec,
@@ -511,7 +513,7 @@ void ceph_fill_file_time(struct inode *inode, int issued,
511 warn = 1; 513 warn = 1;
512 } 514 }
513 } else { 515 } else {
514 /* we have no write caps; whatever the MDS says is true */ 516 /* we have no write|excl caps; whatever the MDS says is true */
515 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { 517 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) {
516 inode->i_ctime = *ctime; 518 inode->i_ctime = *ctime;
517 inode->i_mtime = *mtime; 519 inode->i_mtime = *mtime;