> +             if ((scsicmd->cmnd[0] == INQUIRY) && (expose_physicals <= 0)) {
> +                     u8 b;
> +                     u8 b1;
> +                     /* We can't expose disk devices because we can't
> +                      * tell whether they are the raw container drives
> +                      * or stand alone drives.  If they have the removable
> +                      * bit set then we should expose them though.
> +                      */
> +                     b = (*(u8*)scsicmd->request_buffer)&0x1f;
> +                     b1 = ((u8*)scsicmd->request_buffer)[1];
> +                     if (b == TYPE_TAPE || b == TYPE_WORM ||
> +                         b == TYPE_ROM || b==TYPE_MOD ||
> +                         b == TYPE_MEDIUM_CHANGER ||
> +                         (b == TYPE_DISK && (b1 & 0x80))) {
> +                             scsicmd->result = DID_OK << 16 |
> +                                     COMMAND_COMPLETE << 8;

This can't work at all.  request_buffer is always a scatterlist these days.
Besides this implementation bug it's also not the wrong way to do it either.
Please just return -ENXIO in ->slave_configure if sdev->type is not to
your liking instead of failing the INQUIRY command.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to