Re: [VERY EARLY RFC 00/13] Rework SCSI results handling

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

 



Johannes,

> here's a early preview of my SCSI results rework so we can eventually
> discuss things next week at LSF/MM (it still has compiler errors on
> aic7xxx and scsi_debug).

Here's what I'd like to see:

 - Forget about cramming everything into that dreaded u32 result. Bart's
   suggestion of making it a union is fine but it's perpetuating that
   these fields are one thing. And they really aren't.

   I'd rather not be confined to the crusty old model throughout
   SCSI. We can synthesize the u32 result the few places where it's
   actually required (i.e. returned to userland).

 - Create separate scsi_cmnd status fields for host, driver, target
   (SAM), and transport (msg). And maybe block layer errno as suggested.

 - Fix the naming so it makes sense. No more DID_SPOT_RUN. Let's have
   HOST_FOO / DRIVER_BAR / SAM_STAT_BAZ so it's clear who said what.

 - For the first iteration, maybe we can keep the message goo. But
   ideally I'd like to see the SPI-specifics moved to the SPI transport
   class. And then have an opaque transport error field in the scsi_cmnd
   that other transports can use as well.

 - If the interface naming is sensible, I don't think we need wrappers.
   But if it helps the driver conversion, I don't have a problem having
   them as long as they are self-documenting:

   scsi_set_command_status(HOST_FOO, DRIVER_SENSE, SAM_STAT_BAZ);

   is infinitely less error prone than:

   result = (NON_SENSE << 24) | (DID_RUN << 16) | (SPOT_FORGOT_TO_SHIFT);

I'll set aside a slot next week...

-- 
Martin K. Petersen	Oracle Linux Engineering



[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