From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v2] Fix DID_OK handling in __scsi_error_from_host_byte() Date: Thu, 5 Apr 2018 10:48:52 +0200 Message-ID: <20180405084852.GA2286@lst.de> References: <20180404175355.15982-1-bart.vanassche@wdc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180404175355.15982-1-bart.vanassche@wdc.com> Sender: stable-owner@vger.kernel.org To: Bart Van Assche Cc: "Martin K . Petersen" , "James E . J . Bottomley" , linux-scsi@vger.kernel.org, Hannes Reinecke , Douglas Gilbert , Damien Le Moal , Christoph Hellwig , stable@vger.kernel.org List-Id: linux-scsi@vger.kernel.org On Wed, Apr 04, 2018 at 10:53:55AM -0700, Bart Van Assche wrote: > + /* > + * Also check the other bytes than the status byte in result > + * to handle the case when a SCSI LLD sets result to > + * DRIVER_SENSE << 24 without setting SAM_STAT_CHECK_CONDITION. > + */ > + return scsi_status_is_good(result) && (result & ~0xff) == 0 ? > + BLK_STS_OK : BLK_STS_IOERR; How about an readable version of the statement above? if (scsi_status_is_good(result) && (result & ~0xff)) return BLK_STS_OK; return BLK_STS_IOERR;