Actions
Bug #40371
closedcephfs-shell: du must ignore non-directory files
% Done:
0%
Source:
Development
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
cephfs-shell
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
cephfs-shell's du command crashes if it comes across because files that are not directories since it tries to get 'ceph.dir.rbytes' for non-directory files too. I suppose it should ignore all files except for directories, the way GNU du does.
Copying from src/tools/cephfs/cephfs-shell
for i in reversed(sorted(set(dirwalk(dir_)))): i = os.path.normpath(i) try: xattr = cephfs.getxattr(to_bytes(i), 'ceph.dir.rbytes') self.poutput('{:10s} {}'.format( humansize(int(xattr.decode('utf-8'))), '.' + i)) except libcephfs.Error: continue
Actions