All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [build fix] Re: [GIT PATCH] SCSI part 1
Date: Wed, 16 Jul 2008 15:15:43 +0200	[thread overview]
Message-ID: <20080716131543.GA3673@elte.hu> (raw)
In-Reply-To: <20080716103337.GA22931@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> > scsi_cmnd.h depends on symbols defined in blkdev.h. The fix is to 
> > include blkdev.h as well.
> 
> that wont work - a better replacement fix is the one below. The 
> problem is that scsi.h is included even on !CONFIG_BLOCK and then the 
> BLK_MAX_CDB symbol is meaningless.

-v3 .. the new methods need to be under #ifdef CONFIG_BLOCK as well. 
Note my patch is just a quick RFC, this can probably be done cleaner.

	Ingo

------------->
commit 21a6d82fe95eced3775fb45ac46102b872db02e5
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Jul 16 11:56:08 2008 +0200

    scsi: fix build error in fs/compat_ioctl.c
    
    -tip testing found that the build broke in fs/compat_ioctl.c:
    
    ----------->
    In file included from include/scsi/scsi.h:12,
                     from fs/compat_ioctl.c:72:
    include/scsi/scsi_cmnd.h:27:25: warning: "BLK_MAX_CDB" is not defined
    include/scsi/scsi_cmnd.h:28:3: error: #error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB
    In file included from include/scsi/scsi.h:12,
                     from fs/compat_ioctl.c:72:
    include/scsi/scsi_cmnd.h: In function ‘scsi_bidi_cmnd’:
    include/scsi/scsi_cmnd.h:182: error: implicit declaration of function ‘blk_bidi_rq’
    include/scsi/scsi_cmnd.h:183: error: dereferencing pointer to incomplete type
    include/scsi/scsi_cmnd.h: In function ‘scsi_in’:
    include/scsi/scsi_cmnd.h:189: error: dereferencing pointer to incomplete type
    <-----------
    
    with this config:
    
      http://redhat.com/~mingo/misc/config-Wed_Jul_16_11_32_32_CEST_2008.bad
    
    I have bisected it down to:
    
    | feac6a07c4a3578bffd6769bb4927e8a7e1f3ffe is first bad commit
    | commit feac6a07c4a3578bffd6769bb4927e8a7e1f3ffe
    | Author: Martin Petermann <martin@linux.vnet.ibm.com>
    | Date:   Wed Jul 2 10:56:35 2008 +0200
    |
    |    [SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
    |
    |    Move the accessor functions for the scsi_cmnd status from zfcp to the
    |    SCSI include file. Change the interface to the functions to pass the
    |    scsi_cmnd pointer instead of the status pointer.
    |
    |    Signed-off-by: Martin Petermann <martin@linux.vnet.ibm.com>
    |    Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
    |    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    
    The problem is due to this aspect of that change:
    
    | @@ -9,6 +9,7 @@
    |  #define _SCSI_SCSI_H
    |
    |  #include <linux/types.h>
    | +#include <scsi/scsi_cmnd.h>
    |
    |  /*
    |   * The maximum number of SG segments that we will put inside a
    
    scsi_cmnd.h depends on symbols defined in blkdev.h but those symbols
    are not available if !CONFIG_BLOCK.
    
    Only include scsi/scsi_cmnd.h if on CONFIG_BLOCK.
    (those methods are not used when CONFIG_BLOCK is off anyway).
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/scsi/scsi.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 00137a7..0df6c05 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -9,7 +9,10 @@
 #define _SCSI_SCSI_H
 
 #include <linux/types.h>
-#include <scsi/scsi_cmnd.h>
+
+#ifdef CONFIG_BLOCK
+# include <scsi/scsi_cmnd.h>
+#endif
 
 /*
  * The maximum number of SG segments that we will put inside a
@@ -426,6 +429,7 @@ struct scsi_lun {
 #define driver_byte(result) (((result) >> 24) & 0xff)
 #define suggestion(result)  (driver_byte(result) & SUGGEST_MASK)
 
+#ifdef CONFIG_BLOCK
 static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
 {
 	cmd->result |= status << 8;
@@ -440,7 +444,7 @@ static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
 {
 	cmd->result |= status << 24;
 }
-
+#endif
 
 #define sense_class(sense)  (((sense) >> 4) & 0x7)
 #define sense_error(sense)  ((sense) & 0xf)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Ingo Molnar <mingo@elte.hu>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [build fix] Re: [GIT PATCH] SCSI part 1
Date: Wed, 16 Jul 2008 15:15:43 +0200	[thread overview]
Message-ID: <20080716131543.GA3673@elte.hu> (raw)
In-Reply-To: <20080716103337.GA22931@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> > scsi_cmnd.h depends on symbols defined in blkdev.h. The fix is to 
> > include blkdev.h as well.
> 
> that wont work - a better replacement fix is the one below. The 
> problem is that scsi.h is included even on !CONFIG_BLOCK and then the 
> BLK_MAX_CDB symbol is meaningless.

-v3 .. the new methods need to be under #ifdef CONFIG_BLOCK as well. 
Note my patch is just a quick RFC, this can probably be done cleaner.

	Ingo

------------->
commit 21a6d82fe95eced3775fb45ac46102b872db02e5
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Jul 16 11:56:08 2008 +0200

    scsi: fix build error in fs/compat_ioctl.c
    
    -tip testing found that the build broke in fs/compat_ioctl.c:
    
    ----------->
    In file included from include/scsi/scsi.h:12,
                     from fs/compat_ioctl.c:72:
    include/scsi/scsi_cmnd.h:27:25: warning: "BLK_MAX_CDB" is not defined
    include/scsi/scsi_cmnd.h:28:3: error: #error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB
    In file included from include/scsi/scsi.h:12,
                     from fs/compat_ioctl.c:72:
    include/scsi/scsi_cmnd.h: In function ‘scsi_bidi_cmnd’:
    include/scsi/scsi_cmnd.h:182: error: implicit declaration of function ‘blk_bidi_rq’
    include/scsi/scsi_cmnd.h:183: error: dereferencing pointer to incomplete type
    include/scsi/scsi_cmnd.h: In function ‘scsi_in’:
    include/scsi/scsi_cmnd.h:189: error: dereferencing pointer to incomplete type
    <-----------
    
    with this config:
    
      http://redhat.com/~mingo/misc/config-Wed_Jul_16_11_32_32_CEST_2008.bad
    
    I have bisected it down to:
    
    | feac6a07c4a3578bffd6769bb4927e8a7e1f3ffe is first bad commit
    | commit feac6a07c4a3578bffd6769bb4927e8a7e1f3ffe
    | Author: Martin Petermann <martin@linux.vnet.ibm.com>
    | Date:   Wed Jul 2 10:56:35 2008 +0200
    |
    |    [SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
    |
    |    Move the accessor functions for the scsi_cmnd status from zfcp to the
    |    SCSI include file. Change the interface to the functions to pass the
    |    scsi_cmnd pointer instead of the status pointer.
    |
    |    Signed-off-by: Martin Petermann <martin@linux.vnet.ibm.com>
    |    Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
    |    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
    
    The problem is due to this aspect of that change:
    
    | @@ -9,6 +9,7 @@
    |  #define _SCSI_SCSI_H
    |
    |  #include <linux/types.h>
    | +#include <scsi/scsi_cmnd.h>
    |
    |  /*
    |   * The maximum number of SG segments that we will put inside a
    
    scsi_cmnd.h depends on symbols defined in blkdev.h but those symbols
    are not available if !CONFIG_BLOCK.
    
    Only include scsi/scsi_cmnd.h if on CONFIG_BLOCK.
    (those methods are not used when CONFIG_BLOCK is off anyway).
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/scsi/scsi.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 00137a7..0df6c05 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -9,7 +9,10 @@
 #define _SCSI_SCSI_H
 
 #include <linux/types.h>
-#include <scsi/scsi_cmnd.h>
+
+#ifdef CONFIG_BLOCK
+# include <scsi/scsi_cmnd.h>
+#endif
 
 /*
  * The maximum number of SG segments that we will put inside a
@@ -426,6 +429,7 @@ struct scsi_lun {
 #define driver_byte(result) (((result) >> 24) & 0xff)
 #define suggestion(result)  (driver_byte(result) & SUGGEST_MASK)
 
+#ifdef CONFIG_BLOCK
 static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
 {
 	cmd->result |= status << 8;
@@ -440,7 +444,7 @@ static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
 {
 	cmd->result |= status << 24;
 }
-
+#endif
 
 #define sense_class(sense)  (((sense) >> 4) & 0x7)
 #define sense_error(sense)  ((sense) & 0xf)

  reply	other threads:[~2008-07-16 13:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 16:15 [GIT PATCH] SCSI part 1 James Bottomley
2008-07-16 10:16 ` [build fix] " Ingo Molnar
2008-07-16 10:16   ` Ingo Molnar
2008-07-16 10:33   ` Ingo Molnar
2008-07-16 10:33     ` Ingo Molnar
2008-07-16 13:15     ` Ingo Molnar [this message]
2008-07-16 13:15       ` Ingo Molnar
2008-07-16 13:28       ` Matthew Wilcox
2008-07-16 13:52       ` James Bottomley
2008-07-16 14:18         ` Ingo Molnar
2008-07-16 14:28           ` James Bottomley
2008-07-16 14:45             ` Ingo Molnar
2008-07-16 15:11               ` James Bottomley
2008-07-16 14:41           ` Matthew Wilcox
2008-07-16 14:46             ` Ingo Molnar
2008-07-16 14:57               ` Matthew Wilcox
2008-07-16 14:59                 ` Ingo Molnar
2008-07-16 14:54         ` Ingo Molnar

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=20080716131543.GA3673@elte.hu \
    --to=mingo@elte.hu \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.