For bcachefs, def_blksz is never assigned even MKFS_OPTIONS contains option
'--block_size'. So block size of bcachefs on scratch dev is always 4096
if _scratch_mkfs_sized is called without second parameter.

Add the pattern to set def_blksz if '--block_size' is given in MKFS_OPTIONS.

Signed-off-by: Su Yue <[email protected]>
---
changelog:
v2:
    Born.
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/rc b/common/rc
index 31c21d2a8360..6a01de69cf05 100644
--- a/common/rc
+++ b/common/rc
@@ -950,6 +950,9 @@ _scratch_mkfs_sized()
        jfs)
                def_blksz=4096
                ;;
+       bcachefs)
+               def_blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*(--block_size)[ 
=]?+([0-9]+).*/\2/p'`
+               ;;
        esac
 
        [ -n "$def_blksz" ] && blocksize=$def_blksz
-- 
2.43.0


Reply via email to