All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] blkmapd: Fix infinite loop when reading serial
Date: Tue, 30 Jun 2015 14:18:20 -0400	[thread overview]
Message-ID: <5592DD6C.5010705@RedHat.com> (raw)
In-Reply-To: <556693B7.6040501@gmail.com>



On 05/28/2015 12:04 AM, Kinglong Mee wrote:
> If (dev_id->ids & 0xf) < current_id, must updates pos when continue.
> Otherwise an infinite loop.
> 
> No other places use the pos value, just move to the top of while.
> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Sorry for the delay.... Committed! 

steved.
> ---
>  utils/blkmapd/device-inq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
> index c5bf71f..6b56b67 100644
> --- a/utils/blkmapd/device-inq.c
> +++ b/utils/blkmapd/device-inq.c
> @@ -196,6 +196,8 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
>  
>  	while (pos < (len - devid_len)) {
>  		dev_id = (struct bl_dev_id *)&(dev_root->data[pos]);
> +		pos += (dev_id->len + devid_len);
> +
>  		if ((dev_id->ids & 0xf) < current_id)
>  			continue;
>  		switch (dev_id->ids & 0xf) {
> @@ -226,7 +228,6 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
>  		}
>  		if (current_id == 3)
>  			break;
> -		pos += (dev_id->len + devid_len);
>  	}
>   out:
>  	if (!serial_out)
> 

      parent reply	other threads:[~2015-06-30 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  4:04 [PATCH] blkmapd: Fix infinite loop when reading serial Kinglong Mee
2015-06-26 23:12 ` Kinglong Mee
2015-06-30 18:18 ` Steve Dickson [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=5592DD6C.5010705@RedHat.com \
    --to=steved@redhat.com \
    --cc=hch@infradead.org \
    --cc=kinglongmee@gmail.com \
    --cc=linux-nfs@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 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.