Subject: Re: umass woe: sd0(umass0:0:0): readonly device & drive offline
To: Hubert Feyrer <firstname.lastname@example.org>
From: Michael van Elst <email@example.com>
Date: 11/18/2005 22:58:31
On Fri, Nov 18, 2005 at 10:16:35PM +0100, Hubert Feyrer wrote:
> I'm currently poking around in sd.c, and would appreciate some more hints
> here, as I'm totally unfamiliar with the code. Where is the sense code you
> mention stored, and how is it set?
struct scsipi_xfer *xs;
xs->sense.scsi_sense.response_code & SSD_RCODE_VALID != 0
SSD_RCODE(xs->sense.scsi_sense.response_code) == SSD_RCODE_CURRENT
SSD_SENSE_KEY(xs->sense.scsi_sense.flags) == SKEY_ILLEGAL_REQUEST
xs->sense.scsi_sense.asc == 0x24
xs->sense.scsi_sense.ascq == 0x00
This tells you that the command failed, you have retrieved valid
sense_data, the device did think the command was illegal, the
reason was that there was an invalid field in the command control
The only place where you can handle this error is in the
callback sd_interpret_sense where you have match this with
the command in question. The command is xs->cmd and the
command code is xs->cmd->opcode.
Now, sdopen() specifies XS_CTL_IGNORE_ILLEGAL_REQUEST
for scsipi_prevent() but this doesn't seem to be honored.
Michael van Elst
"A potential Snark may lurk in every tree."