[PATCH v2 02/13] common/rc: Fix fsx for ext4 with bigalloc

Ojaswin Mujoo
2025-06-26T11:59:36Z

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.

This is achieved by defining a new function _set_default_fsx_avoid
called via run_fsx helper. This can be used to selectively disable
fsx options based on the configuration.

Co-developed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
common/rc | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/common/rc b/common/rc
index 2f94a4f9..3cfa432d 100644
--- a/common/rc
+++ b/common/rc
@@ -5113,10 +5113,26 @@ _require_hugepage_fsx()
_notrun "fsx binary does not support MADV_COLLAPSE"
}

+_set_default_fsx_avoid() {
+ case "$FSTYP" in
+ "ext4")
+ if [[ "$MKFS_OPTIONS" =~ bigalloc ]]; then
+ export FSX_AVOID+=" -I -C"
+ fi
+ ;;
+ # Add other filesystem types here as needed
+ *)
+ ;;
+ esac
+}
+
_run_fsx()
{
echo "fsx $*"
local args=`echo $@ | sed -e "s/ BSIZE / $bsize /g" -e "s/ PSIZE / $psize /g"`
+
+ _set_default_fsx_avoid
+
set -- $FSX_PROG $args $FSX_AVOID $TEST_DIR/junk
echo "$@" >>$seqres.full
rm -f $TEST_DIR/junk
--
2.49.0