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>
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;
+ }
}
}