On Wed, Dec 02, 2020 at 06:27:31PM +0800, Xiaoli Feng wrote: > From: Xiaoli Feng <xifeng@xxxxxxxxxx> > > For large block size, such as 64k, there're maybe leave more than 768k > space when disk is full. I met one. When I test 64k for dax. It leaves > about 800k space when disk is full. So change to jude the free block > for >4k fs. I'm not sure if that's a bug in the filesystem, and the test is designed to find such bugs. Would you please make sure if that's a bug or not first? Maybe by asking in proper mailing list. Thanks, Eryu > --- > tests/generic/275 | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/tests/generic/275 b/tests/generic/275 > index 3a016037..2c5a807f 100755 > --- a/tests/generic/275 > +++ b/tests/generic/275 > @@ -62,9 +62,16 @@ rm -f $SCRATCH_MNT/tmp1 > sync > echo "Post rm space:" >> $seqres.full > $DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1 > -_freespace=`$DF_PROG -k $SCRATCH_MNT | tail -n 1 | awk '{print $5}'` > -[ $_freespace -gt 1024 ] && _fail "could not sufficiently fill filesystem" > - > +bsize=$(_get_file_block_size $SCRATCH_MNT) > +bsize=$((bsize / 1024)) > +_freespace=`$DF_PROG -k $SCRATCH_MNT | tail -n 1 | awk '{print $5}'` > +# When block size is >4k, use the free counts of block to judge > +if [ "$bsize" -gt 4 ]; then > + _freeblock=$((_freespace / bsize)) > + [ "$_freeblock" -gt 256 ] && _fail "could not sufficiently fill filesystem" > +else > + [ "$_freespace" -gt 1024 ] && _fail "could not sufficiently fill filesystem" > +fi > # Try to write more than available space in chunks that will allow at least one > # full write to succeed. > dd if=/dev/zero of=$SCRATCH_MNT/tmp1 bs=128k count=8 >>$seqres.full 2>&1 > -- > 2.18.1