From patchwork Fri Nov 20 01:45:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7663721 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B259F9F2E2 for ; Fri, 20 Nov 2015 01:45:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 731F4204D1 for ; Fri, 20 Nov 2015 01:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D91E204A2 for ; Fri, 20 Nov 2015 01:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934895AbbKTBpL (ORCPT ); Thu, 19 Nov 2015 20:45:11 -0500 Received: from mail-bn1on0087.outbound.protection.outlook.com ([157.56.110.87]:40864 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934401AbbKTBpI (ORCPT ); Thu, 19 Nov 2015 20:45:08 -0500 Received: from BY2PR02CA0072.namprd02.prod.outlook.com (10.242.32.30) by BY2PR02MB1378.namprd02.prod.outlook.com (10.162.80.143) with Microsoft SMTP Server (TLS) id 15.1.325.17; Fri, 20 Nov 2015 01:45:04 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::111) by BY2PR02CA0072.outlook.office365.com (2a01:111:e400:2c2a::30) with Microsoft SMTP Server (TLS) id 15.1.325.17 via Frontend Transport; Fri, 20 Nov 2015 01:45:03 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server id 15.1.325.5 via Frontend Transport; Fri, 20 Nov 2015 01:45:03 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id DE.8C.32178.C1B7E465; Thu, 19 Nov 2015 17:45:00 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.248.2; Thu, 19 Nov 2015 17:45:00 -0800 X-AuditID: ac160a69-f79f76d000007db2-03-564e7b1ce000 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id 8F.9A.03643.C1B7E465; Thu, 19 Nov 2015 17:45:00 -0800 (PST) Subject: Re: [BISECTED] v4.4-rc1 SCSI disk init crash To: James Bottomley References: <20151119192135.GD18138@blackmetal.musicnaut.iki.fi> <564E28DE.6010200@sandisk.com> <1447963712.2234.31.camel@HansenPartnership.com> CC: Aaro Koskinen , linux-scsi From: Bart Van Assche Message-ID: <564E7B1C.10509@sandisk.com> Date: Thu, 19 Nov 2015 17:45:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447963712.2234.31.camel@HansenPartnership.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsWyRoxnka5MtV+YwamphhZrXjhYbOznsOi+ voPNgdlj2qRTbB6Hvy5k8fi8SS6AOYrLJiU1J7MstUjfLoEr4+GUJ0wFbXYV9+f5ND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DjEwcnFINjHI9G+Oj0+v7+NIX VBn8Cvrpxm2g3exy4a6KT86l3NhSbk+3M6wvS0LcbRVT5WLiTU18NF9eEgz3T+l86N9xWorl 2s/H9+2fispUBOvIpYXFyzzbfch8ls8R8UhWs7mVH5l8vrj8EDJpuZNU+MHYfPMO7+nVaj9P hOuwHU+5pij+Wdf09kMlluKMREMt5qLiRACNodhW9wEAAA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC004; 1:Jf2kcNSaPuaZg13FVD01R46CkA022WvlY/vJQYFQcWukmf0hRGL74MA4IUmKvT60KlhhlKxS62AU0HNCUioojTv3+ynf8/XL1ZdmPaNmR5vpJIiDDObzC8DheNIkplWzN6d2UhGDeNZJWHNnJqTJz6RZAbmgixpPZ2mB5pB5jhstqZKFAePSSLo79pGVqeLbfNvwjy07s+Eoks0qt78Dh02/wMjYAqSCqcCfZkIkA9OJiWz5p1ffUe4usMulSzv2VaPE15qHyH629U9AUtusIqL8aihN/81eIXESmKHGYZnmz6bLIxaMQEawH9Y2wppBLaSU0WzorDRF9xdSYwNUNOJ1XaHrTLZbZ5nxWkHgrarRunSBzltv854H4iPYDmGxYD0a0qIVc1zLwuwhQRJmNQ== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(164054003)(24454002)(479174004)(51234002)(199003)(189002)(377424004)(377454003)(5001960100002)(65956001)(50466002)(5008740100001)(33656002)(65816999)(54356999)(77096005)(76176999)(64126003)(2950100001)(87936001)(69596002)(92566002)(50986999)(83506001)(19580395003)(4001150100001)(110136002)(586003)(23676002)(11100500001)(65806001)(189998001)(19580405001)(5007970100001)(5001920100001)(4001350100001)(36756003)(97736004)(86362001)(47776003)(106466001)(230700001)(575784001)(81156007); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1378; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1378; 2:/YjsRNx4I79DI08neIVoF+9EzN9LPAlR34yu4La6G3ptd2x1H18+nr5pEcr4W2RqPhIZFObJSEmLezEZ+mK3s4um85HxKiqQpG2xlIm2pgyd4gWVZ0goYlEI5haOjjSdcWnY70ipIcGLAMJjTtOp7rHTNIJLMBvS0365phVPjAo=; 3:fN8SIm6S7WTdfmCenzKCI3z9fnEaQSkLHlGFE84g4EJeqEhD3g7kalIgnwdbnc7vFTvjeB5hHAZYg/ewV7W1WOhco+bsuV7MOzGWsxjKiFrPYPuYimb1xlbBvRzbF40vrAdpRSa6VsLwunWPLeVIbxcsNJ9ow8xA3vq7IgxFNpdPioFIzyhh02gy0FXQWMnq4eD83ls+0U/08cYgY4U/RVGyT5Lfl2nsnEyMGt+wqJoj1Q8g5T7BCU0utIwC/EjzBsVtPJdwzz9P7QCwHtQd0w==; 25:/jDM74craWeIaTvD9GQnI+QufSR/bF0HWd+wsvV6PGk0eNTJSVKBevc+pbhLgO3uSXr+Zt/aQQdCtc2N54ZUJS4/fvkOvdRAw90VIOHPlodQKbNDcEfKi/KZ7iIiK8hCvkXkB1iY80tk/+DWiQ2/v75LvxTGZyOkFgtx6g3ej3mVSlEIM4uVWM/q3x5Dj4/DhRMUUwoS2AfbPHTs9q5GNHbKsQtBea7Sd3Aib4BLFuv2TNFplAJT3l7DZs23pHblY58bUgjlBRRXOD3ONpAj1Q== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BY2PR02MB1378; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1378; 20:HR1CUucMxXVGRq3pNI4uICF9CfU8NG34lCpojbwf4gtfR7Ui1Ct7ewBQf7cC4YcP2oq+58onzfKMGlVqMJ0+GcYEDjnwgWRr7wLDdPCXGxpgRXnoKleWZZ1S+ES3rfL68pEQvpBg+6ZEDjWC91NgQgVsr/U8dIVFyoseJ1ZsegInfuPdnyMNJJ9Tl/+OwINbBoa6diUBF85PiVxY7w80gTBIdeTXp9ugofgWQSF1y8mN6t8SPy2EiMmIevO7BYlzRufUe4LUQH7b/1fDev49T8Xihx9I7GyZK+mVossVhTg/z0fEO0J20BoLDvvTaZ0l0biabMyIKPt4DehgLDot1FMPz5fEgEttAmKbrqwjgguJdumy+j1wP8xUJ/p0IBfDnrba39jCssHeACuYQyC8mnD/ruhnCB3LNfeIBpD+iYNTxMGE6zTHINTfxxxnzfVBkGJGf3VGOeOvjypBz5WZpcn609Wn68KU8Z7dBq67zIi1ai/1SbyETiXjNB7+ZIBN; 4:WKsJeKl6JCAQwwR8ISKNfApOKTROWU0IV+9YoLyi6xS5Y55XmhKkoeQqX0vtQTg2D+e5RuhuHvjoZjCv1TXMMn3AUv3V5XDbwyk82Rgz3Q7mw9eezZjy0pJSxJC4ca15SHMaj+HbZ/T6U2CHD8WvBXGf+b9/tUEXYF6d7unCbLH3Ko/RJ5sNQ3AeScV+qwD0Da1K63tylR6JfhC/UPl2OTLr906kVf42K3urr+eAgEDHZZoNB7APICM2ooxbV8v16X7O6+guan995pUrgkKhBswFukDAeX+K/6ENxuQYvHvv7SDQ20p59IGgQZfKN/JhUHPdrL09RlGdYpMBrySNs7A64wRQZOEd+uN9IdTxFg3dHR4ooTkmn7C8O0y12qobe3/Ny2Df7g2j+z5RzfXL0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001); SRVR:BY2PR02MB1378; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB1378; X-Forefront-PRVS: 07665BE9D1 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyTUIxMzc4OzIzOkZ0aTloZ0FsWHVEZ1NSTTQ0U0ZkSUxudVRh?= =?utf-8?B?eWJRejIvd09NODV2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GlaOnrHSuebrR7o88Q==; 24:F8QSLWI2Ey96zRKVsu24Xn6WxHW8gM/DYoCXhSRnhr5gAYoQqWIA9fVfrRjz5Sulpfen0sXc86l+F8J8oelpn/7fXvDtzXd4nuAUDd/zLtk=; 20:83PkDub4r+SzLzpC4MWvP+RbvKljYPmUVFXWNQHoiJ7C93u8+PqUFl0S3hPIDhtnLcmCzIxjETsibzNBc3EfC4wfNnDHE51xt+YZFa3nmmY8l3ggHNzz0kCZiA1/RgtHB3sa5q3Qa5ifEIOgkhdnajQyTFGMb8xMWSsip0yfmP38CscuH5PzKa6HbPQWdCIvKpbGryqlHOnp6SBayVy0uD9ur5z9UocXN6fMErzTMaQxrPaX3lsoZEXYl3xzsLXp SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 01:45:03.1727 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1378 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 11/19/2015 12:08 PM, James Bottomley wrote: > On Thu, 2015-11-19 at 11:54 -0800, Bart Van Assche wrote: >> On 11/19/2015 11:22 AM, Aaro Koskinen wrote: >>> I get the below crash when cold booting OCTEON router with USB disk as >>> rootfs. Bisected to: >>> >>> commit bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0 >>> Author: Bart Van Assche >>> Date: Fri Sep 18 17:23:42 2015 -0700 >>> >>> scsi: Fix a bdi reregistration race >>> >>> Reverting the patch makes the board boot fine again. >>> >>> A. >>> >>> Waiting for rootfs media to appear... Press ENTER to interrupt. >>> [ 1.540522] usb 1-1: new high-speed USB device number 2 using ehci-platform >>> [ 1.699752] usb-storage 1-1:1.0: USB Mass Storage device detected >>> [ 1.706054] scsi host0: usb-storage 1-1:1.0 >>> [ 2.702105] scsi 0:0:0:0: Direct-Access Ext Hard Disk PQ: 0 ANSI: 5 >>> [ 2.714214] sd 0:0:0:0: [sda] Spinning up disk... >>> [ 3.720503] ... >>> [ 6.674040] usb 1-1: USB disconnect, device number 2 >>> [ 6.750508] .ready >>> [ 6.752558] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=0x04 >>> [ 6.761112] sd 0:0:0:0: [sda] Sense not available. >>> [ 6.765918] sd 0:0:0:0: [sda] Write Protect is off >>> [ 6.770741] sd 0:0:0:0: [sda] Asking for cache data failed >>> [ 6.776236] sd 0:0:0:0: [sda] Assuming drive cache: write through >>> [ 6.782745] ------------[ cut here ]------------ >>> [ 6.787383] WARNING: CPU: 1 PID: 15 at /home/aaro/git/linux/block/genhd.c:626 add_disk+0x41c/0x478() >>> [ 6.796549] Modules linked in: >>> [ 6.799624] CPU: 1 PID: 15 Comm: kworker/u4:1 Not tainted 4.4.0-rc1-octeon-los_73f9f-00002-gd81c963 #1 >>> [ 6.808959] Workqueue: events_unbound async_run_entry_fn >>> [ 6.814296] Stack : 0000000000000001 0000000000000004 ffffffff81760000 0000000000000000 >>> 0000000000000001 0000000000000000 0000000000000000 0000000000000000 >>> ffffffff81f3abc8 ffffffff811893f8 0000000000000000 ffffffff81f3a758 >>> 0000000000000000 0000000000000002 0000000000000001 ffffffff81f40000 >>> ffffffff816b78f8 80000000330e9000 0000000000000272 0000000000000009 >>> ffffffff813471cc 0000000000000000 80000000330086a0 8000000033008400 >>> 80000000330e9000 ffffffff811cea44 800000003314bb68 8000000033008400 >>> 80000000330e9000 800000003314ba70 800000003314bb88 ffffffff8135331c >>> 000000000000015f ffffffff813c0900 000000000000006e 0000000000000000 >>> 735f756e626f756e ffffffff81124190 0000000000000000 0000000000000000 >>> ... >>> [ 6.879950] Call Trace: >>> [ 6.882414] [] show_stack+0x88/0xa8 >>> [ 6.887475] [] dump_stack+0x6c/0x90 >>> [ 6.892549] [] warn_slowpath_common+0x94/0xd8 >>> [ 6.898481] [] add_disk+0x41c/0x478 >>> [ 6.903552] [] sd_probe_async+0xfc/0x218 >>> [ 6.909047] [] async_run_entry_fn+0x4c/0x120 >>> [ 6.914898] [] process_one_work+0x17c/0x438 >>> [ 6.920663] [] worker_thread+0x168/0x5e0 >>> [ 6.926159] [] kthread+0xd4/0xf0 >>> [ 6.930968] [] ret_from_kernel_thread+0x14/0x1c >>> [ 6.937069] >> >> Hello Aaro, >> >> The patch you mentioned changes the device removal code. The above >> output shows a warning triggered by the device probing code. That makes >> it unlikely that the above warning is caused by my patch. Please double >> check your bisect results. > > It's obviously caused by your patch ... look at the event sequence: it's > a disconnect triggering removal on an in-process probe. > > The question is how to fix it. The original problem is that we have a > set of three bound names that die at slightly different times. The > solution: to extend the sd and bdi name beyond the queue one worked for > your use case, but caused this. Ideally, we'd probably just like for > the scanning code to wait until all the names are gone before trying to > reacquire them, but that looks problematic too. Hello James and Aaro, How about reverting commit bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0 and replacing it by something like the (very lightly tested so far) patch below ? Thanks, Bart. --- drivers/scsi/scsi_sysfs.c | 2 ++ include/linux/backing-dev-defs.h | 1 + include/linux/backing-dev.h | 1 + mm/backing-dev.c | 28 ++++++++++++++++++++++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index f5ace2b..8d64518 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -1110,6 +1111,7 @@ void __scsi_remove_device(struct scsi_device *sdev) device_unregister(&sdev->sdev_dev); transport_remove_device(dev); scsi_dh_remove_device(sdev); + bdi_sysfs_del(&sdev->request_queue->backing_dev_info); device_del(dev); } else put_device(&sdev->sdev_dev); diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 1b4d69f..1a42ecb 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -135,6 +135,7 @@ struct bdi_writeback { struct backing_dev_info { struct list_head bdi_list; + bool is_visible; unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ unsigned int capabilities; /* Device capabilities */ congested_fn *congested_fn; /* Function pointer if device is md/dm */ diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index c82794f..9004d90 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -24,6 +24,7 @@ __printf(3, 4) int bdi_register(struct backing_dev_info *bdi, struct device *parent, const char *fmt, ...); int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); +void bdi_sysfs_del(struct backing_dev_info *bdi); void bdi_unregister(struct backing_dev_info *bdi); int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 8ed2ffd..b56971f 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -774,6 +774,7 @@ int bdi_init(struct backing_dev_info *bdi) int ret; bdi->dev = NULL; + bdi->is_visible = false; bdi->min_ratio = 0; bdi->max_ratio = 100; @@ -806,6 +807,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, return PTR_ERR(dev); bdi->dev = dev; + bdi->is_visible = true; bdi_debug_register(bdi, dev_name(dev)); set_bit(WB_registered, &bdi->wb.state); @@ -837,6 +839,28 @@ static void bdi_remove_from_list(struct backing_dev_info *bdi) synchronize_rcu_expedited(); } +/** + * bdi_sysfs_del - remove a BDI device from sysfs + * @bdi: BDI device pointer. + * + * It is safe to call this function more than once. + */ +void bdi_sysfs_del(struct backing_dev_info *bdi) +{ + bool is_visible = false; + + spin_lock_bh(&bdi_lock); + swap(bdi->is_visible, is_visible); + spin_unlock_bh(&bdi_lock); + + if (!is_visible) + return; + + bdi_debug_unregister(bdi); + device_del(bdi->dev); +} +EXPORT_SYMBOL(bdi_sysfs_del); + void bdi_unregister(struct backing_dev_info *bdi) { /* make sure nobody finds us on the bdi_list anymore */ @@ -845,8 +869,8 @@ void bdi_unregister(struct backing_dev_info *bdi) cgwb_bdi_destroy(bdi); if (bdi->dev) { - bdi_debug_unregister(bdi); - device_unregister(bdi->dev); + bdi_sysfs_del(bdi); + put_device(bdi->dev); bdi->dev = NULL; } }