Skip to contentSkip to conversation

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

PATCH In review Anand Jain 2 participants 2 messages Mar 4, 2020 – Mar 6, 2020 Btrfs file system

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH v2 1/1 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/ sectorsize.

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

So in this case during convert provide a warning.

For example:

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

---
v2: Drop the delay part. Update the change log.

 convert/main.c | 5 +++++
 1 file changed, 5 insertions(+)
convert/main.c +5 -0
index a04ec7a36abf..5b2979e3e1e6 100644
@@ -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 pagesize %u,\n\
+         converted filesystem won't mount on this system.",
+			blocksize, getpagesize());
+
 	if (btrfs_check_nodesize(nodesize, blocksize, features))
 		goto fail;
 	fd = open(devname, O_RDWR);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Anand Jain

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

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

So in this case during convert provide a warning.

Quoted 7 lines

For example:

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

---

Added to devel, thanks.