From: xie xingguo Date: Sat, 20 Feb 2016 06:44:42 +0000 (+0800) Subject: os/filestore: exit if we fail to remove any xattr X-Git-Tag: v10.1.0~41^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbde2f0d27b37c8ed68c0acb923482514789dd53;p=ceph.git os/filestore: exit if we fail to remove any xattr The problem here is if we fail to remove one of the existing xattr stored with fd, and we spill out more xattrs to ObjectMap, we'll go on to cleaning up the remaining xattrs in ObjectMap, and thus the real failure might be covered. This commit solves the above problem by making a quick exit if we fail to remove any xattr bound with file. Signed-off-by: xie xingguo --- diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 9d0eeac2e3e2..c1a9ee8a6992 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -4340,8 +4340,10 @@ int FileStore::_rmattrs(const coll_t& cid, const ghobject_t& oid, char n[CHAIN_XATTR_MAX_NAME_LEN]; get_attrname(p->first.c_str(), n, CHAIN_XATTR_MAX_NAME_LEN); r = chain_fremovexattr(**fd, n); - if (r < 0) - break; + if (r < 0) { + dout(10) << __func__ << " could not remove xattr r = " << r << dendl; + goto out_close; + } } }