Re: [GIT PATCH] intermediate SCSI updates

From: James Bottomley
Date: Mon Oct 13 2008 - 15:20:29 EST


On Mon, 2008-10-13 at 10:22 -0700, Linus Torvalds wrote:
>
> On Mon, 13 Oct 2008, James Bottomley wrote:
> >
> > This represents all the pieces of SCSI which were depending on the
> > already merged block tree.
>
> Grr. And it doesn't actually compile.
>
> drivers/scsi/sd.c:579:27: error: macro "sd_dif_op" passed 4 arguments, but takes just 3
> drivers/scsi/sd.c: In function âsd_prep_fnâ:
> drivers/scsi/sd.c:578: error: âsd_dif_opâ undeclared (first use in this function)
> drivers/scsi/sd.c:578: error: (Each undeclared identifier is reported only once
> drivers/scsi/sd.c:578: error: for each function it appears in.)
>
> Hmm? Was this testedt AT ALL? It can never compile unless that idiotic
> CONFIG_BLK_DEV_INTEGRITY option is set that no sane person would set right
> now, and which is even documented to not be enabled by default:
>
> If in doubt, say N.
>
> yet it looks like it has not compiled since a commit that was put in in
> the middle of September!
>
> What part of "This is total untested crap" are we missing here?

OK, you caught me; I'm relying on linux-next to test randomly built
configs because I don't have a compile farm available to me where I can
test every permutation of the options (and obviously, I usually compile
with them all on to test the actual feature code).

> Yeah, I'm grumpy. I expect to not be fed shit like this. It has apparently
> been rebased several times, and all apparently with no testing
> what-so-ever!

Not exactly. It has to be rebased to run as a postmerge tree, but it
does get tested by me (admittedly on my limited set of machines, which
don't include any actual devices that do block integrity) every time I
rebase.

However, does this work for you? It fixes the problem for me.

James

---

diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index a92b991..75638e7 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -97,7 +97,7 @@ struct sd_dif_tuple {
__be32 ref_tag; /* Target LBA or indirect LBA */
};

-#if defined(CONFIG_BLK_DEV_INTEGRITY)
+#ifdef CONFIG_BLK_DEV_INTEGRITY

extern void sd_dif_op(struct scsi_cmnd *, unsigned int, unsigned int, unsigned int);
extern void sd_dif_config_host(struct scsi_disk *);
@@ -106,10 +106,19 @@ extern void sd_dif_complete(struct scsi_cmnd *, unsigned int);

#else /* CONFIG_BLK_DEV_INTEGRITY */

-#define sd_dif_op(a, b, c) do { } while (0)
-#define sd_dif_config_host(a) do { } while (0)
-#define sd_dif_prepare(a, b, c) (0)
-#define sd_dif_complete(a, b) (0)
+static inline void sd_dif_op(struct scsi_cmnd *cmd, unsigned int a, unsigned int b, unsigned int c)
+{
+}
+static inline void sd_dif_config_host(struct scsi_disk *disk)
+{
+}
+static inline int sd_dif_prepare(struct request *rq, sector_t s, unsigned int a)
+{
+ return 0;
+}
+static inline void sd_dif_complete(struct scsi_cmnd *cmd, unsigned int a)
+{
+}

#endif /* CONFIG_BLK_DEV_INTEGRITY */



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/