]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - scrub/xfs_scrub_all.in
xfs_scrub_all: walk the lsblk device/fs hierarchy correctly
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Mar 2019 23:05:01 +0000 (18:05 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Mar 2019 23:05:01 +0000 (18:05 -0500)
commitab11d016e0c24a056a22268e868bb532bb209253
treecc283fe40b84c583b81f3a6611fdcf6c7cf1a7f1
parent7d8f4a163480312b09d16a515b1d22e80fdd994a
xfs_scrub_all: walk the lsblk device/fs hierarchy correctly

Back when I was designing xfs_scrub_all, I naïvely assumed that the
emitted output would always list physical storage before the virtual
devices stacked atop it.  However, this is not actually true when one
omits the "NAME" column, which is crucial to forcing the output (json or
otherwise) to capture the block device hierarchy.  If the assumption is
violated, the program crashes with a python exception.

To fix this, force the hierarchal json output and restructure the
discovery routines to walk the json object that we receive, from the top
(physical devices) downwards to wherever there are live xfs filesystems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/xfs_scrub_all.in