]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set xattr_version to 0 if replay doesn't contain xattrs 2030/head
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 26 Jun 2014 05:30:13 +0000 (13:30 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 26 Jun 2014 05:33:55 +0000 (13:33 +0800)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/CInode.cc

index a28748fd08dabaa607c9ec00352c1f790872fd19..cc8e7997954e97866dd45cd7ecbbb7b56b38ec2f 100644 (file)
@@ -2938,11 +2938,13 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
 
   // xattr
   bufferlist xbl;
-  e.xattr_version = i->xattr_version;
   if (!had_latest_xattrs) {
     if (!pxattrs)
       pxattrs = pxattr ? get_projected_xattrs() : &xattrs;
     ::encode(*pxattrs, xbl);
+    e.xattr_version = i->xattr_version;
+  } else {
+    e.xattr_version = 0;
   }
   
   // do we have room?
@@ -3044,6 +3046,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
     } else {
       dout(10) << "dropping xattrs version " << i->xattr_version << dendl;
       xbl.clear(); // no xattrs .. XXX what's this about?!?
+      e.xattr_version = 0;
     }
   }