]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't change directory size/rbytes from client cap update
authorSage Weil <sage@newdream.net>
Thu, 19 Nov 2009 19:24:48 +0000 (11:24 -0800)
committerSage Weil <sage@newdream.net>
Thu, 19 Nov 2009 19:24:48 +0000 (11:24 -0800)
This is wrong, and screws up the recursive accounting.

src/mds/Locker.cc

index ea35d05e3a946a96598dad43cfa99c09b8687f67..179afbef195c0b9fd3a39420078ab0111ca0a286 100644 (file)
@@ -1947,7 +1947,8 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
              << " for " << *in << dendl;
       pi->ctime = ctime;
     }
-    if (size > latest->size) {
+    if (in->inode.is_file() &&   // ONLY if regular file
+       size > latest->size) {
       dout(7) << "  size " << pi->size << " -> " << size
              << " for " << *in << dendl;
       pi->size = size;