All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] geneirc/077 fix min size for btrfs
@ 2018-10-11  3:26 Anand Jain
  2018-10-11  4:25 ` Darrick J. Wong
  2018-10-11  7:55 ` [PATCH v4] " Anand Jain
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2018-10-11  3:26 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs

If btrfs need to be tested at its default blockgroup which is non-mixed,
then it needs at least 256mb.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v2->v3:
	separated from the patch set of 9.
	notrun for the cases where filler is not big enough to fill the
		fssize.
v2->v1: ref the cover-letter of the set.

 tests/generic/077 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/generic/077 b/tests/generic/077
index ef6af18c83e3..784afe448940 100755
--- a/tests/generic/077
+++ b/tests/generic/077
@@ -13,7 +13,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1
-# Something w/ enough data to fill 50M of fs...
+# Something w/ enough data to fill 256M of fs...
 filler=/lib/modules/
 
 # fall back in case /lib/modules doesn't exist
@@ -38,6 +38,11 @@ _supported_os Linux
 
 [ ! -d $filler ] && _notrun "No directory to source files from"
 
+# check if two iterations of the assigned filler is big enough to fill fssize
+fs_size=$((256 * 1024 * 1024))
+[ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -lt 256 ] && \
+	_notrun "filler $filler isn't big enough to fill fssize $fssize"
+
 _require_scratch
 _require_attrs
 _require_acls
@@ -49,9 +54,7 @@ rm -f $seqres.full
 _scratch_unmount >/dev/null 2>&1
 echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
-SIZE=`expr 50 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
-	|| _fail "mkfs failed"
+_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
 _scratch_mount
 mkdir $SCRATCH_MNT/subdir
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] geneirc/077 fix min size for btrfs
  2018-10-11  3:26 [PATCH v3] geneirc/077 fix min size for btrfs Anand Jain
@ 2018-10-11  4:25 ` Darrick J. Wong
  2018-10-11  7:55   ` Anand Jain
  2018-10-11  7:55 ` [PATCH v4] " Anand Jain
  1 sibling, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2018-10-11  4:25 UTC (permalink / raw)
  To: Anand Jain; +Cc: fstests, linux-btrfs

On Thu, Oct 11, 2018 at 11:26:00AM +0800, Anand Jain wrote:
> If btrfs need to be tested at its default blockgroup which is non-mixed,
> then it needs at least 256mb.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> v2->v3:
> 	separated from the patch set of 9.
> 	notrun for the cases where filler is not big enough to fill the
> 		fssize.
> v2->v1: ref the cover-letter of the set.
> 
>  tests/generic/077 | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/077 b/tests/generic/077
> index ef6af18c83e3..784afe448940 100755
> --- a/tests/generic/077
> +++ b/tests/generic/077
> @@ -13,7 +13,7 @@ echo "QA output created by $seq"
>  here=`pwd`
>  tmp=/tmp/$$
>  status=1
> -# Something w/ enough data to fill 50M of fs...
> +# Something w/ enough data to fill 256M of fs...
>  filler=/lib/modules/
>  
>  # fall back in case /lib/modules doesn't exist
> @@ -38,6 +38,11 @@ _supported_os Linux
>  
>  [ ! -d $filler ] && _notrun "No directory to source files from"
>  
> +# check if two iterations of the assigned filler is big enough to fill fssize
> +fs_size=$((256 * 1024 * 1024))
> +[ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -lt 256 ] && \

Err... what does measuring /usr have to do with /lib/modules?

Also, /lib/modules is 58M on my test VM, which means that a 256M
filesystem isn't going to ENOSPC.

(Though weirdly it doesn't fail despite the lack of ENOSPC even at the
50M size, so I'm not sure what this test is actually supposed to do...)

--D

> +	_notrun "filler $filler isn't big enough to fill fssize $fssize"
> +
>  _require_scratch
>  _require_attrs
>  _require_acls
> @@ -49,9 +54,7 @@ rm -f $seqres.full
>  _scratch_unmount >/dev/null 2>&1
>  echo "*** MKFS ***"                         >>$seqres.full
>  echo ""                                     >>$seqres.full
> -SIZE=`expr 50 \* 1024 \* 1024`
> -_scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
> -	|| _fail "mkfs failed"
> +_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
>  _scratch_mount
>  mkdir $SCRATCH_MNT/subdir
>  
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] geneirc/077 fix min size for btrfs
  2018-10-11  4:25 ` Darrick J. Wong
@ 2018-10-11  7:55   ` Anand Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2018-10-11  7:55 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests, linux-btrfs



On 10/11/2018 12:25 PM, Darrick J. Wong wrote:
> On Thu, Oct 11, 2018 at 11:26:00AM +0800, Anand Jain wrote:
>> If btrfs need to be tested at its default blockgroup which is non-mixed,
>> then it needs at least 256mb.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> v2->v3:
>> 	separated from the patch set of 9.
>> 	notrun for the cases where filler is not big enough to fill the
>> 		fssize.
>> v2->v1: ref the cover-letter of the set.
>>
>>   tests/generic/077 | 11 +++++++----
>>   1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/generic/077 b/tests/generic/077
>> index ef6af18c83e3..784afe448940 100755
>> --- a/tests/generic/077
>> +++ b/tests/generic/077
>> @@ -13,7 +13,7 @@ echo "QA output created by $seq"
>>   here=`pwd`
>>   tmp=/tmp/$$
>>   status=1
>> -# Something w/ enough data to fill 50M of fs...
>> +# Something w/ enough data to fill 256M of fs...
>>   filler=/lib/modules/
>>   
>>   # fall back in case /lib/modules doesn't exist
>> @@ -38,6 +38,11 @@ _supported_os Linux
>>   
>>   [ ! -d $filler ] && _notrun "No directory to source files from"
>>   
>> +# check if two iterations of the assigned filler is big enough to fill fssize
>> +fs_size=$((256 * 1024 * 1024))
>> +[ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -lt 256 ] && \
> 
> Err... what does measuring /usr have to do with /lib/modules?

Ah. Thanks Darrick. Its a bug, I fixed it in v4.

> Also, /lib/modules is 58M on my test VM, which means that a 256M
> filesystem isn't going to ENOSPC.

  Yep as above its only checking for /usr its a bug fixed in v4.

Thanks, Anand

> (Though weirdly it doesn't fail despite the lack of ENOSPC even at the
> 50M size, so I'm not sure what this test is actually supposed to do...)
 >
> --D
> 
>> +	_notrun "filler $filler isn't big enough to fill fssize $fssize"
>> +
>>   _require_scratch
>>   _require_attrs
>>   _require_acls
>> @@ -49,9 +54,7 @@ rm -f $seqres.full
>>   _scratch_unmount >/dev/null 2>&1
>>   echo "*** MKFS ***"                         >>$seqres.full
>>   echo ""                                     >>$seqres.full
>> -SIZE=`expr 50 \* 1024 \* 1024`
>> -_scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
>> -	|| _fail "mkfs failed"
>> +_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
>>   _scratch_mount
>>   mkdir $SCRATCH_MNT/subdir
>>   
>> -- 
>> 1.8.3.1
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] geneirc/077 fix min size for btrfs
  2018-10-11  3:26 [PATCH v3] geneirc/077 fix min size for btrfs Anand Jain
  2018-10-11  4:25 ` Darrick J. Wong
@ 2018-10-11  7:55 ` Anand Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2018-10-11  7:55 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs

If btrfs need to be tested at its default blockgroup which is non-mixed,
then it needs at least 256mb.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v3->v4: fix the check for the /usr or /lib/modules size. Thanks Darrick.
v2->v3:
	separated from the patch set of 9.
	notrun for the cases where filler is not big enough to fill the
		fssize.
v2->v1: ref the cover-letter of the set.

 tests/generic/077 | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/tests/generic/077 b/tests/generic/077
index ef6af18c83e3..284e25253c9e 100755
--- a/tests/generic/077
+++ b/tests/generic/077
@@ -13,11 +13,18 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1
-# Something w/ enough data to fill 50M of fs...
-filler=/lib/modules/
 
-# fall back in case /lib/modules doesn't exist
-[ -d $filler ] || filler=/usr
+# Something w/ enough data to fill 256M of fs...
+filler=""
+[ -d /lib/modules ] && \
+	[ $(( $(du -h -m /lib/modules | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+	filler=/lib/modules
+
+# fall back in case /lib/modules doesn't exist or smaller
+[[ -z $filler ]] && \
+	[ -d /usr ] && \
+	[ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+	filler=/usr
 
 _cleanup()
 {
@@ -36,7 +43,7 @@ trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-[ ! -d $filler ] && _notrun "No directory to source files from"
+[ ! -d $filler ] && _notrun "No directory at least 256MB to source files from"
 
 _require_scratch
 _require_attrs
@@ -49,9 +56,8 @@ rm -f $seqres.full
 _scratch_unmount >/dev/null 2>&1
 echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
-SIZE=`expr 50 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
-	|| _fail "mkfs failed"
+fs_size=$((256 * 1024 * 1024))
+_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
 _scratch_mount
 mkdir $SCRATCH_MNT/subdir
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-11  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11  3:26 [PATCH v3] geneirc/077 fix min size for btrfs Anand Jain
2018-10-11  4:25 ` Darrick J. Wong
2018-10-11  7:55   ` Anand Jain
2018-10-11  7:55 ` [PATCH v4] " Anand Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.