From patchwork Tue May 2 18:00:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9708437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9C2060349 for ; Tue, 2 May 2017 18:01:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFD1A2848E for ; Tue, 2 May 2017 18:01:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B489B284CF; Tue, 2 May 2017 18:01:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 046DC284D5 for ; Tue, 2 May 2017 18:01:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbdEBSBF (ORCPT ); Tue, 2 May 2017 14:01:05 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:22856 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbdEBSBA (ORCPT ); Tue, 2 May 2017 14:01:00 -0400 X-IronPort-AV: E=Sophos;i="5.38,280,1491235200"; d="scan'208";a="15596108" Received: from mail-sn1nam02lp0021.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.21]) by ob1.hgst.iphmx.com with ESMTP; 03 May 2017 02:00:55 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nEADK0KA2XI/61WI8Klb8g3JYW1n7lbLmPGKLEFKJFE=; b=hxkm63b9bg8ITQCHu0EXczHosgkJH6LDR5V+9yQY0xIxxybzFKfYiNZq5goyvJ1kQvt0K9/yA9qDJePXRVi5+Zbi3RhIFcCm7dMLESyihTGgX2Mt4jJZIHt2kWZNN42JSTuUNJz1RAJVMkFLpywqOvrWoLiwMlqZy/M411tFl10= Received: from BY2PR04CA040.namprd04.prod.outlook.com (10.141.249.158) by BY1PR0401MB1206.namprd04.prod.outlook.com (10.160.195.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Tue, 2 May 2017 18:00:51 +0000 Received: from BN3NAM04FT028.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::205) by BY2PR04CA040.outlook.office365.com (2a01:111:e400:2c5e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12 via Frontend Transport; Tue, 2 May 2017 18:00:51 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN3NAM04FT028.mail.protection.outlook.com (10.152.92.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Tue, 2 May 2017 18:00:50 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 65.18.19026.159C8095; Tue, 2 May 2017 11:00:50 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 2 May 2017 11:00:46 -0700 X-AuditID: 0ac94371-41ba798000004a52-73-5908c9517f58 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id B5.F9.18148.E49C8095; Tue, 2 May 2017 11:00:46 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Bart Van Assche , Israel Rukshin , "Max Gurtovoy" , Hannes Reinecke , Benjamin Block Subject: [PATCH v6 5/5] Make __scsi_remove_device go straight from BLOCKED to DEL Date: Tue, 2 May 2017 11:00:43 -0700 Message-ID: <20170502180043.14734-6-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170502180043.14734-1-bart.vanassche@sandisk.com> References: <20170502180043.14734-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsXCddJ5kW7QSY5Ig/fLOC2+3LzCbLFn0SQm ixuL17JYbOznsOi+voPNYvnxf0wWpx8dYHdg95g26RSbx4NDm1k8nk0/zOTx8ektFo/Np6s9 Pm+SC2CL4rJJSc3JLEst0rdL4MpYv72dqeCxeMWPje+ZGhifCncxcnJICJhI3J/ZzNrFyMUh JLCUSaJl/1w2CGcro8SSN3/ZYKp2v3zOBGILCWxklFh+uBLEZhMwkvj2fiYLiC0iUChxaVsH I0gzs8BLRokFvR1ADRwcwgKBEkf2SIHUsAioSHz80ssGEuYVsJdY9kgOYry8xNktO5lBwpwC DhKv/jpBbLKX2Pn3LzPIRAmBVawSl5d8ZQVJ8AoIS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essage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39400400002)(39450400003)(39850400002)(39840400002)(39860400002)(2980300002)(438002)(189002)(199003)(9170700003)(50986999)(76176999)(2950100002)(6666003)(15650500001)(5003940100001)(48376002)(86362001)(4326008)(8936002)(2906002)(77096006)(81166006)(8676002)(5660300001)(47776003)(50226002)(356003)(54906002)(50466002)(189998001)(508600001)(1076002)(38730400002)(305945005)(36756003)(33646002)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0401MB1206; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT028; 1:AI1Xg5R8jHWXvWW3vLvSr1+DBLGpZ6TJQJ1nrljpxaEg5LPbYY+LOS9Gq4iuwJIjhy3s1L0/RhMuOMYCxahfix+sKY7Nk9Zanl1a1rRLcp/GP+HFyl5Zm9JMBxGkSbaVmouANjLtU0yzAMn82d2ha2E7gmaPNDFcF/FnTB4yz6pwzTd1UlDPA7TIT73Sw1srE+AnIG+0m5oV+l9hDkdoiA8DGtd7UtO2HgnIKmkKqRgSmFL5lcXbwRFIqiqWIm/BlRedwlOK5VSQrK3Sqdd8UvRSu+3i4HueFqx+Ie8hGyzVkwIslo10ge59LTlQSxtg92nEu11TJ41eM0XnrUD3SM3tmFODQm/yvs8ESigw9wwcG5P60Rl6l7MXOybLLk3NAW3me03D7orFTRRyKrabz0aKWz30fVGESpSd5SW+FOvrd/bGYO2LBCKlbpst5Pcoz7lZFv11CVVcDu/+V5kWF04q0/FwQvd4hJtK/UwRzN4Tz3mEgk7fjzHM5PZsqi0yY5RvZvhwnh6k5jYp5kSRaQ== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7c1157b-ce9b-4bbb-d456-08d491852ba6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BY1PR0401MB1206; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0401MB1206; 3:J7cXRvDuqJw4u9buqOA9cvn8NAUHigegkfyBcGsP5TdUuIGNdxGtENNkQUGF/nBJBAH2KbHzvhX1BmzSC+S/eAC8bS30B6OjUM+mqhudqBACmNflSp3yK11WXVDcgC9XHl5odvciEIy5FlVa4SrQEeXf2cch3XS+8ENPb3wfz8nO45heJKsZAzJbR55ALSS5YBytp3oPP4z2n6zkPbS7mjiqCTAnE0f8UUOFljmkUc1hGcsZGbb/bhy543eLgw1wZPyUHPOyWeL9NCHFpxG2rqlvL1wTG6ClKr/2SfB1Cv7QULqg4fUB4z/40no6WybU4F3GZtzFvJrrI7D1QRqeibruNuI623visv+8I416LdAjQM28aAAhUHHlByhB2G6qxfynPiy49sM0Tgzgt0zA5xcljThfkGLACN1GGTGUAB8ebitT0YCB/3HSF/pzcWdBev2f2xAEf7KG2bRpSqzGIZETiLcBiDlZhORBxNUxuWmQUSzyhatwazBjjRRbfDPL X-Microsoft-Exchange-Diagnostics: 1; BY1PR0401MB1206; 25:fB07ekWLSsLtmofp88bTHofhb7hMyHMfu2Z0lIbRTqymMGmZOQx5u3ZHgp2f/iLtYLtzubUHcNoKYCsYRdz11IuARng/KbF7zl1XIy46hCpKa3TgtxpZkhPmQ2rN8lKL4nyK7e+tt0KD/N5FHQGUM+Uz9Ra5YkBq3s4pA5BEQsaBGV6LStnByTUH6WolwiMYzITHa52VTc4K/eVcCIvv38Sj+KaHroP/5KJwLVy0T5kcSobK1Z9TYiCEXOVbtqUb95IdJYBScbNDPOVUYMoqrw2ixLjm31zKFt6a1jhxyH4O/H8igV7xxCQP/zKhaY8aFawQ4Jz6qlkAqsFKSz74igsMwykU4M2sZSFVMt1QfO7SwGDtgMfwlLjVVEGFmR2Y2YZ4ZaLnEmRD7A/8zlJvdTLKmvXehGjXBJTBR3wD7LQxfYNZMLauZWW1ifD5HQtiuQKqBIuz6lH4Trd8BMNLrw==; 31:+t/U0miOirXBYc/Tz02XnMRgRztMjfYz8iM396z6lm8VJUPeo/7r4+AwGvyiEJuxwgYiKcRAAVqZC2Y3Y8+0aOpqCf2SZ6cMid1GINH0IsZNFf8Ejw3UsVhx8GMT0MWvumgZ6Az0kIlWKe0Z/98Xv4AYdTspYosPME1wGO2tmRPgrJxKegceGi42S0j3DUC/ENkTEoqHiCu5PmP5RLYReyYJYyaNMf7yMP1RaEFG97LL3D1e6ZJYy5Btm7tNzUwPqDVZpgk8HoCcTsfb7iebVg== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BY1PR0401MB1206; 20:38yrso9u93UkEETwDP4VfFp40YSTC0n0+2Csls3P61HM9+/ly/VRrP73+l4hxnBSgZzdR9hQZecf2+99imVt8pqpj47T1TTM9FdPZUVY6npzXjx4RfjmJAp5nGTB5rFNc0igLh6uP6Vm/HjmCECkW6yOPKEbg671Z3SWGwQWwAurZD18pLK4sGJD4C6c78oJo1FmX0/GgPrZF2W10A6z4CRegl5zaaf9pJcGN6iTet4D3BRDlc8kWSiuzIS0nHgsb2l1D342KDDjeKVngmfp4aGgnSCZYWckVZnK1OYkgYzm+ERLGt3zOjpTE9Jm/N7ixunX0W7CwS1aGZ9iPmoUgISm7KEci/GLseeMoYRw9SgLCZ4TrnSp6zvoUVSllotNJP7Xp2faKLtAr3nbD1xpSAMhd6F6P6tPUKq+ph0sAXP1Ci0l7aCkof4Ir5E2Ip0vJnx1XUHBwpkCMv4l9b/Va0k0DbOc/ogAWRW7FQrZiL8DPTqjFKRzhEjgu9IT29f0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:BY1PR0401MB1206; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0401MB1206; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0401MB1206; 4:kNbtkFnnw6TRAKJITvTQRcxUkqLNpQdg6HE4mTHi2B/ZMxqHqsM7EJpz5PJKYsXNceLxf0UJkmAvFTybZiK83GVbiYh+78C8mtAXCoXW71/W9qvYhfY2SA3ymSkytjzzAZAq2N9T03CN/MlTDoC2bBhDZXcg+j5HXgINHpmrULrvCTfRHBzT7MdYh8DbtfTvrdmZdEcLwj2Ix7dFVbOOD6QzFSl1E4Bw75cgVZ9SmXclq4+TB/DJBDtOQtpDwMDXLrpa0+mzrEcYxT2XKnFNFnTsbCTeUq6iS6kHNMAyFCQNvNBuasCnxhjHXiUrWMURu8QzmUT35bMePE81Pbk4rwHDFAYJStwIt8wX2XGaNXnWmoL+O5nmqVqg910I1UDlPxYgLJXO4EioENfytBc51D1I50OC61EGFllJyf1jB/DGuuuuz5sFvFc+M9FB0dd5XBZ40lwQ2HUfMy7MuRmcS9sZ04nul8QiemIF0Cjoe21/n/WXyHk1u/NLRwPiFS/zjQIdm28XxebMvGZUxLbbp45/8RVlIU5HToAIQGJYAGDtM0dRzB5q/nxyG5SZurfIneSCKiNXFklQ/UexEojJnFfo+K0I1A1ZZ3SfxZ9YvqibSME9uLrHy0RHdZ14/H5VEzRKxumX8a3plhwTO42y8MA45NCNdMQY9/t+vm6Tp9XYmlDWfjpCn1+rThWLy08+IbzZJvoMO8joJKWR/if7BW7trybDaxH0Pg0t+qa5DVerTR/ayl1sLj0Ohbao9USzHLIPcnULF1Ir5Njet2iTVwMPYpdBz57amkVdFFiFX8fe+2jsx5G/cGyfA8j8o25wyfeYPtuYCuDjU+U+ljbFciaCzVIm/YI61n22C9pLM+I= X-Forefront-PRVS: 02951C14DC X-Microsoft-Exchange-Diagnostics: =?us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YWZsTFLazW3Z3vUC/kY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0401MB1206; 7:bUeUaCyaH4dj6yY4VIPBO/lObTxffsvxFmXQPaMALFFmMjSAMwAiJBvIX7hD+sk02Lae8lHfKNchh8WpZZv3R2pUopTVWKCQjdBKIFPATU6rMoNntuiwnxEEXsNfGfWh3TJG/018ec+1cECkzqVeYM1oOhofm5JjZD2ZKMjmig1XEq2xC7o4rMMMwxiQQeqBKxE+clD4hr06YIJznsuWkVv7rTUETwqMFzQzSAphx5ds6GYrhf9ayVon8S3Mdf2zpi9KoJZjM4EgDuOw24FN6x0SHGrOlQXqc/LaTIKsR87vugJP4LhK7P4jOtIeVkpGI+J7LbZtw871a4M2lNynug==; 20:CCl6K2zCIzU5NvjwpZ50j53mvZTV5EFyNE7giNaPFWF7o82CTA2M32BdBM0zsHhoXO4fzAJmCpHCoxw/xKtZmQCWAUvTz4Xcazx5Uv9+hcQCKwrknaKPWsUmhjfH3PfxYKWp5HNO+DZmr6D9MK9Gvb1sV7hNeLslBek667Qbugo= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2017 18:00:50.8707 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0401MB1206 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a device is blocked, make __scsi_remove_device() cause it to transition to the DEL state. This means that all the commands issued in .shutdown() will error in the mid-layer, thus making the removal proceed without being stopped. This patch is a slightly modified version of a patch from James Bottomley. This patch avoids that the following lockup occurs: Call Trace: schedule+0x35/0x80 schedule_timeout+0x237/0x2d0 io_schedule_timeout+0xa6/0x110 wait_for_completion_io+0xa3/0x110 blk_execute_rq+0xdf/0x120 scsi_execute+0xce/0x150 [scsi_mod] scsi_execute_req_flags+0x8f/0xf0 [scsi_mod] sd_sync_cache+0xa9/0x190 [sd_mod] sd_shutdown+0x6a/0x100 [sd_mod] sd_remove+0x64/0xc0 [sd_mod] __device_release_driver+0x8d/0x120 device_release_driver+0x1e/0x30 bus_remove_device+0xf9/0x170 device_del+0x127/0x240 __scsi_remove_device+0xc1/0xd0 [scsi_mod] scsi_forget_host+0x57/0x60 [scsi_mod] scsi_remove_host+0x72/0x110 [scsi_mod] srp_remove_work+0x8b/0x200 [ib_srp] Reported-by: Israel Rukshin Signed-off-by: Bart Van Assche Cc: James Bottomley Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Hannes Reinecke Cc: Benjamin Block --- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/scsi_sysfs.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index bbce1f1db515..b83dca6b495b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2618,7 +2618,6 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) case SDEV_QUIESCE: case SDEV_OFFLINE: case SDEV_TRANSPORT_OFFLINE: - case SDEV_BLOCK: break; default: goto illegal; @@ -2632,6 +2631,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) case SDEV_OFFLINE: case SDEV_TRANSPORT_OFFLINE: case SDEV_CANCEL: + case SDEV_BLOCK: case SDEV_CREATED_BLOCK: break; default: diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index a91537a3abbf..1f243ac16010 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1290,7 +1290,20 @@ void __scsi_remove_device(struct scsi_device *sdev) * wait until it has finished before changing the device state. */ mutex_lock(&sdev->state_mutex); + /* + * If blocked, we go straight to DEL and restart the queue so + * any commands issued during driver shutdown (like sync + * cache) are errored immediately. + */ res = scsi_device_set_state(sdev, SDEV_CANCEL); + if (res != 0) { + res = scsi_device_set_state(sdev, SDEV_DEL); + if (res == 0) { + scsi_start_queue(sdev); + sdev_printk(KERN_DEBUG, sdev, + "Changed state from BLOCKED to DEL\n"); + } + } mutex_unlock(&sdev->state_mutex); if (res != 0)