Skip to contentSkip to conversation

xfstests: 083 make variable filesize as size in bytes

PATCH In review Eryu Guan 3 participants 5 messages Nov 4, 2011 Btrfs file system

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/2 xfstests: 083 make variable filesize as size in bytes

The first argument of _scratch_mkfs_sized() should be file system size in bytes, so '100m' is not a valid number, and the 'expr' expression in _scratch_mkfs_sized() complains 'non-numeric argument' about it.

---
 083 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
083 +1 -1
index 441284e..e0670b9 100755
@@ -91,7 +91,7 @@ workout()
 
 echo "*** test out-of-space handling for random write operations"
 
-filesize=100m
+filesize=`expr 100 \* 1024 \* 1024`
 agcount=6
 numprocs=15
 numops=1500
Signature · 6 lines
1.7.7.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#1 lore raw

PATCH 2/2 xfstests: meet btrfs fs size requirement in _scratch_mkfs_sized()

btrfs requires at least 256M file system size, so check 'fssize' in _scratch_mkfs_sized first and give it a proper value. Otherwise mkfs.btrfs will complain something like

"File system size 267386880 bytes is too small, 256M is required at least"

This makes 015 077 and 083 run on btrfs.

---
 common.rc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
common.rc +5 -0
index e948169..ab61786 100644
@@ -356,6 +356,11 @@ _scratch_mkfs_sized()
 	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
 	;;
     btrfs)
+    # btrfs needs at least 256M file system size
+	if [ $fssize -lt $((256*1024*1024)) ]
+	then
+		fssize=$((256*1024*1024))
+	fi
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
 	;;
     *)
Signature · 6 lines
1.7.7.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

Re: [PATCH 2/2] xfstests: meet btrfs fs size requirement in _scratch_mkfs_sized()

Quoted 7 lines · Eryu Guan

btrfs requires at least 256M file system size, so check 'fssize' in _scratch_mkfs_sized first and give it a proper value. Otherwise mkfs.btrfs will complain something like

"File system size 267386880 bytes is too small, 256M is required at least"

This makes 015 077 and 083 run on btrfs.

But it's not really going to test the ENOSPC conditions it was designed to exercise. It would be better to either find a way to make btrfs run on smaller filesystem, or call _notrun for too small filesystems on btrfs from _scratch_mkfs_sized.

Quoted 29 lines
---
 common.rc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
common.rc +5 -0
index e948169..ab61786 100644
@@ -356,6 +356,11 @@ _scratch_mkfs_sized()
 	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
 	;;
     btrfs)
+    # btrfs needs at least 256M file system size
+	if [ $fssize -lt $((256*1024*1024)) ]
+	then
+		fssize=$((256*1024*1024))
+	fi
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
 	;;
     *)
Signature · 6 lines
1.7.7.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

---end quoted text---

author
#3 lore raw

Re: [PATCH 2/2] xfstests: meet btrfs fs size requirement in _scratch_mkfs_sized()

On Fri, Nov 4, 2011 at 1:39 PM, Christoph Hellwig <[email protected]> w= rote:

Quoted 6 lines · Eryu Guan
Quoted 5 lines

btrfs requires at least 256M file system size, so check 'fssize' in _scratch_mkfs_sized first and give it a proper value. Otherwise mkfs.btrfs will complain something like

"File system size 267386880 bytes is too small, 256M is required at =

least"

Quoted 4 lines
Quoted 2 lines

This makes 015 077 and 083 run on btrfs.

But it's not really going to test the ENOSPC conditions it was design=

ed

Quoted 1 line

to exercise. =A0It would be better to either find a way to make btrfs=

run on

Quoted 1 line

smaller filesystem, or call _notrun for too small filesystems on btrf=

s

Quoted 1 line

from _scratch_mkfs_sized.

Yes, you're right. I checked 015 (it would dd zero to btrfs to full) bu= t forgot
to check 077 and 083.

I'll try to find a better way. Thanks for reviewing!

Eryu Guan

Quoted 7 lines
Quoted 7 lines

---
=A0common.rc | =A0 =A05 +++++
=A01 files changed, 5 insertions(+), 0 deletions(-)

Quoted 6 lines
Quoted 6 lines
common.rc +0 -0
index e948169..ab61786 100644
@@ -356,6 +356,11 @@ _scratch_mkfs_sized()

=A0 =A0 =A0 /sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_D=

EV $blocks

Quoted 13 lines
Quoted 13 lines

=A0 =A0 =A0 ;;
=A0 =A0 =A0btrfs)
+ =A0 =A0# btrfs needs at least 256M file system size
+ =A0 =A0 if [ $fssize -lt $((256*1024*1024)) ]
+ =A0 =A0 then
+ =A0 =A0 =A0 =A0 =A0 =A0 fssize=3D$((256*1024*1024))
+ =A0 =A0 fi
=A0 =A0 =A0 $MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV =A0 =A0 =A0 ;;
=A0 =A0 =A0*)
--
1.7.7.1

Quoted 6 lines
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

---end quoted text---

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Re: [PATCH 2/2] xfstests: meet btrfs fs size requirement in _scratch_mkfs_sized()

Quoted 7 lines · Eryu Guan
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Eryu Guan

btrfs requires at least 256M file system size, so check 'fssize' in _scratch_mkfs_sized first and give it a proper value. Otherwise mkfs.btrfs will complain something like

"File system size 267386880 bytes is too small, 256M is required at least"

Commit bd7d6d45 from Zhong, Xin <[email protected]> with date 6/21/2011 removed the 256MB size limitation in mkfs.c in btrfs-progs.

Quoted 39 lines
Quoted 7 lines
Quoted 2 lines

This makes 015 077 and 083 run on btrfs.

But it's not really going to test the ENOSPC conditions it was designed to exercise. It would be better to either find a way to make btrfs run on smaller filesystem, or call _notrun for too small filesystems on btrfs from _scratch_mkfs_sized.

Yes, you're right. I checked 015 (it would dd zero to btrfs to full) but forgot to check 077 and 083.

I'll try to find a better way. Thanks for reviewing!

Eryu Guan

Quoted 25 lines
Quoted 25 lines
---
 common.rc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
common.rc +5 -1
index e948169..ab61786 100644
@@ -356,6 +356,11 @@ _scratch_mkfs_sized()
      /sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
      ;;
     btrfs)
+    # btrfs needs at least 256M file system size
+     if [ $fssize -lt $((256*1024*1024)) ]
+     then
+             fssize=$((256*1024*1024))
+     fi
      $MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
      ;;
     *)
--

1.7.7.1