]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: don't update i_max_size when handle reply from non-auth MDS
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 20 Feb 2014 06:43:56 +0000 (14:43 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 27 Feb 2014 03:59:59 +0000 (11:59 +0800)
caps from non-auth mds don't have meaningful max_size

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/client/Client.cc

index d4a91a088c8a71d172975d711ec573b59ee57685..744a38a9a49f0f2a84b2b6000c632d0ce052d5ae 100644 (file)
@@ -672,8 +672,6 @@ Inode * Client::add_update_inode(InodeStat *st, utime_t from,
     }
 
     in->layout = st->layout;
-    in->ctime = st->ctime;
-    in->max_size = st->max_size;  // right?
 
     update_inode_file_bits(in, st->truncate_seq, st->truncate_size, st->size,
                           st->time_warp_seq, st->ctime, st->mtime, st->atime,
@@ -684,9 +682,11 @@ Inode * Client::add_update_inode(InodeStat *st, utime_t from,
   // move me if/when version reflects fragtree changes.
   in->dirfragtree = st->dirfragtree;
 
-  if (in->snapid == CEPH_NOSNAP)
+  if (in->snapid == CEPH_NOSNAP) {
     add_update_cap(in, session, st->cap.cap_id, st->cap.caps, st->cap.seq, st->cap.mseq, inodeno_t(st->cap.realm), st->cap.flags);
-  else
+    if (in->auth_cap && in->auth_cap->session == session)
+      in->max_size = st->max_size;
+  } else
     in->snap_caps |= st->cap.caps;
 
   // setting I_COMPLETE needs to happen after adding the cap