xfstests: routine to create scratch of certain size
PATCH 1/1 xfstests: routine to create scratch of certain size
This is needed for later enospc tests to be generic
---
common.rc +21 -0
@@ -237,6 +237,27 @@ _scratch_mkfs_options() echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV } +# arg 1 is size in bytes, arg 2 is (optional) blocksize +_scratch_mkfs_sized() +{ + fssz=$1 + bsz=$2 + [ -z "$bsz" ] && bsz=4096 + let blocks=$fssz/$bsz + + case $FSTYP in + xfs) + _scratch_mkfs_xfs -d size=$fssz -b size=$bsz 2>&1 >>$here/$seq.full + ;; + ext2|ext3|ext4) + /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS -b $bsz $SCRATCH_DEV $blocks 2>&1>>$here/$seq.full + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" + ;; + esac +} + _scratch_mkfs_xfs() { # extra mkfs options can be added by tests
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 23 lines · Eric Sandeen
This is needed for later enospc tests to be generic
Signed-off-by Eric Sandeen <[email protected]>---
common.rc +10
-0@@ -237,6 +237,27 @@ _scratch_mkfs_options() echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV } +# arg 1 is size in bytes, arg 2 is (optional) blocksize +_scratch_mkfs_sized() +{ + fssz=$1 + bsz=$2 + [ -z "$bsz" ] && bsz=4096 + let blocks=$fssz/$bsz + + case $FSTYP in + xfs)
common.rc _scratch_mkfs_options() · line 259
Quoted 10 lines
common.rc +10
-0+ _scratch_mkfs_xfs -d size=$fssz -b size=$bsz 2>&1 >>$here/$seq.full + ;; + ext2|ext3|ext4) + /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS -b $bsz $SCRATCH_DEV $blocks 2>&1>>$here/$seq.full + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" + ;; + esac +}
Looks good, the only questions is why you're using $MKFS_OPTIONS for extN, but not for xfs?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Eric Sandeen
This is needed for later enospc tests to be generic
Signed-off-by Eric Sandeen <[email protected]>---
...
Quoted 3 lines
Looks good, the only questions is why you're using $MKFS_OPTIONS for extN, but not for xfs?
Hm, oversight I guess. Will test w/ that.
Thanks,
-Eric
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 1/1 xfstests: routine to create scratch of certain size
In reply to Eric SandeenThis is needed for later enospc tests to be generic
---
V2: Address Christoph's comment about use of MKFS_OPTIONS; just do it like the other geom helper and explicitly -set- MKFS_OPTIONS for scratch, to set the size, then just call _scratch_mkfs
(this would override any global MKFS_OPTIONS setting, but I think that's ok for now, and not sure how these options might interact w/ previously set MKFS_OPTIONS anyway)
common.rc +23 -0
@@ -297,6 +297,29 @@ _scratch_mkfs() esac } +# Create fs of certain size on scratch device +# _scratch_mkfs_sized <size in bytes> [optional blocksize] +_scratch_mkfs_sized() +{ + fssize=$1 + blocksize=$2 + [ -z "$blocksize" ] && blocksize=4096 + let blocks=$fssize/$blocksize + + case $FSTYP in + xfs) + MKFS_OPTIONS="-d size=$fssize -b size=$blocksize" + ;; + ext2|ext3|ext4) + MKFS_OPTIONS="-b $blocksize $SCRATCH_DEV $blocks" + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" + ;; + esac + _scratch_mkfs +} + # Emulate an N-data-disk stripe w/ various stripe units # _scratch_mkfs_geom <sunit bytes> <swidth multiplier> [optional blocksize] _scratch_mkfs_geom()
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Eric Sandeen
This is needed for later enospc tests to be generic
Signed-off-by Eric Sandeen <[email protected]>---
Quoted 8 lines
V2: Address Christoph's comment about use of
MKFS_OPTIONS; just do it like the other geom helper and explicitly -set-MKFS_OPTIONSfor scratch, to set the size, then just call_scratch_mkfs(this would override any global
MKFS_OPTIONSsetting, but I think that's ok for now, and not sure how these options might interact w/ previously setMKFS_OPTIONSanyway)
Scratch that, I'm not being diligent enough and didn't test this :/ (yay for "simple" changes)
mke2fs takes the size arg at the end, after the device, so we cannot just set up MKFS_OPTIONS
Sorry for the noise.
-Eric (who will try to be more dilient now...)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs