diff options
author | srijan-sivakumar <ssivakum@redhat.com> | 2020-09-16 08:55:22 +0530 |
---|---|---|
committer | srijan-sivakumar <ssivakum@redhat.com> | 2020-09-16 09:01:53 +0530 |
commit | 5348292bf0fd79035b5817915922133cee8eb785 (patch) | |
tree | 284a92bd21278f1dd6f942b57e740c669b64b192 /extras | |
parent | a699974a698fdc15a5015dfe53b92055dc74dadd (diff) | |
download | glusterfs-5348292bf0fd79035b5817915922133cee8eb785.tar.gz glusterfs-5348292bf0fd79035b5817915922133cee8eb785.tar.xz glusterfs-5348292bf0fd79035b5817915922133cee8eb785.zip |
quota_fsck.py fails with UnicodeDecodeError
Issue: While decoding the byte characters the quota_fsck
script stumbled across a corner case wherein the file names
given by the getfattr dump will cause the decoding to UTF-8
to fail with UnicodeDecodeError.
Code Change:
On looking through the quota_fsck.py script, it seems like
the file path is actually not needed when decoding for the
xattr parsing, hence the code change reflects that. Also,
removed a comparison which previously existed to skip the
file names as that won't be required now.
Fixes: #1487
Change-Id: I8a13ab07be6c9cfafae996f17764fbb4a285bd8c
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/quota/quota_fsck.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/extras/quota/quota_fsck.py b/extras/quota/quota_fsck.py index ea8d638112..e62f7fc52a 100755 --- a/extras/quota/quota_fsck.py +++ b/extras/quota/quota_fsck.py @@ -156,13 +156,10 @@ def get_quota_xattr_brick(dpath): xattr_dict = {} xattr_dict['parents'] = {} - for xattr in pairs: + for xattr in pairs[1:]: xattr = xattr.decode("utf-8") xattr_key = xattr.split("=")[0] - if re.search("# file:", xattr_key): - # skip the file comment - continue - elif xattr_key is "": + if xattr_key == "": # skip any empty lines continue elif not re.search("quota", xattr_key): |