Skip to contentSkip to conversation

scsi_error: Fix language abuse.

PATCH In review Alan Cox 8 participants 13 messages Feb 8, 2008 – Feb 11, 2008 SCSI

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 scsi_error: Fix language abuse.

The word "illegal" has a precise dictionary meaning of "prohibited by law". The error messages are therefore incorrect as so far nobody has made SCSI violations a criminal offence.

This corrects scsi to match various other subsystems I've slowly been ridding of this.

Pedantically-signed-off-by Alan Cox <[email protected]>
drivers/scsi/constants.c +7 -7
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-mm1/drivers/scsi/constants.c linux-2.6.24-mm1/drivers/scsi/constants.c
@@ -606,10 +606,10 @@
 	{0x2001, "Access denied - initiator pending-enrolled"},
 	{0x2002, "Access denied - no access rights"},
 	{0x2003, "Access denied - invalid mgmt id key"},
-	{0x2004, "Illegal command while in write capable state"},
+	{0x2004, "Invalid command while in write capable state"},
 	{0x2005, "Obsolete"},
-	{0x2006, "Illegal command while in explicit address mode"},
-	{0x2007, "Illegal command while in implicit address mode"},
+	{0x2006, "Invalid command while in explicit address mode"},
+	{0x2007, "Invalid command while in implicit address mode"},
 	{0x2008, "Access denied - enrollment conflict"},
 	{0x2009, "Access denied - invalid LU identifier"},
 	{0x200A, "Access denied - invalid proxy token"},
@@ -620,7 +620,7 @@
 	{0x2102, "Invalid address for write"},
 	{0x2103, "Invalid write crossing layer jump"},
 
-	{0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"},
+	{0x2200, "Invalid function (use 20 00, 24 00, or 26 00)"},
 
 	{0x2400, "Invalid field in cdb"},
 	{0x2401, "CDB decryption error"},
@@ -697,7 +697,7 @@
 	{0x2C02, "Invalid combination of windows specified"},
 	{0x2C03, "Current program area is not empty"},
 	{0x2C04, "Current program area is empty"},
-	{0x2C05, "Illegal power condition request"},
+	{0x2C05, "Invalid power condition request"},
 	{0x2C06, "Persistent prevent conflict"},
 	{0x2C07, "Previous busy status"},
 	{0x2C08, "Previous task set full status"},
@@ -1014,7 +1014,7 @@
 	{0x6300, "End of user area encountered on this track"},
 	{0x6301, "Packet does not fit in available space"},
 
-	{0x6400, "Illegal mode for this track"},
+	{0x6400, "Invalid mode for this track"},
 	{0x6401, "Invalid packet size"},
 
 	{0x6500, "Voltage fault"},
@@ -1124,7 +1124,7 @@
 	"Not Ready",	    /* 2: The addressed target is not ready */
 	"Medium Error",	    /* 3: Data error detected on the medium */
 	"Hardware Error",   /* 4: Controller or device failure */
-	"Illegal Request",  /* 5: Error in request */
+	"Invalid Request",  /* 5: Error in request */
 	"Unit Attention",   /* 6: Removable medium was changed, or
 				  the target has been reset, or ... */
 	"Data Protect",	    /* 7: Access to the data is blocked */
maintainer
#1 lore raw
Quoted 3 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law". The error messages are therefore incorrect as so far nobody has made SCSI violations a criminal offence.

Um, I'm really reluctant to do this without an incredibly good reason. Illegal is a defined term under the SCSI standards, and the messages you are changing actually appear with the word Illegal in the actual ASC/ASCQ definition. If I accept this patch, you'll no longer be able to look the messages up in the relevant standard:

http://www.t10.org/ftp/t10/drafts/spc3/spc3r23.pdf

By a simple text search.

I don't think the pedantry is worth the confusion ...

James

maintainer
#3 lore raw
Quoted 7 lines · Alan Cox
Quoted 5 lines

http://www.t10.org/ftp/t10/drafts/spc3/spc3r23.pdf

By a simple text search.

I don't think the pedantry is worth the confusion ...

Ok so we should file a formal change request with T10 instead perhaps ?

As long as that "we" is royal, be my guest and go ahead.

If you set up the correct legal trust, your heirs and assigns can submit the patch just as soon as T10 accepts the change ...

James

#4 lore raw
In reply to James Bottomley

The correct word should be "invalid," in spite of the fact that the SCSI committee used invalid syntax.

Alan is right. There is nothing illegal in the kernel and if there is, it must be removed as soon as it is discovered!

Quoted 12 lines · James Bottomley
Quoted 3 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law". The error messages are therefore incorrect as so far nobody has made SCSI violations a criminal offence.

Um, I'm really reluctant to do this without an incredibly good reason. Illegal is a defined term under the SCSI standards, and the messages you are changing actually appear with the word Illegal in the actual ASC/ASCQ definition. If I accept this patch, you'll no longer be able to look the messages up in the relevant standard:

Quoted 8 lines

http://www.t10.org/ftp/t10/drafts/spc3/spc3r23.pdf

By a simple text search.

I don't think the pedantry is worth the confusion ...

James

Cheers,
Dick Johnson
Penguin : Linux version 2.6.22.1 on an i686 machine (5588.29 BogoMips). My book : http://www.AbominableFirebug.com/
_

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

#5 lore raw
Quoted 8 lines · linux-os (Dick Johnson)

The correct word should be "invalid," in spite of the fact that the SCSI committee used invalid syntax.

Alan is right. There is nothing illegal in the kernel and if there is, it must be removed as soon as it is discovered!

il·le·gal (-lgl)
adj.
1. Prohibited by law.
*2. Prohibited by official rules: an illegal pass in football. *3. Unacceptable to or not performable by a computer: an illegal operation.

Mark

#6 lore raw
Quoted 10 lines · Mark Hounschell
Quoted 8 lines · linux-os (Dick Johnson)

The correct word should be "invalid," in spite of the fact that the SCSI committee used invalid syntax.

Alan is right. There is nothing illegal in the kernel and if there is, it must be removed as soon as it is discovered!

Quoted 7 lines

il·le·gal (-lgl)
adj.
1. Prohibited by law.
*2. Prohibited by official rules: an illegal pass in football. *3. Unacceptable to or not performable by a computer: an illegal operation.

Mark

Many early computer programmers including myself, while writing error messages in early software, did not understand that computer programmers do not make law so we called bad operations "illegal."

Once you are called to testify in a court of law, about some message your code wrote to the screen just before a factory burned down, you start to be much more careful about the syntax.

I advise that, regardless of the rewrite of dictionaries and, in fact, the rewrite of history, whenever possible we use the correct message syntax. Dictionaries pick up "common usage" in spite of the fact that it is wrong. See "irregardless" and other abortions which now exist in the dictionary.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.22.1 on an i686 machine (5588.28 BogoMips). My book : http://www.AbominableFirebug.com/
_

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
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

#7 lore raw

Seriously, can't you just add a disclaimer to the README file?

In http://lkml.org/lkml/2008/2/9/29, Luben Tuikov made an interesting point that in many cases "illegal" refers to a valid value that violates the specification, so the term "invalid" may be technically incorrect.

Benny

Quoted 39 lines · linux-os (Dick Johnson)
Quoted 8 lines · Mark Hounschell
Quoted 7 lines · linux-os (Dick Johnson)

The correct word should be "invalid," in spite of the fact that the SCSI committee used invalid syntax.

Alan is right. There is nothing illegal in the kernel and if there is, it must be removed as soon as it is discovered!

Quoted 7 lines

il·le·gal (-lgl)
adj.
1. Prohibited by law.
*2. Prohibited by official rules: an illegal pass in football. *3. Unacceptable to or not performable by a computer: an illegal operation.

Mark

Many early computer programmers including myself, while writing error messages in early software, did not understand that computer programmers do not make law so we called bad operations "illegal."

Once you are called to testify in a court of law, about some message your code wrote to the screen just before a factory burned down, you start to be much more careful about the syntax.

I advise that, regardless of the rewrite of dictionaries and, in fact, the rewrite of history, whenever possible we use the correct message syntax. Dictionaries pick up "common usage" in spite of the fact that it is wrong. See "irregardless" and other abortions which now exist in the dictionary.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.22.1 on an i686 machine (5588.28 BogoMips). My book : http://www.AbominableFirebug.com/
_

Quoted 8 lines

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
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

-
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

#8 lore raw
In reply to Alan Cox
Quoted 2 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law".

Also "contrary to or forbidden by official rules, regulations, etc". So word meanings are like standards, there are so many to choose from.

The error messages are therefore incorrect as so far nobody has

Quoted 1 line

made SCSI violations a criminal offence.

Most USB mass storage implementations should result in jail terms for the responsible parties.

Quoted 4 lines

This corrects scsi to match various other subsystems I've slowly been ridding of this.

Pedantically-signed-off-by Alan Cox <[email protected]>

Please don't do this.

drivers/scsi/constants.c line 609

Quoted 2 lines
drivers/scsi/constants.c +1 -1
-	{0x2004, "Illegal command while in write capable state"},
+	{0x2004, "Invalid command while in write capable state"},

Several reasons:
1) Those strings appear in an international standard.

    In this case SPC-3 ANSI INCITS 408-2005.

2) The way that INCITS standard (and others) is structured, the relevant part of the text refers to a specific additional sense code + qualifier instance by _name_ (e.g. "Illegal command while in write capable state") not by number (e.g. 0x20,0x4). So given the Alan Cox rendition of that string in a log, a diligent debugger would need to get to constants.c to find the corresponding asc/ascq numeric sequence, then search Annex D of SPC-3 to find the t10.org version of that string, then search the body of SPC-3 and other t10 device class specific standards for a match on the t10 string.
Vendor product manuals would tend to use the t10.org strings as well.
3) I maintain constants.c and I do that with the help of a program that compares t10's tables (specifically
http://www.t10.org/lists/asc-num.txt ) with the table in constants.c . I'm glad to send you a copy so you can take over maintaining the sanitized list and cope with the abuse that may follow.

If you feel strongly about this then you could take it up with ANSI or BS (a great acronym IMO).

Doug Gilbert

Quoted 59 lines

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-mm1/drivers/scsi/constants.c linux-2.6.24-mm1/drivers/scsi/constants.c

drivers/scsi/constants.c +7 -8
@@ -606,10 +606,10 @@
 	{0x2001, "Access denied - initiator pending-enrolled"},
 	{0x2002, "Access denied - no access rights"},
 	{0x2003, "Access denied - invalid mgmt id key"},
-	{0x2004, "Illegal command while in write capable state"},
+	{0x2004, "Invalid command while in write capable state"},
 	{0x2005, "Obsolete"},
-	{0x2006, "Illegal command while in explicit address mode"},
-	{0x2007, "Illegal command while in implicit address mode"},
+	{0x2006, "Invalid command while in explicit address mode"},
+	{0x2007, "Invalid command while in implicit address mode"},
 	{0x2008, "Access denied - enrollment conflict"},
 	{0x2009, "Access denied - invalid LU identifier"},
 	{0x200A, "Access denied - invalid proxy token"},
@@ -620,7 +620,7 @@
 	{0x2102, "Invalid address for write"},
 	{0x2103, "Invalid write crossing layer jump"},
 
-	{0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"},
+	{0x2200, "Invalid function (use 20 00, 24 00, or 26 00)"},
 
 	{0x2400, "Invalid field in cdb"},
 	{0x2401, "CDB decryption error"},
@@ -697,7 +697,7 @@
 	{0x2C02, "Invalid combination of windows specified"},
 	{0x2C03, "Current program area is not empty"},
 	{0x2C04, "Current program area is empty"},
-	{0x2C05, "Illegal power condition request"},
+	{0x2C05, "Invalid power condition request"},
 	{0x2C06, "Persistent prevent conflict"},
 	{0x2C07, "Previous busy status"},
 	{0x2C08, "Previous task set full status"},
@@ -1014,7 +1014,7 @@
 	{0x6300, "End of user area encountered on this track"},
 	{0x6301, "Packet does not fit in available space"},
 
-	{0x6400, "Illegal mode for this track"},
+	{0x6400, "Invalid mode for this track"},
 	{0x6401, "Invalid packet size"},
 
 	{0x6500, "Voltage fault"},
@@ -1124,7 +1124,7 @@
 	"Not Ready",	    /* 2: The addressed target is not ready */
 	"Medium Error",	    /* 3: Data error detected on the medium */
 	"Hardware Error",   /* 4: Controller or device failure */
-	"Illegal Request",  /* 5: Error in request */
+	"Invalid Request",  /* 5: Error in request */
 	"Unit Attention",   /* 6: Removable medium was changed, or
 				  the target has been reset, or ... */
 	"Data Protect",	    /* 7: Access to the data is blocked */
-

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

author
#9 lore raw
Quoted 5 lines · On Fri, 08 Feb 2008 20:32:54 -0500 Douglas Gilbert <[email protected]> wrote:
Quoted 2 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law".

Also "contrary to or forbidden by official rules, regulations, etc".

The OED I have here doesn't seem to think so, however if the words are the ones used in the T10 documentation then I'm happy to drop the patch.

Alan

#10 lore raw
Quoted 10 lines · Alan Cox
Quoted 4 lines · On Fri, 08 Feb 2008 20:32:54 -0500 Douglas Gilbert <[email protected]> wrote:
Quoted 2 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law".

Also "contrary to or forbidden by official rules, regulations, etc".

The OED I have here doesn't seem to think so, however if the words are the ones used in the T10 documentation then I'm happy to drop the patch.

The OED (Oxford English dictionary) seems to be at odds with most other online dictionaries with respect to the word illegal. I find the following 'illegal' entry (at www.askoxford.com) daft:
"USAGE Both illegal and unlawful can mean 'contrary to
or forbidden by law', but unlawful has a broader meaning 'not permitted by rules': thus handball in soccer is unlawful, but not illegal."

So if we followed the OED's advice then SCSI's "illegal request" would become "unlawful request". I'm yet to see the word "unlawful" in any technical standard ...

Doug Gilbert

#11 lore raw
In reply to Alan Cox
Quoted 9 lines · Alan Cox
Quoted 5 lines · On Fri, 08 Feb 2008 20:32:54 -0500 Douglas Gilbert <[email protected]> wrote:
Quoted 2 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by law".

Also "contrary to or forbidden by official rules, regulations, etc".

The OED I have here doesn't seem to think so, however if the words are the ones used in the T10 documentation then I'm happy to drop the patch.

Not everyone believes in the OED's definitions. I prefer Chambers (in general), which has the (online) definition:

illegal adj
1 against the law; not legal. Also called unlawful. 2 not authorized by law or by specific rules which apply.
ETYMOLOGY: 17c: from Latin illegalis.

I believe the second definition would apply here.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
#12 lore raw
In reply to Alan Cox
Quoted 6 lines · Alan Cox

The word "illegal" has a precise dictionary meaning of "prohibited by
law". The error messages are therefore incorrect as so far nobody has
made SCSI violations a criminal offence.

Quoted 6 lines

This corrects scsi to match various other subsystems I've slowly been
ridding of this.

Pedantically-signed-off-by: Alan Cox
<[email protected]>

Alan,

In standards and in hardware specs, from which the meaning of "illegal" is borrowed from (into standards), "illegal" doesn't necessarily mean "invalid", and cannot be substituted for. This is exactly why this particular word is used in the ASC/ASCQ assignments. It exposes an underlying behaviour.

For example:

drivers/scsi/constants.c line 609

Quoted 2 lines
drivers/scsi/constants.c +1 -1
-	{0x2004, "Illegal command while in write capable state"},
+	{0x2004, "Invalid command while in write capable state"},

Consider this: the command itself can be very perfectly "valid", e.g. the SCB contents, format, etc., but certainly "illegal".

Similarly for the rest of this patch.

Luben