mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org, jack@suse.cz,
	akpm@linux-foundation.org, rdunlap@infradead.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH 1/1] fs: udf: parse_options: blocksize check
Date: Thu, 30 Jan 2014 01:11:08 +0100	[thread overview]
Message-ID: <20140130001108.GA24649@quack.suse.cz> (raw)
In-Reply-To: <20140129171316.ad5c50a7091e67b7ff1d329b@skynet.be>

On Wed 29-01-14 17:13:16, Fabian Frederick wrote:
> Both affs and isofs check for blocksize integrity during
> parse_options.Do the same thing for udf.
> 
> Valid values : 512, 1024, 2048 or 4096 bytes.
  Thanks. Merged into my tree.

							Honza

> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/udf/super.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 3306b9f..ac76538 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
>  	while ((p = strsep(&options, ",")) != NULL) {
>  		substring_t args[MAX_OPT_ARGS];
>  		int token;
> +		unsigned n;
>  		if (!*p)
>  			continue;
>  
> @@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
>  		case Opt_bs:
>  			if (match_int(&args[0], &option))
>  				return 0;
> -			uopt->blocksize = option;
> +			n = option;
> +			if (n != 512 && n != 1024 && n != 2048 && n != 4096)
> +				return 0;
> +			uopt->blocksize = n;
>  			uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
>  			break;
>  		case Opt_unhide:
> -- 
> 1.8.1.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2014-01-30  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  9:13 Fabian Frederick
2014-01-30  0:11 ` Jan Kara [this message]

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=20140130001108.GA24649@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®