Project

General

Profile

Bug #40371

cephfs-shell: du must ignore non-directory files

Added by Rishabh Dave 2 months ago. Updated 2 months ago.

Status:
Need Review
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% 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:

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

History

#1 Updated by Rishabh Dave 2 months ago

  • Status changed from New to Need Review
  • Pull request ID set to 40371
  • Component(FS) cephfs-shell added

#2 Updated by Rishabh Dave 2 months ago

  • Pull request ID changed from 40371 to 28560

#3 Updated by Patrick Donnelly 2 months ago

  • Target version set to v15.0.0
  • Start date deleted (06/14/2019)
  • Source set to Development
  • Backport set to nautilus

Also available in: Atom PDF