From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965290AbaGRKMS (ORCPT ); Fri, 18 Jul 2014 06:12:18 -0400 Received: from casper.infradead.org ([85.118.1.10]:44335 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964794AbaGRKLU (ORCPT ); Fri, 18 Jul 2014 06:11:20 -0400 From: Christoph Hellwig To: James Bottomley , linux-scsi@vger.kernel.org Cc: Jens Axboe , Bart Van Assche , Mike Christie , "Martin K. Petersen" , Robert Elliott , Webb Scales , linux-kernel@vger.kernel.org, Hiral Patel , Suma Ramars , Brian Uchino Subject: [PATCH 14/14] fnic: reject device resets without assigned tags for the blk-mq case Date: Fri, 18 Jul 2014 12:13:13 +0200 Message-Id: <1405678393-11497-15-git-send-email-hch@lst.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405678393-11497-1-git-send-email-hch@lst.de> References: <1405678393-11497-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current the midlayer fakes up a struct request for the explicit reset ioctls, and those don't have a tag allocated to them. The fnic driver pokes into midlayer structures to paper over this design issue, but that won't work for the blk-mq case. Either someone who can actually test the hardware will have to come up with a similar hack for the blk-mq case, or we'll have to bite the bullet and fix the way the EH ioctls work for real, but until that happens we fail these explicit requests here. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Webb Scales Acked-by: Jens Axboe Tested-by: Bart Van Assche Tested-by: Robert Elliott Cc: Hiral Patel Cc: Suma Ramars Cc: Brian Uchino --- drivers/scsi/fnic/fnic_scsi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 3f88f56..961bdf5 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -2224,6 +2224,22 @@ int fnic_device_reset(struct scsi_cmnd *sc) tag = sc->request->tag; if (unlikely(tag < 0)) { + /* + * XXX(hch): current the midlayer fakes up a struct + * request for the explicit reset ioctls, and those + * don't have a tag allocated to them. The below + * code pokes into midlayer structures to paper over + * this design issue, but that won't work for blk-mq. + * + * Either someone who can actually test the hardware + * will have to come up with a similar hack for the + * blk-mq case, or we'll have to bite the bullet and + * fix the way the EH ioctls work for real, but until + * that happens we fail these explicit requests here. + */ + if (shost_use_blk_mq(sc->device->host)) + goto fnic_device_reset_end; + tag = fnic_scsi_host_start_tag(fnic, sc); if (unlikely(tag == SCSI_NO_TAG)) goto fnic_device_reset_end; -- 1.9.1