Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs.mkfs reports incorrect minimum size #70

Closed
WesleyAC opened this issue Oct 2, 2017 · 8 comments
Closed

btrfs.mkfs reports incorrect minimum size #70

WesleyAC opened this issue Oct 2, 2017 · 8 comments
Labels
Milestone

Comments

@WesleyAC
Copy link

WesleyAC commented Oct 2, 2017

If I run mkfs.btrfs on a disk that is less than 41943040 bytes, I get:

ERROR: 'test.img' is too small to make a usable filesystem
ERROR: minimum size for each btrfs device is 41943040

However, the actual minimum size seems to be much higher. Disks of up to 80MB in size report:

ERROR: not enough free space to allocate chunk

It seems like it would be more useful to report the size needed to successfully complete in the first message.

Checked on mkfs.btrfs, part of btrfs-progs v4.12.1.

@adam900710
Copy link
Collaborator

Are you using --rootdir option?

In that case, it will need extra space for the content.
The minimal size reported is just to make an empty, mountable fs with some spare space.

@WesleyAC
Copy link
Author

No, I wasn't using the --rootdir flag. The command was mkfs.btrfs filesystem.img.

@adam900710
Copy link
Collaborator

OK, this is a regression.

v4.0 btrfs-progs is still OK, I assume it's chunk allocator causing the problem.
Bisect under way.

@adam900710
Copy link
Collaborator

commit c11e36a
Author: Chandan Rajendra chandan@linux.vnet.ibm.com
Date: Wed Oct 14 23:09:37 2015 +0530

Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified

OK, that's because we're no longer forcing mixed block group for small filesystem.
While the minimal size calculation is still based on mixed block group.

I'll update the minimal size calculator to handle both mixed block group and current separate profiles.

@adam900710
Copy link
Collaborator

@WesleyAC
Patch sent. You could help review/ test the patch.
(Sorry, I just sent it to mail list)

https://patchwork.kernel.org/patch/10001161/
https://patchwork.kernel.org/patch/10001159/

@cmurf
Copy link

cmurf commented Nov 23, 2017

Possible related/dup bug.
https://bugzilla.kernel.org/show_bug.cgi?id=112461

@adam900710
Copy link
Collaborator

Will be addressed by pull request #66

@kdave
Copy link
Owner

kdave commented Nov 28, 2017

The mkfs and minimal size fixes have been merged to devel branch, this was an independent part of the #66 pull.

@kdave kdave closed this as completed Nov 28, 2017
@kdave kdave removed the new label Nov 28, 2017
@kdave kdave added this to the v4.14.1 milestone Nov 28, 2017
rli9 pushed a commit to intel/lkp-tests that referenced this issue Jan 12, 2021
This error is because the maintainer no longer forcing mixed block
group for small filesystem. While the minimal size calculation is
still based on mixed block group.

related link: kdave/btrfs-progs#70
related patch: "Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified"

before:
ERROR: 'raw.img' is too small to make a usable filesystem
ERROR: minimum size for each btrfs device is 114294784

after:
/result/xfstests/4HDD-btrfs-generic-logdev-ucode=0xe2/lkp-skl-d06/debian-10.4-x86_64-20200603.cgz/x86_64-rhel-8.3/gcc-9/3650b228f83adda7e5ee532e2b90429c03f7b9ec/1$ cat xfstests.json
{
  "xfstests.generic.487.skip": [
    1
  ]
}

Signed-off-by: Carel Si <beibei.si@intel.com>
Signed-off-by: Philip Li <philip.li@intel.com>
rli9 pushed a commit to intel/lkp-tests that referenced this issue Jan 22, 2021
…m" for btrfs

This error is because the maintainer no longer forcing mixed block
group for small filesystem. While the minimal size calculation is
still based on mixed block group.

Only btrfs need to add -M.

related link: kdave/btrfs-progs#70
related patch: "Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified"

before:
    ERROR: 'raw.img' is too small to make a usable filesystem
    ERROR: minimum size for each btrfs device is 114294784

after:
/result/xfstests/4HDD-btrfs-generic-logdev-ucode=0xe2/lkp-skl-d06/debian-10.4-x86_64-20200603.cgz/x86_64-$
    {
      "xfstests.generic.487.skip": [
        1
      ]
    }

Signed-off-by: Carel Si <beibei.si@intel.com>
Signed-off-by: Philip Li <philip.li@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants