On Wed, Jun 11, 2025 at 03:04:44PM +0530, Ojaswin Mujoo wrote: > From: "Ritesh Harjani (IBM)" <ritesh.list@xxxxxxxxx> > > Insert range and collapse range only works with bigalloc in case > the range is cluster size aligned, which fsx doesnt take care. To > work past this, disable insert range and collapse range on ext4, if > bigalloc is enabled. Hmmm, insert/collapse-range have the same behavior on xfs realtime, maybe we should amend test() in fsx to round to the allocation unit size? Querying that programmatically might be ... interesting though. Is there a good way to do that for ext4 bigalloc? (See detect_xfs_alloc_unit in punch-alternating.c) --D > This is achieved by defining a new function _setup_fs_options > which can serve as a mechanism to apply FS-wide options to > the tests. > > Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx> > Signed-off-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx> > --- > common/preamble | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/common/preamble b/common/preamble > index ba029a34..2bccff74 100644 > --- a/common/preamble > +++ b/common/preamble > @@ -24,6 +24,20 @@ _register_cleanup() > trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* > } > > +# setup FS options only to be available for each test run > +_setup_fs_options() { > + case "$FSTYP" in > + "ext4") > + if [[ "$MKFS_OPTIONS" =~ bigalloc ]]; then > + export FSX_AVOID="-I -C" > + fi > + ;; > + # Add other filesystem types here as needed > + *) > + ;; > + esac > +} > + > # Prepare to run a fstest by initializing the required global variables to > # their defaults, sourcing common functions, registering a cleanup function, > # and removing the $seqres.full file. > @@ -55,4 +69,6 @@ _begin_fstest() > # remove previous $seqres.full before test > rm -f $seqres.full $seqres.hints > > + # setup filesystem options for a given test execution > + _setup_fs_options > } > -- > 2.49.0 > >