public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: Steve Dickson <SteveD@redhat.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>, kinglongmee@gmail.com
Subject: [PATCH] blkmapd: Skip the SCSI ID if the data length is zero
Date: Mon, 13 Jul 2015 07:57:24 +0800	[thread overview]
Message-ID: <55A2FEE4.6030201@gmail.com> (raw)

In vmware linux, the iscsi device contains more than one SCSI ID,
and, the second one's data length is zero.

blkmapd must skip it, otherwise, some device will be treat as the above one.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 utils/blkmapd/device-inq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 6b56b67..57fe7a3 100644
--- a/utils/blkmapd/device-inq.c
+++ b/utils/blkmapd/device-inq.c
@@ -198,7 +198,7 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
 		dev_id = (struct bl_dev_id *)&(dev_root->data[pos]);
 		pos += (dev_id->len + devid_len);
 
-		if ((dev_id->ids & 0xf) < current_id)
+		if ((dev_id->ids & 0xf) < current_id || !dev_id->len)
 			continue;
 		switch (dev_id->ids & 0xf) {
 			/* We process SCSI ID with four ID cases: 0, 1, 2 and 3.
-- 
2.4.3


             reply	other threads:[~2015-07-12 23:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 23:57 Kinglong Mee [this message]
2015-07-13  6:42 ` [PATCH] blkmapd: Skip the SCSI ID if the data length is zero Christoph Hellwig
2015-07-13  8:24   ` [PATCH v2] blkmapd: Skip the SCSI ID if " Kinglong Mee
2015-07-13  9:01     ` Christoph Hellwig
2015-07-13  9:11       ` Kinglong Mee
2015-07-13  9:59         ` [PATCH v3] " Kinglong Mee
2015-07-14  7:15           ` Christoph Hellwig
2015-07-14 14:11             ` [PATCH v4] " Kinglong Mee
2015-07-14 14:54               ` Steve Dickson
2015-07-14 18:06               ` Steve Dickson
2015-07-14 14:35             ` [PATCH v3] " Steve Dickson

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=55A2FEE4.6030201@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=SteveD@redhat.com \
    --cc=hch@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox