btrfs-progs: convert, warn if converting a fs which won't mount

On aarch64 with pagesize 64k, btrfs-convert of ext4 is successful,
but it won't mount because we don't yet support subpage blocksize, ie.
when page size and sectorsize don't match.

 BTRFS error (device vda): sectorsize 4096 not supported yet, only support 65536

So in this case during convert provide a warning but let the conversion
proceed.

Example:

WARNING: Blocksize 4096 is not equal to the pagesize 65536,
         converted filesystem won't mount on this system.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Anand Jain 2020-03-04 23:22:05 +08:00 committed by David Sterba
parent 41ff76b833
commit fae40e9d73
1 changed files with 5 additions and 0 deletions

View File

@ -1140,6 +1140,11 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
error("block size is too small: %u < 4096", blocksize);
goto fail;
}
if (blocksize != getpagesize())
warning(
"blocksize %u is not equal to the page size %u, converted filesystem won't mount on this system",
blocksize, getpagesize());
if (btrfs_check_nodesize(nodesize, blocksize, features))
goto fail;
fd = open(devname, O_RDWR);