On 05/11/2015 08:58 AM, Christoph Hellwig wrote: > On Mon, May 04, 2015 at 02:42:17PM +0200, Hannes Reinecke wrote: >> Most sense code is already handled in the generic >> code, so we shouldn't be adding special cases here. >> However, when doing so we need to check for >> unit attention whenever we're sending an internal >> command. > > Shouldn't we move handling of all these sense codes to common code? They > are part of the generic SPC list of sense codes, so splitting them up > into two functions is rather confusing. > Sigh. This is one of the sore topics with the SCSI stack. The default sense code handling is correct only for filesystem I/O; BLOCK_PC callers are expected to handle all errors themselves. Which typically is a pain as one always forgets the one or the other issue. The device handlers have a callout into that generic function to handle and device handler specific sense codes. So with that I do agree that calling alua_check_sense() here is dubious as it should have been run from the generic path already. Will be checking and fixing it up. >> @@ -474,6 +440,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg, int w >> } >> >> err = alua_check_sense(sdev, &sense_hdr); >> + if (sense_hdr.sense_key == UNIT_ATTENTION) >> + err = ADD_TO_MLQUEUE; > > And this really should be a separate patch. > Okay, will be doing so. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: 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