]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: exit if we fail to remove any xattr
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 20 Feb 2016 06:44:42 +0000 (14:44 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 15 Mar 2016 13:53:53 +0000 (21:53 +0800)
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 <xie.xingguo@zte.com.cn>
src/os/filestore/FileStore.cc

index 9d0eeac2e3e2d850dcab70df17be3e65e0db5216..c1a9ee8a6992cf41e83e49b4bb4e4717ca76c7a5 100644 (file)
@@ -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;
+      }
     }
   }