From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org, dsterba@suse.cz
Subject: Re: [PATCH 1/2] btrfs-progs: mkfs: Fix minimal device size calculation for new temporary chunk layout
Date: Wed, 24 Jan 2018 11:40:45 +0200 [thread overview]
Message-ID: <61695dbe-d1f4-f2b2-0afc-df118c9547db@suse.com> (raw)
In-Reply-To: <20180124023830.26184-1-wqu@suse.com>
On 24.01.2018 04:38, Qu Wenruo wrote:
> Commit 0b2161becf8e ("btrfs-progs: mkfs: Prevent temporary system chunk
> to use space in reserved 1M range") changed the hard-coded temporary
> chunk layout to avoid the first 1M.
>
> However this also affects btrfs_min_dev_size() which still assume
> temporary chunks starts at device offset 0.
>
> This patch will fix it.
>
> Fixes: 0b2161becf8e ("btrfs-progs: mkfs: Prevent temporary system chunk
> to use space in reserved 1M range")
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
> mkfs/common.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/mkfs/common.c b/mkfs/common.c
> index 5c5e9c3b9e01..8e85942ef4eb 100644
> --- a/mkfs/common.c
> +++ b/mkfs/common.c
> @@ -483,6 +483,8 @@ u64 btrfs_min_dev_size(u32 nodesize, int mixed, u64 meta_profile,
>
> /*
> * Minimal size calculation is complex due to several factors:
> + * 0) Reserved 1M range.
> + *
> * 1) Temporary chunk reuse
> * If specified chunk profile is SINGLE, we can reuse
> * temporary chunks, no need to allocate new chunks.
> @@ -501,7 +503,8 @@ u64 btrfs_min_dev_size(u32 nodesize, int mixed, u64 meta_profile,
> * The latter two are all 8M, accroding to @calc_size of
> * btrfs_alloc_chunk().
> */
> - reserved += BTRFS_MKFS_SYSTEM_GROUP_SIZE + SZ_8M * 2;
> + reserved += BTRFS_BLOCK_RESERVED_1M_FOR_SUPER +
> + BTRFS_MKFS_SYSTEM_GROUP_SIZE + SZ_8M * 2;
>
> /*
> * For real chunks, we need to select different sizes:
>
next prev parent reply other threads:[~2018-01-24 9:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 2:38 [PATCH 1/2] btrfs-progs: mkfs: Fix minimal device size calculation for new temporary chunk layout Qu Wenruo
2018-01-24 2:38 ` [PATCH 2/2] btrfs-progs: test-mkfs: Output minimal device size Qu Wenruo
2018-01-24 9:40 ` Nikolay Borisov [this message]
2018-01-25 18:25 ` [PATCH 1/2] btrfs-progs: mkfs: Fix minimal device size calculation for new temporary chunk layout David Sterba
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=61695dbe-d1f4-f2b2-0afc-df118c9547db@suse.com \
--to=nborisov@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@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).