]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set new inode's xattr version to 1
authorYan, Zheng <zyan@redhat.com>
Mon, 15 Sep 2014 13:39:26 +0000 (21:39 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 16 Sep 2014 04:54:48 +0000 (12:54 +0800)
set new inode's xattr version to 1 even if it has no xattr. This allow
client to differentiate no xattr in inode from MDS skips sending xattr
to client (because MDS think client already has uptodate xattr).

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/MDCache.cc
src/mds/Server.cc

index ea5bb361601808d84b74bd9776bf71e5b52663bf..6b9d6c717782ea93a023df739387cb687c809c00 100644 (file)
@@ -332,6 +332,7 @@ CInode *MDCache::create_system_inode(inodeno_t ino, int mode)
   CInode *in = new CInode(this);
   in->inode.ino = ino;
   in->inode.version = 1;
+  in->inode.xattr_version = 1;
   in->inode.mode = 0500 | mode;
   in->inode.size = 0;
   in->inode.ctime = 
index beb469647f3c3c5834982cd239a3d45f49a11e00..bf5b98aa445431345a94fbeb91e01d658475d43b 100644 (file)
@@ -2005,6 +2005,7 @@ CInode* Server::prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino
   }
 
   in->inode.version = 1;
+  in->inode.xattr_version = 1;
   in->inode.nlink = 1;   // FIXME
 
   in->inode.mode = mode;