On 10/27/20 2:03 PM, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Make sure we can actually upgrade filesystems to support inobtcounts. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > --- > common/xfs | 16 ++++++++++++ > tests/xfs/910 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/910.out | 3 ++ > tests/xfs/group | 1 + > 4 files changed, 92 insertions(+) > create mode 100755 tests/xfs/910 > create mode 100644 tests/xfs/910.out > > > diff --git a/common/xfs b/common/xfs > index 3f5c14ba..e548a0a1 100644 > --- a/common/xfs > +++ b/common/xfs > @@ -978,3 +978,19 @@ _require_xfs_copy() > [ "$USE_EXTERNAL" = yes ] && \ > _notrun "Cannot xfs_copy with external devices" > } > + > +_require_xfs_mkfs_inobtcount() > +{ > + _scratch_mkfs_xfs_supported -m inobtcount=1 >/dev/null 2>&1 \ > + || _notrun "mkfs.xfs doesn't have inobtcount feature" > +} I'd like to also add: +_require_xfs_admin_upgrade() +{ + local feature="$1" + + _require_scratch + # Catch missing "-O" or missing feature handling + _scratch_xfs_admin -O $feature 2>&1 | grep "illegal option\|Cannot change" \ + && _notrun "xfs_admin does not support upgrading $1" +} and then: ... > +# real QA test starts here > +_supported_fs xfs > +_require_command "$XFS_ADMIN_PROG" "xfs_admin" > +_require_xfs_mkfs_inobtcount > +_require_xfs_scratch_inobtcount +_require_xfs_admin_upgrade "inobtcount" to be sure that the upgrade command is also supported by xfs_admin. By the time we get to release, both mkfs & xfs_admin should both support it, but I'm hedging my bets on the upgrade path just a little,and it seems best to explicitly test both requirements. that helper can be re-used on the bigtime upgrade test as well and anything else that requires an xfs_admin upgrade path ... Thanks, -Eric