The purpose of this patch is to trap all commands which have a bogus
request_bufflen. Much logic is devoted to calculating the proper length of
the transfer, but according to discussions I've had on linux-scsi, this is
really a bug in whatever is originating the bad command.
Hopefully, after people use this patch for a while, we'll eliminate all the
offending sources and can remove quite a bit of logic from the driver.
len = srb->request_bufflen;
}
+ /* According to the linux-scsi people, any command sent which
+ * violates this invariant is a bug. In the hopes of removing
+ * all the complex logic above, let's find them and eliminate them.
+ */
+ BUG_ON(len != srb->request_bufflen);
+
return len;
}