On Fri, Jul 05, 2019 at 11:40:53PM -0400, Theodore Ts'o wrote: > On Fri, Jul 05, 2019 at 04:07:57PM +0800, Eryu Guan wrote: > > > +_require_scratch_inode_limits() > > > +{ > > > + _require_scratch > > > + _scratch_mkfs > /dev/null 2>&1 > > > + _scratch_mount > > > + if [ $(_get_free_inode $SCRATCH_MNT) -eq 0 ]; then > > > + _notrun "$FSTYP does not have a fixed number of inodes available" > > > + fi > > > + _scratch_unmount > > > +} > > > > I think testing against $TEST_DIR should be sufficient, so we could > > avoid the mkfs & mount & umount SCRATCH_DEV time. > > I was following the pattern that I saw with other similar _require > tests (for example: _require_scratch_shutdown). I *thought* the > reason why this is was done is because if the test only uses the > SCRATCH_DEV, there's no making it a requirement that TEST_DEV be > available --- since IIRC, we do support SCRATCH_DEV being available, > but not TEST_DEV. > > I personally don't use xfstests in that way --- when I run xfstests, > TEST_DEV is always available and in some cases, SCRATCH_DEV won't be > present. But I thought that's why _require_test exists --- so that > tests can be skipped if TEST_DEV does not exist. xfstests assumes TEST_DEV is always present and SCRATCH_DEV is optional (but recommended). _require_test not only checks if TEST_DEV is avaiable & properly mounted but also implies we should do fsck against TEST_DEV after test, as _require_test does "touch ${RESULT_DIR}/require_test" as well. Regarding to _require_scratch_xxx, that's usually because the requirement being checked might change when mkfs with different options. But a filesystem will always have a fixed number of inodes no matter what mkfs options it uses (the same is true for not having a fixed number of inodes). So in this case, I think check against TEST_DEV/TEST_DIR should be fine. Thanks, Eryu