Re: [PATCH 0/2] btrfs-progs: prevent mkfs from aborting with small volume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/23/13 1:28 AM, Hidetoshi Seto wrote:
> I found that mkfs.btrfs aborts when one of assigned volume is too small.
> Here are 2 patches to fix 2 independent problems.
> Both are based on top of Chris's btrfs-progs.git:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
> 
> Thanks,
> H.Seto
> 

Thanks for looking into this - how small of a device did you test?

I tried a 2MB device w/ these 2 patches and still got:

[btrfs-progs]# truncate --size=2m testfile
[btrfs-progs]# ./mkfs.btrfs testfile

WARNING! - Btrfs v0.20-rc1-360-geeeb4e9 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

SMALL VOLUME: forcing mixed metadata/data groups
mkfs.btrfs: volumes.c:857: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted (core dumped)

which was at:

                ret = btrfs_alloc_dev_extent(trans, device,
                             info->chunk_root->root_key.objectid,
                             BTRFS_FIRST_CHUNK_TREE_OBJECTID, key.offset,
                             calc_size, &dev_offset);
                BUG_ON(ret);

:(

Also, I'm curious - I know the code existed before your patch 2/2,
but I don't understand why it reserves 1MB for the first superblock 
when the first superblock is actually at 64k.  Any idea?

-Eric


> Hidetoshi Seto (2):
>       btrfs-progs: treat reserved 1MB for superblock properly
>       btrfs-progs: exit if there is not enough free space for mkfs
> 
>  ctree.h   |    3 +++
>  mkfs.c    |    4 ++++
>  volumes.c |    7 ++++++-
>  3 files changed, 13 insertions(+), 1 deletions(-)
> 

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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux