From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: [PATCH scsi] Short the path length of scsi_cmd_to_driver() Date: Thu, 27 Sep 2012 13:43:18 -0400 Message-ID: References: <1348464626.2475.13.camel@ThinkPad-T420> <1348465493.2467.3.camel@dabdike> <1348470210.2475.47.camel@ThinkPad-T420> <1348472104.2467.8.camel@dabdike> <1348721055.2509.0.camel@dabdike> <1348739495.3596.55.camel@ThinkPad-T420> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1348739495.3596.55.camel@ThinkPad-T420> (Li Zhong's message of "Thu, 27 Sep 2012 17:51:35 +0800") Sender: linux-kernel-owner@vger.kernel.org To: Li Zhong Cc: James Bottomley , "Martin K. Petersen" , LKML , linux-scsi@vger.kernel.org, "Paul E. McKenney" List-Id: linux-scsi@vger.kernel.org >>>>> "Li" == Li Zhong writes: > @@ -845,8 +844,11 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, > > scsi_eh_restore_cmnd(scmd, &ses); > >- if (sdrv && sdrv->eh_action) >- rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); >+ if (scmd->request->cmd_type == REQ_TYPE_FS) { >+ struct scsi_driver *sdrv = scsi_cmd_to_driver(scmd); >+ if (sdrv->eh_action) >+ rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); >+ } > > return rtn; > } My only concern is whether our device lifetime rules guarantee that the ULD is always attached when we service an error handling command? -- Martin K. Petersen Oracle Linux Engineering