From: Greg Farnum Date: Mon, 29 Sep 2014 23:10:36 +0000 (-0700) Subject: Locker: accept ctime updates from clients without dirty write caps X-Git-Tag: v0.86~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0ea20a668cf859881c49b33d1b6db4e636eda18a;p=ceph.git Locker: accept ctime updates from clients without dirty write caps The ctime changes any time the inode does. That can happen even without the file itself having changed, so we'd better accept the update whenever the auth caps have dirtied, without worrying about the file caps! Fixes: #9514 Backport: firefly Signed-off-by: Greg Farnum Reviewed-by: Sage Weil Reviewed-by: John Spray --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index c76582255c899..ba92196583a65 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2865,11 +2865,18 @@ void Locker::_do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t foll void Locker::_update_cap_fields(CInode *in, int dirty, MClientCaps *m, inode_t *pi) { + + utime_t ctime = m->get_ctime(); + if (dirty && ctime > pi->ctime) { + dout(7) << " ctime " << pi->ctime << " -> " << ctime + << " for " << *in << dendl; + pi->ctime = ctime; + } + // file if (dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR)) { utime_t atime = m->get_atime(); utime_t mtime = m->get_mtime(); - utime_t ctime = m->get_ctime(); uint64_t size = m->get_size(); version_t inline_version = m->inline_version; @@ -2879,11 +2886,6 @@ void Locker::_update_cap_fields(CInode *in, int dirty, MClientCaps *m, inode_t * << " for " << *in << dendl; pi->mtime = mtime; } - if (ctime > pi->ctime) { - dout(7) << " ctime " << pi->ctime << " -> " << ctime - << " for " << *in << dendl; - pi->ctime = ctime; - } if (in->inode.is_file() && // ONLY if regular file size > pi->size) { dout(7) << " size " << pi->size << " -> " << size