mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/273: Remove hard coded block size
The space occupied by files in the 'origin' directory is calculated with the assumption that 4k is the block size of the underlying filesystem. This causes the test to fail with ENOSPC errors when running on filesystems with larger block sizes. To fix the issue, this commit makes use of the the block size obtained from the mounted filesystem. Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
9ad045acc8
commit
9cafe2a12d
+5
-3
@@ -57,6 +57,7 @@ _threads_set()
|
|||||||
|
|
||||||
_file_create()
|
_file_create()
|
||||||
{
|
{
|
||||||
|
block_size=$1
|
||||||
_i=0
|
_i=0
|
||||||
|
|
||||||
if ! mkdir $SCRATCH_MNT/origin
|
if ! mkdir $SCRATCH_MNT/origin
|
||||||
@@ -70,11 +71,11 @@ _file_create()
|
|||||||
|
|
||||||
_disksize=`$DF_PROG -B 1 $SCRATCH_MNT | tail -1 | $AWK_PROG '{ print $5 }'`
|
_disksize=`$DF_PROG -B 1 $SCRATCH_MNT | tail -1 | $AWK_PROG '{ print $5 }'`
|
||||||
_disksize=$(($_disksize / 3))
|
_disksize=$(($_disksize / 3))
|
||||||
_num=$(($_disksize / $count / $threads / 4096))
|
_num=$(($_disksize / $count / $threads / $block_size))
|
||||||
_count=$count
|
_count=$count
|
||||||
while [ $_i -lt $_num ]
|
while [ $_i -lt $_num ]
|
||||||
do
|
do
|
||||||
dd if=/dev/zero of=file_$_i bs=4096 count=$_count >/dev/null 2>&1
|
dd if=/dev/zero of=file_$_i bs=$block_size count=$_count >/dev/null 2>&1
|
||||||
_i=$(($_i + 1))
|
_i=$(($_i + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -105,9 +106,10 @@ _do_workload()
|
|||||||
{
|
{
|
||||||
_pids=""
|
_pids=""
|
||||||
_pid=1
|
_pid=1
|
||||||
|
block_size=$(get_block_size $SCRATCH_MNT)
|
||||||
|
|
||||||
_threads_set
|
_threads_set
|
||||||
_file_create
|
_file_create $block_size
|
||||||
|
|
||||||
_threads=$threads
|
_threads=$threads
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user