From: Mike Snitzer <snitzer@redhat.com>
To: heinzm@redhat.com
Cc: dm-devel@redhat.com
Subject: Re: dm ebs: fix bio->bi_status assignment
Date: Wed, 29 Apr 2020 11:22:53 -0400 [thread overview]
Message-ID: <20200429152253.GA22958@redhat.com> (raw)
In-Reply-To: <dff475cd16489080bb229af9bb45c0d67480b8be.1588172814.git.heinzm@redhat.com>
On Wed, Apr 29 2020 at 11:07am -0400,
heinzm@redhat.com <heinzm@redhat.com> wrote:
> From: Heinz Mauelshagen <heinzm@redhat.com>
>
> Assign blk_status_t to bi_status properly in __ebs_process_bios()
> on error (flaw found by static checker).
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
> ---
> drivers/md/dm-ebs-target.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c
> index 97703c31771f..c9c66d6b1e56 100644
> --- a/drivers/md/dm-ebs-target.c
> +++ b/drivers/md/dm-ebs-target.c
> @@ -210,7 +210,8 @@ static void __ebs_process_bios(struct work_struct *ws)
> r = __ebs_discard_bio(ec, bio);
> }
>
> - bio->bi_status = r;
> + if (r < 0)
> + bio->bi_status = BLK_STS_IOERR;
> }
>
> /*
> --
> 2.25.4
>
Proper way is to use errno_to_blk_status(). I've folded in:
- bio->bi_status = r;
+ if (r < 0)
+ bio->bi_status = errno_to_blk_status(r);
next prev parent reply other threads:[~2020-04-29 15:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 15:07 [PATCH] dm ebs: fix bio->bi_status assignment heinzm
2020-04-29 15:22 ` Mike Snitzer [this message]
2020-04-29 19:39 ` Heinz Mauelshagen
2020-04-29 19:40 ` Heinz Mauelshagen
2020-04-29 23:04 ` Mike Snitzer
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=20200429152253.GA22958@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=heinzm@redhat.com \
/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.