linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2 v4] e2fsprogs: Fix how we treat user-spcified filesystem size
Date: Sat, 3 Sep 2011 11:10:04 -0400	[thread overview]
Message-ID: <20110903151004.GB3687@thunk.org> (raw)
In-Reply-To: <1307269845-15062-1-git-send-email-lczerner@redhat.com>

On Sun, Jun 05, 2011 at 12:30:44PM +0200, Lukas Czerner wrote:
> We can not specify filesystem size in blocks count without specifying
> blocksize as well. It is because we need blocks count to determine
> filesystem type, and we need filesystem type to determine blocksize. So
> it should not be allowed, however due to compatibility reason it should
> be still possible, so at least print warning message for now, so we can
> easily restrict that later.

What we currently have is actually very well defined.  The fs-size
parameter is either an absolute size, if a suffixed value (i.e., 12k,
64M, 128G, 2T) is specified.  If the value does not have a suffix,
then it is either interpreted as a block count if a blocksize is
specified, or as kilobytes if no blocksize is explicitly specified.

And this is really only a problem with mke2fs; it's not a problem with
resize2fs, since we know what the blocksize is.

> diff --git a/lib/e2p/parse_num.c b/lib/e2p/parse_num.c
> index 83a329a..8e2751b 100644
> --- a/lib/e2p/parse_num.c
> +++ b/lib/e2p/parse_num.c
> @@ -37,7 +37,6 @@ unsigned long long parse_num_blocks2(const char *arg, int log_block_size)
>  		num >>= (1+log_block_size);
>  		break;
>  	case '\0':
> -		break;
>  	default:
>  		return 0;
>  	}

and this doesn't do what the commit description claims.  This change
actually breaks the use of a number that does not have a suffix.

I'd rather not break resize2fs at all.  If script wants to specify a
block count, that's fine.  If we want to add a warning which gets
printed by mke2fs in the case where there is no explicit blockcount
specified by the user and no explicit size suffix to the fs-size
parameter stating that parameter was interpreted as kilobytes, that's
fine.

Basically, how mke2fs parses that field has been the way it has been
for over a decade, and it's really not caused any problems for users.

    	   	       	    	       - Ted

  parent reply	other threads:[~2011-09-03 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 10:30 [PATCH 1/2 v4] e2fsprogs: Fix how we treat user-spcified filesystem size Lukas Czerner
2011-06-05 10:30 ` [PATCH 2/2 v4] mke2fs: use binary units in the man page Lukas Czerner
2011-08-11 15:02 ` [PATCH 1/2 v4] e2fsprogs: Fix how we treat user-spcified filesystem size Lukas Czerner
2011-09-01  8:38   ` Lukas Czerner
2011-09-03 15:10 ` Ted Ts'o [this message]
2011-09-05 11:58   ` 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=20110903151004.GB3687@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).