From: Haomai Wang Date: Sat, 7 Jun 2014 06:32:23 +0000 (+0800) Subject: FileStore: make _clone() copy spill out marker X-Git-Tag: v0.83~109^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=239476a92849159d2a8966d90ca055c116bee91e;p=ceph.git FileStore: make _clone() copy spill out marker Previously we were not doing so, and that resulted in unpredictable loss of xattrs from the client's perspective. Signed-off-by: Haomai Wang Reviewed-by: Greg Farnum --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 0eb7063b14524..9a59dc5617a4b 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2936,11 +2936,23 @@ int FileStore::_clone(coll_t cid, const ghobject_t& oldoid, const ghobject_t& ne } { + char buf[2]; map aset; r = _fgetattrs(**o, aset, false); if (r < 0) goto out3; + r = chain_fgetxattr(**o, XATTR_SPILL_OUT_NAME, buf, sizeof(buf)); + if (r >= 0 && !strncmp(buf, XATTR_NO_SPILL_OUT, sizeof(XATTR_NO_SPILL_OUT))) { + r = chain_fsetxattr(**n, XATTR_SPILL_OUT_NAME, XATTR_NO_SPILL_OUT, + sizeof(XATTR_NO_SPILL_OUT)); + } else { + r = chain_fsetxattr(**n, XATTR_SPILL_OUT_NAME, XATTR_SPILL_OUT, + sizeof(XATTR_SPILL_OUT)); + } + if (r < 0) + goto out3; + r = _fsetattrs(**n, aset); if (r < 0) goto out3;