]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: fix blocksize detection for btrfs
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 11 Aug 2021 15:12:26 +0000 (00:12 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 15 Aug 2021 15:25:17 +0000 (23:25 +0800)
Mkfs.btrfs's "-b" does not specify the block size but the file system size.
Use "-s" to detect it instead.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index 4cb062e2fd3f254dc9b18cc121edbce618e298da..7b80820ff680ddfacf151c6aac2d914d6233d525 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -978,7 +978,10 @@ _scratch_mkfs_sized()
        xfs)
                def_blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*-b ?size= ?+([0-9]+).*/\1/p'`
                ;;
-       ext2|ext3|ext4|ext4dev|udf|btrfs|reiser4|ocfs2|reiserfs)
+       btrfs)
+               def_blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*-s ?+([0-9]+).*/\1/p'`
+               ;;
+       ext2|ext3|ext4|ext4dev|udf|reiser4|ocfs2|reiserfs)
                def_blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*-b ?+([0-9]+).*/\1/p'`
                ;;
        jfs)