common/xfs: fix various problems with _supports_xfs_scrub
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 22 Mar 2018 02:48:09 +0000 (19:48 -0700)
committerEryu Guan <guaneryu@gmail.com>
Fri, 23 Mar 2018 04:44:02 +0000 (12:44 +0800)
commit8aa212310d62295488d23bf7958d2329c287a8c9
tree47b3ed8704b3384ae56c98df8d07670410c22498
parent064c618989630c7108f7c1f30b809232d9db67c7
common/xfs: fix various problems with _supports_xfs_scrub

The _supports_xfs_scrub helper is called with a mountpoint (a working
mountpoint is required for scrub) and a block device (used to detect
norecovery mounts).  If either of these conditions aren't satisfied we
should return failure status to the caller, not unilaterally decide to
bail out of the test.  In particular, the -b test doesn't work if the
fs has already shutdown on us.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/xfs