reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Shishkin <edward.shishkin@gmail.com>
To: Ivan Shapovalov <intelfx100@gmail.com>, reiserfs-devel@vger.kernel.org
Subject: Re: [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code.
Date: Mon, 14 Sep 2015 09:52:14 +0200	[thread overview]
Message-ID: <55F67CAE.8030504@gmail.com> (raw)
In-Reply-To: <1442185720-25185-2-git-send-email-intelfx100@gmail.com>

OK.
Thanks!

On 09/14/2015 01:08 AM, Ivan Shapovalov wrote:
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
>
> This is responsible for the oops on mount reported by Jose (also experienced
> by me). The problem is that IS_ERR() works only for negative error codes,
> so somewhere in the VFS an error path is incorrectly not taken.
>
>   fs/reiser4/checksum.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
> index a5052b0..73d40f0 100644
> --- a/fs/reiser4/checksum.c
> +++ b/fs/reiser4/checksum.c
> @@ -4,11 +4,13 @@
>   
>   int reiser4_init_csum_tfm(struct crypto_shash **tfm)
>   {
> -	*tfm = crypto_alloc_shash("crc32c", 0, 0);
> -	if (IS_ERR(*tfm)) {
> -		*tfm = NULL;
> -		return 1;
> -	}
> +	struct crypto_shash *new_tfm;
> +
> +	new_tfm = crypto_alloc_shash("crc32c", 0, 0);
> +	if (IS_ERR(new_tfm))
> +		return PTR_ERR(new_tfm);
> +
> +	*tfm = new_tfm;
>   	return 0;
>   }
>   


  reply	other threads:[~2015-09-14  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-13 23:08 [PATCH 1/3] reiser4: fix filesystem init error path Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
2015-09-14  7:52   ` Edward Shishkin [this message]
2015-09-13 23:08 ` [PATCH 3/3] reiser4: report an error on checksum engine load failure Ivan Shapovalov
2015-09-14  7:53   ` Edward Shishkin
2015-09-14  7:51 ` [PATCH 1/3] reiser4: fix filesystem init error path Edward Shishkin

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=55F67CAE.8030504@gmail.com \
    --to=edward.shishkin@gmail.com \
    --cc=intelfx100@gmail.com \
    --cc=reiserfs-devel@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).