From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] rbd: fix bug in rbd_dev_id_put()
Date: Wed, 24 Oct 2012 09:43:10 -0700 [thread overview]
Message-ID: <50881A9E.8070407@inktank.com> (raw)
In-Reply-To: <5076E6FE.9070400@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
On 10/11/2012 08:34 AM, Alex Elder wrote:
> In rbd_dev_id_put(), there's a loop that's intended to determine
> the maximum device id in use. But it isn't doing that at all,
> the effect of how it's written is to simply use the just-put id
> number, which ignores whole purpose of this function.
>
> Fix the bug.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
> drivers/block/rbd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index ca28036..cf5d109 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -2642,8 +2642,8 @@ static void rbd_dev_id_put(struct rbd_device
> *rbd_dev)
> struct rbd_device *rbd_dev;
>
> rbd_dev = list_entry(tmp, struct rbd_device, node);
> - if (rbd_id > max_id)
> - max_id = rbd_id;
> + if (rbd_dev->dev_id > max_id)
> + max_id = rbd_dev->dev_id;
> }
> spin_unlock(&rbd_dev_list_lock);
>
prev parent reply other threads:[~2012-10-24 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 15:34 [PATCH] rbd: fix bug in rbd_dev_id_put() Alex Elder
2012-10-24 16:43 ` Josh Durgin [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=50881A9E.8070407@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@inktank.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox