All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <esandeen@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2] mke2fs: Warn if page size != blocksize when ecnrypt is enabled
Date: Wed, 21 Aug 2019 10:19:12 -0500	[thread overview]
Message-ID: <30492603-86b4-8ea4-4573-6c2c4db12237@redhat.com> (raw)
In-Reply-To: <20190821131813.9456-1-lczerner@redhat.com>

On 8/21/19 8:18 AM, Lukas Czerner wrote:
> With encrypt feature enabled the file system block size must match
> system page size. Currently mke2fs will not complain at all when we try
> to create a file system that does not satisfy this requirement for the
> system. Add a warning for this case.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

This matches the warnings we give for block size > system page size, for example,
so this makes sense to me.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  misc/mke2fs.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index d7cf257e..aa9590d8 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -2468,6 +2468,26 @@ profile_error:
>  		      exit (1);
>  	}
>  
> +	/*
> +	 * Encrypt feature requires blocksize to be the same as page size,
> +	 * otherwise file system won't mount
> +	 */
> +	if (ext2fs_has_feature_encrypt(&fs_param) &&
> +	   (blocksize != sys_page_size)) {
> +		if (!force) {
> +			com_err(program_name, 0,
> +				_("Encrypt feature is enabled, but block size "
> +				  "(%dB) does not match system page size "
> +				  "(%dB)"),
> +				blocksize, sys_page_size);
> +			proceed_question(proceed_delay);
> +		}
> +		fprintf(stderr,_("Warning: Encrypt feature enabled, but block "
> +				 "size (%dB) does not match system page size "
> +				 "(%dB), forced to continue\n"),
> +			blocksize, sys_page_size);
> +	}
> +
>  	/* Don't allow user to set both metadata_csum and uninit_bg bits. */
>  	if (ext2fs_has_feature_metadata_csum(&fs_param) &&
>  	    ext2fs_has_feature_gdt_csum(&fs_param))
> 

  parent reply	other threads:[~2019-08-21 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 13:18 [PATCH 1/2] mke2fs: Warn if page size != blocksize when ecnrypt is enabled Lukas Czerner
2019-08-21 13:18 ` [PATCH 2/2] tune2fs: Warn if page size != blocksize when enabling encrypt Lukas Czerner
2019-08-21 15:17   ` Eric Sandeen
2019-08-22  9:48     ` Lukas Czerner
2019-08-22 12:17   ` [PATCH v2 " Lukas Czerner
2019-10-03 13:48     ` Eric Sandeen
2019-08-21 15:19 ` Eric Sandeen [this message]
2019-10-03 12:51 ` [PATCH 1/2] mke2fs: Warn if page size != blocksize when ecnrypt is enabled Lukas Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30492603-86b4-8ea4-4573-6c2c4db12237@redhat.com \
    --to=esandeen@redhat.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.