From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Linton Subject: Re: [PATCH 1/3] scsi: Fix erratic device offline during EH Date: Wed, 11 Sep 2013 09:36:01 -0500 Message-ID: <52307FD1.70903@tributary.com> References: <1378123118-111972-1-git-send-email-hare@suse.de> <1378123118-111972-2-git-send-email-hare@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from relay.ihostexchange.net ([66.46.182.51]:20491 "EHLO relay.ihostexchange.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803Ab3IKOgI (ORCPT ); Wed, 11 Sep 2013 10:36:08 -0400 In-Reply-To: <1378123118-111972-2-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Hannes Reinecke Cc: James Bottomley , "linux-scsi@vger.kernel.org" , Ewan Milne , Ren Mingxin , Joern Engel , James Smart , Bart Van Assche , Roland Dreier , "Martin K. Petersen" On 9/2/2013 6:58 AM, Hannes Reinecke wrote: > +static int scsi_eh_action(struct scsi_cmnd *scmd, int rtn) +{ + static > unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; + + if > (scmd->request->cmd_type != REQ_TYPE_BLOCK_PC) { + struct scsi_driver > *sdrv = scsi_cmd_to_driver(scmd); + if (sdrv->eh_action) + rtn = > sdrv->eh_action(scmd, tur_command, 6, rtn); + } + return rtn; +} + Is there are reason for using TUR here instead of STD inquiry? STD inquiry has the advantage that it can act like a "ping" but doesn't return unit attentions. Per my previous comments, trapping unit attentions in the error handler has caused UA's like luns changed, or power loss to get lost without being processed. For tape devices loosing UA's like this often means that the higher level driver won't be notified that the tape is rewound, resulting in serious issues.