Re: [PATCH v2 4/4] btrfs: introduce new "rescue=ignoresuperflags" mount option

From: Geert Uytterhoeven
Date: Wed Jul 10 2024 - 04:21:50 EST


Hi Qu,

On Fri, 14 Jun 2024, Qu Wenruo wrote:
This new mount option would allow the kernel to skip the super flags
check, it's mostly to allow the kernel to do a rescue mount of an
interrupted checksum conversion.

Reviewed-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>

Thanks for your patch, which is now commit cbc2bc70b8c22974 ("btrfs:
introduce new "rescue=ignoresuperflags" mount option") in next-20240709.

--- a/fs/btrfs/fs.h
+++ b/fs/btrfs/fs.h
@@ -226,6 +226,7 @@ enum {
BTRFS_MOUNT_NODISCARD = (1UL << 29),
BTRFS_MOUNT_NOSPACECACHE = (1UL << 30),
BTRFS_MOUNT_IGNOREMETACSUMS = (1UL << 31),
+ BTRFS_MOUNT_IGNORESUPERFLAGS = (1UL << 32),

"1UL" was changed to "1ULL" while applying, but that is not sufficient,
as all other mount flags handling still operates on "unsigned long",
which is 32-bit ont 32-bit platforms.

Hence noreply@xxxxxxxxxxxxxx reported several build failures on 32-bit
platforms (e.g. m68k[1]):

fs/btrfs/super.c:666:48: error: conversion from 'enum <anonymous>' to 'long unsigned int' changes value from '4294967296' to '0' [-Werror=overflow]

[1] http://kisskb.ellerman.id.au/kisskb/buildresult/15197832/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds