public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yury V. Zaytsev" <yury@shurup.com>
To: Ted Ts'o <tytso@mit.edu>
Cc: Amir Goldstein <amir73il@gmail.com>,
	Mike Snitzer <snitzer@redhat.com>,
	linux-ext4@vger.kernel.org
Subject: Re: [PATCH] mke2fs: check that auto-detected blocksize <= sys_page_size
Date: Fri, 01 Jul 2011 10:31:38 +0200	[thread overview]
Message-ID: <1309509098.4859.12.camel@newpride> (raw)
In-Reply-To: <1307918791.2872.18.camel@newpride>

Hi!

On Mon, 2011-06-13 at 00:46 +0200, Yury V. Zaytsev wrote:

> I have refreshed patch against the latest "next" branch since it no
> longer properly applied and hopefully it can now be included!

I would highly appreciate if the trivial patch that nonetheless fixes an
important issue to my mind posted last month could be looked at.

Is there anything else I could do to help with the inclusion? Sorry if I
am bumping the thread too fast, but I see other patches flowing in which
makes me think that I've done something wrong; if this is the case
please do let me know, I am willing to rectify it.

Thanks!

-- 
Sincerely yours,
Yury V. Zaytsev

> From 1f8e5ad235694f2918fb442135619d4988366434 Mon Sep 17 00:00:00 2001
> From: "Yury V. Zaytsev" <yury@shurup.com>
> Date: Mon, 13 Jun 2011 00:35:05 +0200
> Subject: [PATCH] mke2fs: check that auto-detected blocksize <= sys_page_size
> 
> Block size can be specified manually via the -b option or deduced
> automatically. Unfortunately, the check that it is still smaller than
> the system page size is only performed right after the command line
> options are parsed.
> 
> Therefore, if buggy or inappropriately installed/configured hardware
> hints that larger block sizes have to be used, mkfs will silently create
> a file system which can not be mounted on the system in question.
> 
> By moving the check beyond the last assignment to blocksize it is now
> ensured, that mkfs will issue a warning even if inappropriate blocksize
> was auto-detected.
> 
> The new behavior can be easily tested, by exporting the following
> variables before running mkfs:
> 
>     export MKE2FS_DEVICE_SECTSIZE=8912
>     export MKE2FS_DEVICE_PHYS_SECTSIZE=8912
> 
> Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
> ---
>  misc/mke2fs.c |   24 +++++++++++++-----------
>  1 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 5ff3f9f..d699b46 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1516,17 +1516,6 @@ profile_error:
>  		ext2fs_close(jfs);
>  	}
>  
> -	if (blocksize > sys_page_size) {
> -		if (!force) {
> -			com_err(program_name, 0,
> -				_("%d-byte blocks too big for system (max %d)"),
> -				blocksize, sys_page_size);
> -			proceed_question();
> -		}
> -		fprintf(stderr, _("Warning: %d-byte blocks too big for system "
> -				  "(max %d), forced to continue\n"),
> -			blocksize, sys_page_size);
> -	}
>  	if (optind < argc) {
>  		fs_blocks_count = parse_num_blocks2(argv[optind++],
>  						   fs_param.s_log_block_size);
> @@ -1825,6 +1814,19 @@ profile_error:
>  
>  	blocksize = EXT2_BLOCK_SIZE(&fs_param);
>  
> +	/* This check should happen beyond the last assignment to blocksize */
> +	if (blocksize > sys_page_size) {
> +		if (!force) {
> +			com_err(program_name, 0,
> +				_("%d-byte blocks too big for system (max %d)"),
> +				blocksize, sys_page_size);
> +			proceed_question();
> +		}
> +		fprintf(stderr, _("Warning: %d-byte blocks too big for system "
> +				  "(max %d), forced to continue\n"),
> +			blocksize, sys_page_size);
> +	}
> +
>  	lazy_itable_init = 0;
>  	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
>  		lazy_itable_init = 1;



  reply	other threads:[~2011-07-01  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08  9:23 [PATCH] mke2fs: check that auto-detected blocksize <= sys_page_size Yury V. Zaytsev
2011-06-08 12:50 ` Amir Goldstein
2011-06-12 22:46   ` Yury V. Zaytsev
2011-07-01  8:31     ` Yury V. Zaytsev [this message]
2011-07-01 14:45     ` 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=1309509098.4859.12.camel@newpride \
    --to=yury@shurup.com \
    --cc=amir73il@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=snitzer@redhat.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox