diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2019-01-07 13:58:01 -0500 |
---|---|---|
committer | Kotresh HR <khiremat@redhat.com> | 2019-01-08 05:32:28 +0000 |
commit | 054c7ea91603acfcb01db8455b25dda7e5e831b2 (patch) | |
tree | 314866b598902e9eb2db946c94056432bbe22baa /xlators/features/bit-rot/src/stub/bit-rot-stub.h | |
parent | 86f5d75c70a5fa6f1790b17d12d56fd8b37b9ddd (diff) |
features/bit-rot: do not send version and signature keys in dict
In lookup, if the file has been marked as bad, then bit-rot-stub
was sending the version and signature xattr values as well in the
response dictinary. This is not needed. Only bad file marker has
to be sent.
Change-Id: Id59c02e9857577c60849fd28ef657f71e0b15207
fixes: bz#1664122
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/stub/bit-rot-stub.h')
-rw-r--r-- | xlators/features/bit-rot/src/stub/bit-rot-stub.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.h b/xlators/features/bit-rot/src/stub/bit-rot-stub.h index c688d92f26f..e3afa29889a 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.h +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.h @@ -359,10 +359,18 @@ br_stub_is_internal_xattr(const char *name) } static inline void -br_stub_remove_vxattrs(dict_t *xattr) +br_stub_remove_vxattrs(dict_t *xattr, gf_boolean_t remove_bad_marker) { if (xattr) { - dict_del(xattr, BITROT_OBJECT_BAD_KEY); + /* + * When a file is corrupted, bad-object should be + * set in the dict. But, other info such as version, + * signature etc should not be set. Hence the flag + * remove_bad_marker. The consumer should know whether + * to send the bad-object info in the dict or not. + */ + if (remove_bad_marker) + dict_del(xattr, BITROT_OBJECT_BAD_KEY); dict_del(xattr, BITROT_CURRENT_VERSION_KEY); dict_del(xattr, BITROT_SIGNING_VERSION_KEY); dict_del(xattr, BITROT_SIGNING_XATTR_SIZE_KEY); |