All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: hare@suse.de, "Martin K. Petersen" <martin.petersen@oracle.com>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org
Cc: dm-devel@redhat.com, kbuild test robot <fengguang.wu@intel.com>,
	kbuild-all@01.org, linux-kernel@vger.kernel.org
Subject: Re: ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined!
Date: Mon, 12 Mar 2018 11:40:16 -0400	[thread overview]
Message-ID: <20180312154016.GA29395@redhat.com> (raw)
In-Reply-To: <201803110354.yaesL1Mi%fengguang.wu@intel.com>

On Sat, Mar 10 2018 at  2:29pm -0500,
kbuild test robot <fengguang.wu@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3266b5bd97eaa72793df0b6e5a106c69ccc166c4
> commit: 8d47e65948ddea4398892946d9e50778a316b397 dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks
> date:   4 days ago
> config: x86_64-randconfig-x004-201810 (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         git checkout 8d47e65948ddea4398892946d9e50778a316b397
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
> >> ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined!
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

This error is due to CONFIG_SCSI not being set.

DM commit 8d47e6594 ("dm mpath: remove unnecessary NVMe branching in
favor of scsi_dh checks") updated dm-mpath.c to call
scsi_device_from_queue() to determine if a device is SCSI.

The following patch fixes the buildbot reported case when CONFIG_SCSI
isn't set... but it is unclear if this is the best way forward.  I don't
want to make CONFIG_DM_MULTIPATH depend on CONFIG_SCSI, as such we
either need the following patch or the equivalent in a dm-mpath.c
wrapper.

Thoughts?

diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 7ae177c..d6bcc96 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -333,7 +333,14 @@ extern int scsi_add_device(struct Scsi_Host *host, uint channel,
 extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
 void scsi_attach_vpd(struct scsi_device *sdev);
 
+#ifdef CONFIG_SCSI
 extern struct scsi_device *scsi_device_from_queue(struct request_queue *q);
+#else
+static inline struct scsi_device *scsi_device_from_queue(struct request_queue *q)
+{
+	return NULL;
+}
+#endif
 extern int __must_check scsi_device_get(struct scsi_device *);
 extern void scsi_device_put(struct scsi_device *);
 extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *,

WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: hare@suse.de, "Martin K. Petersen" <martin.petersen@oracle.com>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	kbuild test robot <fengguang.wu@intel.com>,
	dm-devel@redhat.com
Subject: Re: ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined!
Date: Mon, 12 Mar 2018 11:40:16 -0400	[thread overview]
Message-ID: <20180312154016.GA29395@redhat.com> (raw)
In-Reply-To: <201803110354.yaesL1Mi%fengguang.wu@intel.com>

On Sat, Mar 10 2018 at  2:29pm -0500,
kbuild test robot <fengguang.wu@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3266b5bd97eaa72793df0b6e5a106c69ccc166c4
> commit: 8d47e65948ddea4398892946d9e50778a316b397 dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks
> date:   4 days ago
> config: x86_64-randconfig-x004-201810 (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         git checkout 8d47e65948ddea4398892946d9e50778a316b397
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
> >> ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined!
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

This error is due to CONFIG_SCSI not being set.

DM commit 8d47e6594 ("dm mpath: remove unnecessary NVMe branching in
favor of scsi_dh checks") updated dm-mpath.c to call
scsi_device_from_queue() to determine if a device is SCSI.

The following patch fixes the buildbot reported case when CONFIG_SCSI
isn't set... but it is unclear if this is the best way forward.  I don't
want to make CONFIG_DM_MULTIPATH depend on CONFIG_SCSI, as such we
either need the following patch or the equivalent in a dm-mpath.c
wrapper.

Thoughts?

diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 7ae177c..d6bcc96 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -333,7 +333,14 @@ extern int scsi_add_device(struct Scsi_Host *host, uint channel,
 extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
 void scsi_attach_vpd(struct scsi_device *sdev);
 
+#ifdef CONFIG_SCSI
 extern struct scsi_device *scsi_device_from_queue(struct request_queue *q);
+#else
+static inline struct scsi_device *scsi_device_from_queue(struct request_queue *q)
+{
+	return NULL;
+}
+#endif
 extern int __must_check scsi_device_get(struct scsi_device *);
 extern void scsi_device_put(struct scsi_device *);
 extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *,

  reply	other threads:[~2018-03-12 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 19:29 ERROR: "scsi_device_from_queue" [drivers/md/dm-multipath.ko] undefined! kbuild test robot
2018-03-12 15:40 ` Mike Snitzer [this message]
2018-03-12 15:40   ` 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=20180312154016.GA29395@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=emilne@redhat.com \
    --cc=fengguang.wu@intel.com \
    --cc=hare@suse.de \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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.