diff mbox series

mke2fs/ext2fs: remove check for casefold and encrypt

Message ID 20210924135630.550694-1-michael.adler@siemens.com
State Accepted
Headers show
Series mke2fs/ext2fs: remove check for casefold and encrypt | expand

Commit Message

Michael Adler Sept. 24, 2021, 1:56 p.m. UTC
This check is superfluous and in fact does more harm than good:

1) mke2fs.c does not compile on Debian Buster because
   ext2fs_has_feature_casefold is not available in libext2fs 1.44.5
2) SWUpdate only uses the default ext{2,3,4} settings, so the check is
   always false.
3) Linux 5.5+ supports having both features activated at the same time,
   which is also the reason why this check has been removed in libext2fs
   v1.45.7 (see [1])

[1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=23fc0e6e46f061175ef2af03538e137a490d17fb

Signed-off-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Michael Adler <michael.adler@siemens.com>
---
 fs/mke2fs.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Stefano Babic Sept. 24, 2021, 2:08 p.m. UTC | #1
On 24.09.21 15:56, Michael Adler wrote:
> This check is superfluous and in fact does more harm than good:
> 
> 1) mke2fs.c does not compile on Debian Buster because
>     ext2fs_has_feature_casefold is not available in libext2fs 1.44.5
> 2) SWUpdate only uses the default ext{2,3,4} settings, so the check is
>     always false.
> 3) Linux 5.5+ supports having both features activated at the same time,
>     which is also the reason why this check has been removed in libext2fs
>     v1.45.7 (see [1])
> 

Fully agree.

> [1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=23fc0e6e46f061175ef2af03538e137a490d17fb
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> Signed-off-by: Michael Adler <michael.adler@siemens.com>
> ---
>   fs/mke2fs.c | 8 --------
>   1 file changed, 8 deletions(-)
> 
> diff --git a/fs/mke2fs.c b/fs/mke2fs.c
> index 5751da4..1a3f1f3 100644
> --- a/fs/mke2fs.c
> +++ b/fs/mke2fs.c
> @@ -617,14 +617,6 @@ static int mkfs_prepare(const char *device_name, struct ext2_super_block *pfs_pa
>   			(unsigned long long) fs_blocks_count);
>   	}
>   
> -	if (ext2fs_has_feature_casefold(pfs_param) &&
> -	    ext2fs_has_feature_encrypt(pfs_param)) {
> -		ERROR("The encrypt and casefold features are not "
> -			  "compatible.\nThey can not be both enabled "
> -			  "simultaneously.");
> -		return -EINVAL;
> -	}
> -
>   	/* Don't allow user to set both metadata_csum and uninit_bg bits. */
>   	if (ext2fs_has_feature_metadata_csum(pfs_param) &&
>   	    ext2fs_has_feature_gdt_csum(pfs_param))
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/fs/mke2fs.c b/fs/mke2fs.c
index 5751da4..1a3f1f3 100644
--- a/fs/mke2fs.c
+++ b/fs/mke2fs.c
@@ -617,14 +617,6 @@  static int mkfs_prepare(const char *device_name, struct ext2_super_block *pfs_pa
 			(unsigned long long) fs_blocks_count);
 	}
 
-	if (ext2fs_has_feature_casefold(pfs_param) &&
-	    ext2fs_has_feature_encrypt(pfs_param)) {
-		ERROR("The encrypt and casefold features are not "
-			  "compatible.\nThey can not be both enabled "
-			  "simultaneously.");
-		return -EINVAL;
-	}
-
 	/* Don't allow user to set both metadata_csum and uninit_bg bits. */
 	if (ext2fs_has_feature_metadata_csum(pfs_param) &&
 	    ext2fs_has_feature_gdt_csum(pfs_param))