Skip to content

Commit

Permalink
mds: set xattr_version to 0 if replay doesn't contain xattrs
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <[email protected]>
  • Loading branch information
Yan, Zheng committed Jun 26, 2014
1 parent c2ffad3 commit 93df7da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mds/CInode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 93df7da

Please sign in to comment.