btrfs: support other sectorsizes in _scratch_mkfs_blocksized
authorAnand Jain <anand.jain@oracle.com>
Mon, 7 Jun 2021 12:08:19 +0000 (20:08 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 13 Jun 2021 15:07:14 +0000 (23:07 +0800)
When btrfs supports sectorsize != pagesize it can run these test cases
now,
generic/205 generic/206 generic/216 generic/217 generic/218 generic/220
generic/222 generic/227 generic/229 generic/238

This change is backward compatible for kernels without non pagesize
sectorsize support.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index a0aa730..6015407 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1124,6 +1124,15 @@ _scratch_mkfs_blocksized()
     fi
 
     case $FSTYP in
+    btrfs)
+       test -f /sys/fs/btrfs/features/supported_sectorsizes || \
+               _notrun "Subpage sectorsize support is not found in $FSTYP"
+
+       grep -wq $blocksize /sys/fs/btrfs/features/supported_sectorsizes || \
+               _notrun "$FSTYP does not support sectorsize=$blocksize yet"
+
+       _scratch_mkfs --sectorsize=$blocksize
+       ;;
     xfs)
        _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize
        ;;