linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
To: Hao Li <lihao2018.fnst@cn.fujitsu.com>
Cc: viro@zeniv.linux.org.uk, Matthew Wilcox <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dax: Fix wrong error-number passed into xas_set_err()
Date: Thu, 30 Jul 2020 06:33:14 +0200	[thread overview]
Message-ID: <CAM9Jb+hUk_e-Un3+9Jx8eKDtZ2A597bawQTJXQx77T0yG+PdnQ@mail.gmail.com> (raw)
In-Reply-To: <20200729034436.24267-1-lihao2018.fnst@cn.fujitsu.com>

> The error-number passed into xas_set_err() should be negative. Otherwise,
> the xas_error() will return 0, and grab_mapping_entry() will return the
> found entry instead of a SIGBUS error when the entry is not a value.
> And then, the subsequent code path would be wrong.
>
> Signed-off-by: Hao Li <lihao2018.fnst@cn.fujitsu.com>
> ---
>  fs/dax.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 11b16729b86f..acac675fe7a6 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -488,7 +488,7 @@ static void *grab_mapping_entry(struct xa_state *xas,
>                 if (dax_is_conflict(entry))
>                         goto fallback;
>                 if (!xa_is_value(entry)) {
> -                       xas_set_err(xas, EIO);
> +                       xas_set_err(xas, -EIO);
>                         goto out_unlock;
>                 }
>
> --

Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>

> 2.28.0
>
>
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

      reply	other threads:[~2020-07-30  4:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29  3:44 [PATCH] dax: Fix wrong error-number passed into xas_set_err() Hao Li
2020-07-30  4:33 ` Pankaj Gupta [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=CAM9Jb+hUk_e-Un3+9Jx8eKDtZ2A597bawQTJXQx77T0yG+PdnQ@mail.gmail.com \
    --to=pankaj.gupta.linux@gmail.com \
    --cc=jack@suse.cz \
    --cc=lihao2018.fnst@cn.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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).