diff mbox series

btrfs-progs: fsfeatures: hide RST behind experimental builds

Message ID a45bd8eb8d16b648368b2e83f12a72ea44dab71c.1713937746.git.wqu@suse.com (mailing list archive)
State New
Headers show
Series btrfs-progs: fsfeatures: hide RST behind experimental builds | expand

Commit Message

Qu Wenruo April 24, 2024, 5:49 a.m. UTC
[BUG]
There is a report that with v6.7.1 btrfs-progs, `mkfs.btrfs -O rst`, but
kernel 6.7/6.8 are unable to mount it at all.

[CAUSE]
Although the feature string states the raid-stripe-tree feature is
supported since v6.7 kernel, it's not correct.
Only debug kernel with CONFIG_BTRFS_DEBUG would support the RST feature.

Thus RST is still considered experimental.

[FIX]
Move the RST mkfs features back to experimental.

This patch would only hide the RST features from 'mkfs -O' options, the
existing supporting code for RST would still be there, thus
non-experimental build of `btrfs check` can still verify a btrfs with
RST.

Reported-by: HAN Yuwei <hrx@bupt.moe>
Fixes: b421fdff9574 ("btrfs-progs: move raid-stripe-tree and squota build out of experimental")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 common/fsfeatures.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn April 24, 2024, 7:48 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Although I thought that you need to configure btrfs-progs with 
--enable-experimental to get RST support :/
Goffredo Baroncelli April 24, 2024, 7:30 p.m. UTC | #2
On 24/04/2024 07.49, Qu Wenruo wrote:
> [BUG]
> There is a report that with v6.7.1 btrfs-progs, `mkfs.btrfs -O rst`, but
> kernel 6.7/6.8 are unable to mount it at all.
>
> [CAUSE]
> Although the feature string states the raid-stripe-tree feature is
> supported since v6.7 kernel, it's not correct.
> Only debug kernel with CONFIG_BTRFS_DEBUG would support the RST feature.
>
> Thus RST is still considered experimental.
>
> [FIX]
> Move the RST mkfs features back to experimental.
>
> This patch would only hide the RST features from 'mkfs -O' options, the
> existing supporting code for RST would still be there, thus
> non-experimental build of `btrfs check` can still verify a btrfs with
> RST.
>
> Reported-by: HAN Yuwei <hrx@bupt.moe>
> Fixes: b421fdff9574 ("btrfs-progs: move raid-stripe-tree and squota build out of experimental")
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>   common/fsfeatures.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/common/fsfeatures.c b/common/fsfeatures.c
> index c5e81629ccea..7aaddab6a192 100644
> --- a/common/fsfeatures.c
> +++ b/common/fsfeatures.c
> @@ -222,6 +222,7 @@ static const struct btrfs_feature mkfs_features[] = {
>   		VERSION_NULL(default),
>   		.desc		= "block group tree, more efficient block group tracking to reduce mount time"
>   	},
> +#if EXPERIMENTAL
>   	{
>   		.name		= "rst",
>   		.incompat_flag	= BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE,
> @@ -238,6 +239,7 @@ static const struct btrfs_feature mkfs_features[] = {
>   		VERSION_NULL(default),
>   		.desc		= "raid stripe tree, enhanced file extent tracking"
>   	},
> +#endif
>   	{
>   		.name		= "squota",
>   		.incompat_flag	= BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA,

I am bit confused.

The Han report say that the problem is due to the fact that the option is enabled by *default*.

So way we should remove (from the binary) this option at all ? Shouldn't be enough to remove it from the options enabled by default  ?

Something like:

-        VERSION_TO_STRING2(compat, 6,7),
-        VERSION_NULL(safe),

+       VERSION_NULL(compat),

+        VERSION_TO_STRING2(safe, 6,7),
Goffredo Baroncelli April 24, 2024, 7:58 p.m. UTC | #3
On 24/04/2024 21.30, Goffredo Baroncelli wrote:
> On 24/04/2024 07.49, Qu Wenruo wrote:
>> [BUG]
>> There is a report that with v6.7.1 btrfs-progs, `mkfs.btrfs -O rst`, but
>> kernel 6.7/6.8 are unable to mount it at all.
>>
>> [CAUSE]
>> Although the feature string states the raid-stripe-tree feature is
>> supported since v6.7 kernel, it's not correct.
>> Only debug kernel with CONFIG_BTRFS_DEBUG would support the RST feature.
>>
>> Thus RST is still considered experimental.
>>
>> [FIX]
>> Move the RST mkfs features back to experimental.
>>
>> This patch would only hide the RST features from 'mkfs -O' options, the
>> existing supporting code for RST would still be there, thus
>> non-experimental build of `btrfs check` can still verify a btrfs with
>> RST.
>>
>> Reported-by: HAN Yuwei <hrx@bupt.moe>
>> Fixes: b421fdff9574 ("btrfs-progs: move raid-stripe-tree and squota build out of experimental")
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>>   common/fsfeatures.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/common/fsfeatures.c b/common/fsfeatures.c
>> index c5e81629ccea..7aaddab6a192 100644
>> --- a/common/fsfeatures.c
>> +++ b/common/fsfeatures.c
>> @@ -222,6 +222,7 @@ static const struct btrfs_feature mkfs_features[] = {
>>           VERSION_NULL(default),
>>           .desc        = "block group tree, more efficient block group tracking to reduce mount time"
>>       },
>> +#if EXPERIMENTAL
>>       {
>>           .name        = "rst",
>>           .incompat_flag    = BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE,
>> @@ -238,6 +239,7 @@ static const struct btrfs_feature mkfs_features[] = {
>>           VERSION_NULL(default),
>>           .desc        = "raid stripe tree, enhanced file extent tracking"
>>       },
>> +#endif
>>       {
>>           .name        = "squota",
>>           .incompat_flag    = BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA,
> 
> I am bit confused.

Ignore this email.

> 
> The Han report say that the problem is due to the fact that the option is enabled by *default*.
> 
> So way we should remove (from the binary) this option at all ? Shouldn't be enough to remove it from the options enabled by default  ?
> 
> Something like:
> 
> -        VERSION_TO_STRING2(compat, 6,7),
> -        VERSION_NULL(safe),
> 
> +       VERSION_NULL(compat),
> 
> +        VERSION_TO_STRING2(safe, 6,7),
> 
>
diff mbox series

Patch

diff --git a/common/fsfeatures.c b/common/fsfeatures.c
index c5e81629ccea..7aaddab6a192 100644
--- a/common/fsfeatures.c
+++ b/common/fsfeatures.c
@@ -222,6 +222,7 @@  static const struct btrfs_feature mkfs_features[] = {
 		VERSION_NULL(default),
 		.desc		= "block group tree, more efficient block group tracking to reduce mount time"
 	},
+#if EXPERIMENTAL
 	{
 		.name		= "rst",
 		.incompat_flag	= BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE,
@@ -238,6 +239,7 @@  static const struct btrfs_feature mkfs_features[] = {
 		VERSION_NULL(default),
 		.desc		= "raid stripe tree, enhanced file extent tracking"
 	},
+#endif
 	{
 		.name		= "squota",
 		.incompat_flag	= BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA,