From 93df7daf18d5b8efccd945834d36e2c1c2e8cda7 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 26 Jun 2014 13:30:13 +0800 Subject: [PATCH] mds: set xattr_version to 0 if replay doesn't contain xattrs Signed-off-by: Yan, Zheng --- src/mds/CInode.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index a28748fd08dab..cc8e7997954e9 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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; } } -- 2.47.3