]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/FileStore: force any new xattr into omap on E2BIG
authorSage Weil <sage@redhat.com>
Thu, 7 Aug 2014 00:28:45 +0000 (17:28 -0700)
committerSage Weil <sage@redhat.com>
Thu, 7 Aug 2014 00:28:45 +0000 (17:28 -0700)
commit26750fcfe8d766874513e57981565adde2e6d8c7
tree496d88b763bad9d0e5d2f0b0962c0f0a21883f1c
parentd050cf6c821fa45938bbe0d990547dc496383815
os/FileStore: force any new xattr into omap on E2BIG

If we have a huge xattr (or many little ones), the _fgetattrs() for the
inline_set will fail with E2BIG.  The conditions later where we decide
whether to clean up the old xattr will then also fail.  We *will* put
the xattr in omap, but the non-omap version isn't cleaned up.

Fix this by setting a flag if we get E2BIG that the inline_set is known
to be incomplete.  In that case, take the conservative step of assuming
the xattr might be present and chain_fremovexattr().  Ignore any error
because it might not be there.

This is clearly harmless in the general case because it won't be there.
If it is, we will hopefully remove enough xattrs that the E2BIG
condition will go away (usually by removing some really big chained
xattr).

See original bug #7779.  With this in place, we can repair objects in
the broken state if we know the rados attr(s) that are responsible.
Usually that is user.rgw.manifset, and a rados get + set of the attr
will repair things.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.cc