Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753737AbdFMTQT (ORCPT ); Tue, 13 Jun 2017 15:16:19 -0400 Received: from mail-bn3nam01on0103.outbound.protection.outlook.com ([104.47.33.103]:4848 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752081AbdFMTQR (ORCPT ); Tue, 13 Jun 2017 15:16:17 -0400 From: Long Li To: Bart Van Assche , "linux-kernel@vger.kernel.org" , KY Srinivasan , "martin.petersen@oracle.com" , "linux-scsi@vger.kernel.org" , Stephen Hemminger , "jejb@linux.vnet.ibm.com" , Haiyang Zhang CC: "jthumshirn@suse.de" Subject: RE: [Possible Phish Fraud][PATCH] storvsc: use default I/O timeout handler for FC devices Thread-Topic: [Possible Phish Fraud][PATCH] storvsc: use default I/O timeout handler for FC devices Thread-Index: AQHS49t0jygelz5Z1UmzZNJkfZIRiqIi7mMAgAAm1NA= Date: Tue, 13 Jun 2017 19:16:13 +0000 Message-ID: References: <1497313417-14815-1-git-send-email-longli@exchange.microsoft.com> <1497368284.2804.5.camel@wdc.com> In-Reply-To: <1497368284.2804.5.camel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetBy=longli@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-06-13T12:16:11.6766076-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; x-originating-ip: [67.183.216.93] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR03MB1422;7:87QPVJZqnfesipJvp+U8/6TnCAj5dotW/A+uj/6NIfeMpkNMxsHVpkfNvGW3cEBn3XeuLruNhHNn4a5kSiQGWeZnUHbP9NShXEvvk4yMbE840Tw5qpcgTTZM2mbHHuoKheestAkjQd7pOL2grSMopUP2igple5/TW3yrz5pV4FW1FxhAx2Xxa+Wk/MOmX1JhWBd6JmrxhxkDkIazrDN8Muaztv5hrcfZdxorDz+AhbsWVjZujFPKhiJmjpPgXZTwBm6v8jYTvFr3O6uc8N0abbhHOLsr0gIRolyyxlLxhm6r/xYX1Du3sAxU1noP5+NnV4esFftdp1/AyVAvyu+5WFFmn7S5t3HtdRw9gW16azc= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(6009001)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(199003)(189002)(24454002)(13464003)(377454003)(377424004)(4326008)(2501003)(97736004)(86362001)(55016002)(6246003)(3280700002)(25786009)(33656002)(2900100001)(575784001)(2201001)(3660700001)(38730400002)(6116002)(8936002)(5005710100001)(53546009)(50986999)(3846002)(10090500001)(54356999)(68736007)(2950100002)(6636002)(86612001)(14454004)(76176999)(7696004)(101416001)(102836003)(77096006)(305945005)(122556002)(5660300001)(9686003)(99286003)(6436002)(1691005)(6506006)(74316002)(66066001)(8990500004)(1511001)(2906002)(2561002)(478600001)(10290500003)(7736002)(189998001)(8656002)(53936002)(81166006)(105586002)(2421001)(15650500001)(81156014)(8676002)(106356001)(229853002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1422;H:MWHPR03MB3136.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-traffictypediagnostic: CY1PR03MB1422: x-ms-office365-filtering-correlation-id: 2563008d-8cac-4d71-1b5b-08d4b290a825 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:CY1PR03MB1422; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(104084551191319)(146099531331640)(42932892334569); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR03MB1422;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR03MB1422; x-forefront-prvs: 0337AFFE9A spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2017 19:16:13.1183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1422 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5DJGgB1030030 Content-Length: 3001 Lines: 84 > -----Original Message----- > From: Bart Van Assche [mailto:Bart.VanAssche@sandisk.com] > Sent: Tuesday, June 13, 2017 8:38 AM > To: linux-kernel@vger.kernel.org; KY Srinivasan ; > martin.petersen@oracle.com; linux-scsi@vger.kernel.org; Stephen Hemminger > ; Long Li ; > jejb@linux.vnet.ibm.com; Haiyang Zhang > Cc: jthumshirn@suse.de; Long Li > Subject: Re: [Possible Phish Fraud][PATCH] storvsc: use default I/O timeout > handler for FC devices > > On Mon, 2017-06-12 at 17:23 -0700, Long Li wrote: > > From: Long Li > > > > FC disks are usually setup in a multipath system, and they don't want > > to unconditionaly reset I/O on timeout. I/O timeout is detected by > > multipath as a good time to failover and recover. > > > > Signed-off-by: Long Li > > --- > > drivers/scsi/storvsc_drv.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c > > index 8d955db..d60b5ea 100644 > > --- a/drivers/scsi/storvsc_drv.c > > +++ b/drivers/scsi/storvsc_drv.c > > @@ -486,6 +486,7 @@ struct hv_host_device { > > unsigned int port; > > unsigned char path; > > unsigned char target; > > + bool is_fc; > > }; > > > > struct storvsc_scan_work { > > @@ -1495,6 +1496,11 @@ static int storvsc_host_reset_handler(struct > scsi_cmnd *scmnd) > > */ > > static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd > > *scmnd) { > > + struct hv_host_device *host_dev = shost_priv(scmnd->device->host); > > + > > + if (host_dev->is_fc) > > + return BLK_EH_NOT_HANDLED; > > + > > return BLK_EH_RESET_TIMER; > > } > > > > @@ -1738,6 +1744,7 @@ static int storvsc_probe(struct hv_device > > *device, > > > > host_dev->port = host->host_no; > > host_dev->dev = device; > > + host_dev->is_fc = is_fc; > > > > > > stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL); > > Hello Long, > > As far as I know there is no other SCSI driver nor block driver in the Linux kernel > tree that returns BLK_EH_RESET_TIMER unconditionally. Would a valid > alternative fix be to remove storvsc_eh_timed_out() entirely? If not, what > would break if that function would be removed entirely? Storvsc handles virtualized devices for Hyper-V and Azure. The host decides on how to handle I/O timeout, and makes decision based on how long I/O has been in flight. This is why we use BLK_EH_RESET_TIMER and leave the I/O timeout handling to the host for most cases. > > Additionally, for FC, shouldn't that timeout handler handle the "port blocked" > state? Shouldn't fc_eh_timed_out() be used for FC instead of just returning > BLK_EH_NOT_HANDLED? I agree with you. Storvsc didn't expose rport state. But this has changed with a recent commit daf0cd445a218314f9461d67d4f2b9c24cdd534b. I'll send a V2 to address this. Thank you Long > > Thanks, > > Bart.