diff mbox series

[B,SRU,1/1] ext4: fix mount failure with quota configured as module

Message ID 20200324091917.18702-2-po-hsu.lin@canonical.com
State New
Headers show
Series ext4: fix mount failure with quota configured as module | expand

Commit Message

Po-Hsu Lin March 24, 2020, 9:19 a.m. UTC
From: Jan Kara <jack@suse.cz>

BugLink: https://bugs.launchpad.net/bugs/1868665

When CONFIG_QFMT_V2 is configured as a module, the test in
ext4_feature_set_ok() fails and so mount of filesystems with quota or
project features fails. Fix the test to use IS_ENABLED macro which
works properly even for modules.

Link: https://lore.kernel.org/r/20200221100835.9332-1-jack@suse.cz
Fixes: d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
(cherry picked from commit 9db176bceb5c5df4990486709da386edadc6bd1d)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King March 24, 2020, 9:40 a.m. UTC | #1
On 24/03/2020 09:19, Po-Hsu Lin wrote:
> From: Jan Kara <jack@suse.cz>
> 
> BugLink: https://bugs.launchpad.net/bugs/1868665
> 
> When CONFIG_QFMT_V2 is configured as a module, the test in
> ext4_feature_set_ok() fails and so mount of filesystems with quota or
> project features fails. Fix the test to use IS_ENABLED macro which
> works properly even for modules.
> 
> Link: https://lore.kernel.org/r/20200221100835.9332-1-jack@suse.cz
> Fixes: d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Cc: stable@kernel.org
> (cherry picked from commit 9db176bceb5c5df4990486709da386edadc6bd1d)
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 93bc2d1..52e30fa 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2890,7 +2890,7 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
>  		return 0;
>  	}
>  
> -#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
> +#if !IS_ENABLED(CONFIG_QUOTA) || !IS_ENABLED(CONFIG_QFMT_V2)
>  	if (!readonly && (ext4_has_feature_quota(sb) ||
>  			  ext4_has_feature_project(sb))) {
>  		ext4_msg(sb, KERN_ERR,
> 

Thanks.

Acked-by: Colin Ian King <colin.king@canonical.com>
Andrea Righi March 24, 2020, 9:53 a.m. UTC | #2
On Tue, Mar 24, 2020 at 05:19:17PM +0800, Po-Hsu Lin wrote:
> From: Jan Kara <jack@suse.cz>
> 
> BugLink: https://bugs.launchpad.net/bugs/1868665
> 
> When CONFIG_QFMT_V2 is configured as a module, the test in
> ext4_feature_set_ok() fails and so mount of filesystems with quota or
> project features fails. Fix the test to use IS_ENABLED macro which
> works properly even for modules.
> 
> Link: https://lore.kernel.org/r/20200221100835.9332-1-jack@suse.cz
> Fixes: d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Cc: stable@kernel.org
> (cherry picked from commit 9db176bceb5c5df4990486709da386edadc6bd1d)
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 93bc2d1..52e30fa 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2890,7 +2890,7 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
>  		return 0;
>  	}
>  
> -#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
> +#if !IS_ENABLED(CONFIG_QUOTA) || !IS_ENABLED(CONFIG_QFMT_V2)
>  	if (!readonly && (ext4_has_feature_quota(sb) ||
>  			  ext4_has_feature_project(sb))) {
>  		ext4_msg(sb, KERN_ERR,
> -- 
> 2.7.4

Looks good to me.

Acked-by: Andrea Righi <andrea.righi@canonical.com>
Kleber Sacilotto de Souza March 24, 2020, 9:54 a.m. UTC | #3
On 2020-03-24 10:19, Po-Hsu Lin wrote:
> From: Jan Kara <jack@suse.cz>
> 
> BugLink: https://bugs.launchpad.net/bugs/1868665
> 
> When CONFIG_QFMT_V2 is configured as a module, the test in
> ext4_feature_set_ok() fails and so mount of filesystems with quota or
> project features fails. Fix the test to use IS_ENABLED macro which
> works properly even for modules.
> 
> Link: https://lore.kernel.org/r/20200221100835.9332-1-jack@suse.cz
> Fixes: d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Cc: stable@kernel.org
> (cherry picked from commit 9db176bceb5c5df4990486709da386edadc6bd1d)
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>

Clean cherry pick, fixed on stable as well.

Thanks,

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 93bc2d1..52e30fa 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2890,7 +2890,7 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
>  		return 0;
>  	}
>  
> -#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
> +#if !IS_ENABLED(CONFIG_QUOTA) || !IS_ENABLED(CONFIG_QFMT_V2)
>  	if (!readonly && (ext4_has_feature_quota(sb) ||
>  			  ext4_has_feature_project(sb))) {
>  		ext4_msg(sb, KERN_ERR,
>
diff mbox series

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 93bc2d1..52e30fa 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2890,7 +2890,7 @@  static int ext4_feature_set_ok(struct super_block *sb, int readonly)
 		return 0;
 	}
 
-#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
+#if !IS_ENABLED(CONFIG_QUOTA) || !IS_ENABLED(CONFIG_QFMT_V2)
 	if (!readonly && (ext4_has_feature_quota(sb) ||
 			  ext4_has_feature_project(sb))) {
 		ext4_msg(sb, KERN_ERR,