linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Anand Jain <anand.jain@oracle.com>,
	fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 1/9] fstests: btrfs: _scratch_mkfs_sized fix min size without mixed option
Date: Thu, 27 Sep 2018 13:07:55 -0700	[thread overview]
Message-ID: <20180927200755.GC29754@vader> (raw)
In-Reply-To: <b6a81bfa-66f6-89e3-3c1e-2d5396f8bbf4@suse.com>

On Wed, Sep 26, 2018 at 09:34:27AM +0300, Nikolay Borisov wrote:
> 
> 
> On 26.09.2018 07:07, Anand Jain wrote:
> > 
> > 
> > On 09/25/2018 06:51 PM, Nikolay Borisov wrote:
> >>
> >>
> >> On 25.09.2018 07:24, Anand Jain wrote:
> >>> As of now _scratch_mkfs_sized() checks if the requested size is below 1G
> >>> and forces the --mixed option for the mkfs.btrfs. Well the correct size
> >>> considering all possible group profiles at which we need to force the
> >>> mixed option is roughly 256Mbytes. So fix that.
> >>>
> >>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> >>
> >> Have you considered the implications of this w.r.t commit
> >> d4da414a9a9d ("common/rc: raise btrfs mixed mode threshold to 1GB")
> >>
> >> Initially this threshold was 100mb then Omar changed it to 1g. Does this
> >> change affect generic/427?
> > 
> > d4da414a9a9d does not explain what was the problem that Omar wanted to
> > address, mainly what was the failure about.
> 
> I just retested on upstream 4.19.0-rc3 with Omar's patch reverted (so
> anything above 100m for fs size is created with non-mixed block groups)
> and the test succeeded. So indeed your change seems to not make a
> difference for this test.
> 
> > 
> > And no it does not affect. I have verified generic/427 with kernel 4.1
> > and 4.19-rc5 with  btrfs-progs 4.1, 4.9 and latest from kdave they all
> > run fine. Good to integrate.

I had to double check, but it only happens with -m dup. If I apply the
following patch:

diff --git a/common/rc b/common/rc
index d5bb1fe..989b846 100644
--- a/common/rc
+++ b/common/rc
@@ -969,7 +969,7 @@ _scratch_mkfs_sized()
 	;;
     btrfs)
 	local mixed_opt=
-	(( fssize <= 1024 * 1024 * 1024 )) && mixed_opt='--mixed'
+	(( fssize <= 100 * 1024 * 1024 )) && mixed_opt='--mixed'
 	$MKFS_BTRFS_PROG $MKFS_OPTIONS $mixed_opt -b $fssize $SCRATCH_DEV
 	;;
     jfs)
diff --git a/tests/generic/427 b/tests/generic/427
index e8ebffe..206cf08 100755
--- a/tests/generic/427
+++ b/tests/generic/427
@@ -65,6 +65,7 @@ fi
 # start a background aio writer, which does several extending loops
 # internally and check data integrality
 $AIO_TEST -s $fsize -b 65536 $SCRATCH_MNT/tst-aio-dio-eof-race.$seq
+btrfs fi usage $SCRATCH_MNT
 status=$?
 
 kill $open_close_pid

And run with MKFS_OPTIONS="-m dup", then we don't have enough data space
for the test:

--- /root/linux/xfstests/tests/generic/427.out	2017-11-28 16:05:46.811435644 -0800
+++ /root/linux/xfstests/results/generic/427.out.bad	2018-09-27 13:01:00.540510385 -0700
@@ -1,2 +1,24 @@
 QA output created by 427
-Success, all done.
+pwrite: No space left on device
+Overall:
+    Device size:		 256.00MiB
+    Device allocated:		 255.00MiB
+    Device unallocated:		   1.00MiB
+    Device missing:		     0.00B
+    Used:			 179.03MiB
+    Free (estimated):		     0.00B	(min: 0.00B)
+    Data ratio:			      1.00
+    Metadata ratio:		      2.00
+    Global reserve:		  16.00MiB	(used: 0.00B)
+
+Data,single: Size:175.00MiB, Used:175.00MiB
+   /dev/nvme0n1p2	 175.00MiB
+
+Metadata,DUP: Size:32.00MiB, Used:2.00MiB
+   /dev/nvme0n1p2	  64.00MiB
+
+System,DUP: Size:8.00MiB, Used:16.00KiB
+   /dev/nvme0n1p2	  16.00MiB
+
+Unallocated:
+   /dev/nvme0n1p2	   1.00MiB

  parent reply	other threads:[~2018-09-27 20:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  4:24 [PATCH v2 0/9] Fix _scratch_mkfs_sized() for btrfs Anand Jain
2018-09-25  4:24 ` [PATCH v2 1/9] fstests: btrfs: _scratch_mkfs_sized fix min size without mixed option Anand Jain
2018-09-25 10:51   ` Nikolay Borisov
2018-09-26  4:07     ` Anand Jain
2018-09-26  6:34       ` Nikolay Borisov
2018-09-26  6:37         ` Anand Jain
2018-09-27 20:07         ` Omar Sandoval [this message]
2018-09-28 13:23           ` Anand Jain
2018-09-25  4:24 ` [PATCH v2 2/9] generic/015 fix to test the default non-mixed mode Anand Jain
2018-09-25 10:55   ` Nikolay Borisov
2018-09-25  4:24 ` [PATCH v2 3/9] geneirc/077 fix min size for btrfs Anand Jain
2018-10-06 11:25   ` Eryu Guan
2018-10-11  3:14     ` Anand Jain
2018-10-11  3:27       ` Anand Jain
2018-09-25  4:24 ` [PATCH v2 4/9] generic/083 fix btrfs fs size for default mode Anand Jain
2018-09-25  4:24 ` [PATCH v2 5/9] generic/102 open code dev_size _scratch_mkfs_sized() Anand Jain
2018-09-25 10:54   ` Nikolay Borisov
2018-09-26  4:08     ` Anand Jain
2018-10-07 15:18       ` Eryu Guan
2018-09-25  4:24 ` [PATCH v2 6/9] generic/204 open code SIZE for _scratch_mkfs_sized() Anand Jain
2018-09-25  4:24 ` [PATCH v2 7/9] generic/312 open code fs_size _scratch_mkfs_sized() Anand Jain
2018-09-25  4:24 ` [PATCH v2 8/9] generic/449 fix fs size for _scratch_mkfs_sized for btrfs Anand Jain
2018-09-25  4:24 ` [PATCH v2 9/9] generic/387 fix _scratch_mkfs_sized option " Anand Jain
2018-09-25  6:42 ` [PATCH v2 0/9] Fix _scratch_mkfs_sized() " Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180927200755.GC29754@vader \
    --to=osandov@osandov.com \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).