All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Michal Hocko <mhocko@suse.cz>, gregkh@linuxfoundation.org
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Bob Liu" <lliubbo@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Cristian Rodríguez" <crrodriguez@opensuse.org>
Subject: Re: [PATCH] zcache: initialize module properly when zcache=FOO is given
Date: Wed, 26 Jun 2013 11:01:16 -0400	[thread overview]
Message-ID: <20130626150116.GA6004@phenom.dumpdata.com> (raw)
In-Reply-To: <1372258142-7019-1-git-send-email-mhocko@suse.cz>

On Wed, Jun 26, 2013 at 04:49:02PM +0200, Michal Hocko wrote:
> 835f2f51 (staging: zcache: enable zcache to be built/loaded as a module)
> introduced in 3.10-rc1 has introduced a bug for zcache=FOO module
> parameter processing.
> 
> zcache_comp_init return code doesn't agree with crypto_has_comp which
> uses 1 for the success unlike zcache_comp_init which uses 0. This
> causes module loading failure even if the given algorithm is supported:
> [    0.815330] zcache: compressor initialization failed
> 
> Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
> Signed-off-by: Michal Hocko <mhocko@suse.cz>

Looks OK to me.

Cc-ing Greg.

> ---
>  drivers/staging/zcache/zcache-main.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index dcceed2..0fe530b 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -1811,10 +1811,12 @@ static int zcache_comp_init(void)
>  #else
>  	if (*zcache_comp_name != '\0') {
>  		ret = crypto_has_comp(zcache_comp_name, 0, 0);
> -		if (!ret)
> +		if (!ret) {
>  			pr_info("zcache: %s not supported\n",
>  					zcache_comp_name);
> -		goto out;
> +			goto out;
> +		}
> +		goto out_alloc;
>  	}
>  	if (!ret)
>  		strcpy(zcache_comp_name, "lzo");
> @@ -1827,6 +1829,7 @@ static int zcache_comp_init(void)
>  	pr_info("zcache: using %s compressor\n", zcache_comp_name);
>  
>  	/* alloc percpu transforms */
> +out_alloc:
>  	ret = 0;
>  	zcache_comp_pcpu_tfms = alloc_percpu(struct crypto_comp *);
>  	if (!zcache_comp_pcpu_tfms)
> -- 
> 1.8.3.1
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Michal Hocko <mhocko@suse.cz>, gregkh@linuxfoundation.org
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Bob Liu" <lliubbo@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Cristian Rodríguez" <crrodriguez@opensuse.org>
Subject: Re: [PATCH] zcache: initialize module properly when zcache=FOO is given
Date: Wed, 26 Jun 2013 11:01:16 -0400	[thread overview]
Message-ID: <20130626150116.GA6004@phenom.dumpdata.com> (raw)
In-Reply-To: <1372258142-7019-1-git-send-email-mhocko@suse.cz>

On Wed, Jun 26, 2013 at 04:49:02PM +0200, Michal Hocko wrote:
> 835f2f51 (staging: zcache: enable zcache to be built/loaded as a module)
> introduced in 3.10-rc1 has introduced a bug for zcache=FOO module
> parameter processing.
> 
> zcache_comp_init return code doesn't agree with crypto_has_comp which
> uses 1 for the success unlike zcache_comp_init which uses 0. This
> causes module loading failure even if the given algorithm is supported:
> [    0.815330] zcache: compressor initialization failed
> 
> Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
> Signed-off-by: Michal Hocko <mhocko@suse.cz>

Looks OK to me.

Cc-ing Greg.

> ---
>  drivers/staging/zcache/zcache-main.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index dcceed2..0fe530b 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -1811,10 +1811,12 @@ static int zcache_comp_init(void)
>  #else
>  	if (*zcache_comp_name != '\0') {
>  		ret = crypto_has_comp(zcache_comp_name, 0, 0);
> -		if (!ret)
> +		if (!ret) {
>  			pr_info("zcache: %s not supported\n",
>  					zcache_comp_name);
> -		goto out;
> +			goto out;
> +		}
> +		goto out_alloc;
>  	}
>  	if (!ret)
>  		strcpy(zcache_comp_name, "lzo");
> @@ -1827,6 +1829,7 @@ static int zcache_comp_init(void)
>  	pr_info("zcache: using %s compressor\n", zcache_comp_name);
>  
>  	/* alloc percpu transforms */
> +out_alloc:
>  	ret = 0;
>  	zcache_comp_pcpu_tfms = alloc_percpu(struct crypto_comp *);
>  	if (!zcache_comp_pcpu_tfms)
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2013-06-26 15:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 14:49 [PATCH] zcache: initialize module properly when zcache=FOO is given Michal Hocko
2013-06-26 14:49 ` Michal Hocko
2013-06-26 15:01 ` Konrad Rzeszutek Wilk [this message]
2013-06-26 15:01   ` Konrad Rzeszutek Wilk
2013-06-26 18:38   ` Greg KH
2013-06-26 18:38     ` Greg KH

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=20130626150116.GA6004@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=crrodriguez@opensuse.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lliubbo@gmail.com \
    --cc=mhocko@suse.cz \
    --cc=torvalds@linux-foundation.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 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.