#860546 xfsprogs: xfs_fsr returns success (zero) on failure

Package:
xfsprogs
Source:
xfsprogs
Description:
Utilities for managing the XFS filesystem
Submitter:
Vincas Dargis
Date:
2021-01-25 23:21:05 UTC
Severity:
normal
Tags:
#860546#5
Date:
2017-04-18 11:44:41 UTC
From:
To:
Dear Maintainer,

I've discovered (in the hard way) that xfs_fsr does not report errors
by returning non-zero exit code.

Here's some examples:

# xfs_fsr /some/nonexiting/path; echo $?
xfs_fsr: could not stat: /some/nonexiting/path: No such file or
directory
0

# xfs_fsr /tmp/not_xfs; echo $?
xfs_fsr: cannot defragment: /tmp/not_xfs: Not XFS
0

This means there is no diagnostics for, let's say, failed
deframentation by cron job or systemd timer.