Re: Device flags: use_10_for_rw and use_10_for_ms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 29, 2005 at 04:23:16PM -0500, Alan Stern wrote:

Alan -

Looking at the full log (with no patches) and your earlier patch, I'm
confused by two things.

First, the READ_10 command being sent after we get the ILLEGAL REQUEST.

Do you know how that READ_10 is sent? Is the upper layer add_disk() check
partition code retrying? Then I'd expect a READ_6. If it were already
prepped, I guess we can get another READ_10, but I thought that the
partition read/check code only issued one read at a time.

The scsi_check_sense() should not be allowing the retry, we have a "return
SUCCESS" there. If we did want to retry via scmd->retries, we might be
able to add code into scis_check_sense().

And:

How can the current scsi_lib.c scsi_io_completion() *ever* requeue after
an sd.c read/write has turned off use_10_for_rw in sd_rw_intr()?

That is, sd.c sd_rw_intr() gets ILLEGAL REQUEST, and clears use_10_for_rw,
this snippet:

		case ILLEGAL_REQUEST:
			if (SCpnt->device->use_10_for_rw &&
			    (SCpnt->cmnd[0] == READ_10 ||
			     SCpnt->cmnd[0] == WRITE_10))
				SCpnt->device->use_10_for_rw = 0;

Then it calls scsi_io_completion(), where we only requeue if use_10_for_rw
is still set, so we never requeue via this code path. That is why without
your patch we get an error output. Correct?!

So with the patch you posted earlier, all it does (in scsi_io_completion())
is set use_10_for_rw back to 1, and then requeue the IO.

If you remove (or move) that sd.c code, it seems you'll hit this, and
figure that you do not want to switch from 6 to 10 byte commands (and
perhaps back) at all.

Then we need a method so we don't switch: another bit or state set after
a successful read or write command (and I guess one for succesful mode
sense command). 

We need only check the do-not-switch flag if we get an ILLEGAL REQUEST. We
already have to check use_10_for_rw before every read or write request.

-- Patrick Mansfield
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux