Project

General

Profile

Actions

Bug #40371

closed

cephfs-shell: du must ignore non-directory files

Added by Rishabh Dave almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% 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


Related issues 1 (0 open1 closed)

Copied to CephFS - Backport #41861: nautilus: cephfs-shell: du must ignore non-directory filesRejectedRishabh DaveActions
Actions

Also available in: Atom PDF