public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs-progs: some zoned mkfs fixups
@ 2023-07-06 13:06 Josef Bacik
  2023-07-06 13:06 ` [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems Josef Bacik
  2023-07-06 13:06 ` [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system Josef Bacik
  0 siblings, 2 replies; 5+ messages in thread
From: Josef Bacik @ 2023-07-06 13:06 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Hello,

I'm trying to get the zoned block device tests running and I ran into an issue
of a long running test because scratch_mkfs_sized failed and we tried to fill up
a giant fs.  Fix up the error message and the math so this is correct.  Thanks,

Josef

Josef Bacik (2):
  btrfs-progs: print out the correct minimum size for zoned file systems
  btrfs-progs: set the proper minimum size for a zoned file system

 mkfs/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.41.0


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

* [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems
  2023-07-06 13:06 [PATCH 0/2] btrfs-progs: some zoned mkfs fixups Josef Bacik
@ 2023-07-06 13:06 ` Josef Bacik
  2023-07-06 14:30   ` Christoph Hellwig
  2023-07-06 13:06 ` [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system Josef Bacik
  1 sibling, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2023-07-06 13:06 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

While trying to get the ZNS testing running I ran into a problem with
making a small file system for one of the tests, but the error output
didn't make sense because it said the minimum size was 114294784 bytes,
and I was trying to make a file system of size 419430400 bytes.  The
problem here is that we were spitting out min_dev_size, which isn't the
minimum size for the ZNS configuration.  Fix the output to match the
actual size limit.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 mkfs/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 972ed111..e61ea959 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1446,7 +1446,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 		error("size %llu is too small to make a usable filesystem",
 			block_count);
 		error("minimum size for a zoned btrfs filesystem is %llu",
-			min_dev_size);
+			5 * zone_size(file));
 		goto error;
 	}
 
-- 
2.41.0


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

* [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system
  2023-07-06 13:06 [PATCH 0/2] btrfs-progs: some zoned mkfs fixups Josef Bacik
  2023-07-06 13:06 ` [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems Josef Bacik
@ 2023-07-06 13:06 ` Josef Bacik
  2023-07-06 14:31   ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2023-07-06 13:06 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

We currently limit the size of the file system to 5 * the zone size,
however we actually want to limit it to 7 * the zone size.  Fix up the
comment and the math to match our actual minimum zoned file system size.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 mkfs/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index e61ea959..a5af028c 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1441,12 +1441,14 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 	 * 1 zone for the system block group
 	 * 1 zone for a metadata block group
 	 * 1 zone for a data block group
+	 * 1 zone for a relocation block group
+	 * 1 zone for the tree log
 	 */
-	if (opt_zoned && block_count && block_count < 5 * zone_size(file)) {
+	if (opt_zoned && block_count && block_count < 7 * zone_size(file)) {
 		error("size %llu is too small to make a usable filesystem",
 			block_count);
 		error("minimum size for a zoned btrfs filesystem is %llu",
-			5 * zone_size(file));
+			7 * zone_size(file));
 		goto error;
 	}
 
-- 
2.41.0


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

* Re: [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems
  2023-07-06 13:06 ` [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems Josef Bacik
@ 2023-07-06 14:30   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-07-06 14:30 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system
  2023-07-06 13:06 ` [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system Josef Bacik
@ 2023-07-06 14:31   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-07-06 14:31 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Thu, Jul 06, 2023 at 09:06:57AM -0400, Josef Bacik wrote:
> +	if (opt_zoned && block_count && block_count < 7 * zone_size(file)) {
>  		error("size %llu is too small to make a usable filesystem",
>  			block_count);
>  		error("minimum size for a zoned btrfs filesystem is %llu",
> -			5 * zone_size(file));
> +			7 * zone_size(file));

Wouldn't it be useful to have a helper for this?  Yes, open coding it
only twice and right next to each other is probably ok, but I fear
we'll grow more uses.  And a helper is a really nice way to document
the details anyway.


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

end of thread, other threads:[~2023-07-06 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 13:06 [PATCH 0/2] btrfs-progs: some zoned mkfs fixups Josef Bacik
2023-07-06 13:06 ` [PATCH 1/2] btrfs-progs: print out the correct minimum size for zoned file systems Josef Bacik
2023-07-06 14:30   ` Christoph Hellwig
2023-07-06 13:06 ` [PATCH 2/2] btrfs-progs: set the proper minimum size for a zoned file system Josef Bacik
2023-07-06 14:31   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox