mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Chao Yu <chao2.yu@samsung.com>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix incorrect parsing with option string
Date: Tue, 18 Mar 2014 09:33:27 +0900	[thread overview]
Message-ID: <1395102807.3870.156.camel@kjgkr> (raw)
In-Reply-To: <000301cf41c5$10f247b0$32d6d710$@samsung.com>

Hi,

2014-03-17 (월), 17:40 +0800, Chao Yu:
> Previously 'background_gc={on***,off***}' is being parsed as correct option,
> with this patch we cloud fix the trivial bug in mount process.
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
>  fs/f2fs/super.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 057a3ef..6597290 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -258,9 +258,9 @@ static int parse_options(struct super_block *sb, char *options)
>  
>  			if (!name)
>  				return -ENOMEM;
> -			if (!strncmp(name, "on", 2))
> +			if (!strncmp(name, "on", strlen(name)))

What about 'background_gc=o'?
Need to check strlen(name) == 2...
Thanks,

>  				set_opt(sbi, BG_GC);
> -			else if (!strncmp(name, "off", 3))
> +			else if (!strncmp(name, "off", strlen(name)))
>  				clear_opt(sbi, BG_GC);
>  			else {
>  				kfree(name);

-- 
Jaegeuk Kim
Samsung


  reply	other threads:[~2014-03-18  0:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  9:40 Chao Yu
2014-03-18  0:33 ` Jaegeuk Kim [this message]
2014-03-18  0:59   ` Chao Yu

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=1395102807.3870.156.camel@kjgkr \
    --to=jaegeuk.kim@samsung.com \
    --cc=chao2.yu@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®