From patchwork Tue Aug 16 23:48:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9285021 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 3273260574 for ; Wed, 17 Aug 2016 00:22:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 220E8287A6 for ; Wed, 17 Aug 2016 00:22:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 168E2288A1; Wed, 17 Aug 2016 00:22:24 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 0661B287A6 for ; Wed, 17 Aug 2016 00:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbcHQAWW (ORCPT ); Tue, 16 Aug 2016 20:22:22 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:34677 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753399AbcHQAWU (ORCPT ); Tue, 16 Aug 2016 20:22:20 -0400 X-Greylist: delayed 2015 seconds by postgrey-1.27 at vger.kernel.org; Tue, 16 Aug 2016 20:22:20 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KyKBd6OzNcKRHvJ295varElNxqRFCMHNLSdabKFPvbU=; b=Vmjsw9YEfHXFILNE294AyIWHMFuQv+PMT+lNvt9jhEAPY4F2R7oq0STjWzxTqm3e7hRtcRSMzFTq69LwauLH5UxPQ25Lvg5G8P88qAiTX82FVMe+TOZNB+MGjpgr3I68dRl0v9PTpO4eHr3ZjAEVb9our70xgX8lYH17GnukRH0= Received: from BY2PR02CA0033.namprd02.prod.outlook.com (10.141.216.23) by BLUPR02MB097.namprd02.prod.outlook.com (10.242.188.11) with Microsoft SMTP Server (TLS) id 15.1.528.16; Tue, 16 Aug 2016 23:48:42 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::144) by BY2PR02CA0033.outlook.office365.com (2a01:111:e400:2c40::23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Tue, 16 Aug 2016 23:48:41 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.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 BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.567.7 via Frontend Transport; Tue, 16 Aug 2016 23:48:41 +0000 Received: from MILHUBIP03.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 CD.78.61581.1B4A3B75; Tue, 16 Aug 2016 16:41:37 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.301.0; Tue, 16 Aug 2016 16:48:37 -0700 X-AuditID: 0ac94371-952c29800000f08d-b1-57b3a4b16d75 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id BC.E0.03606.456A3B75; Tue, 16 Aug 2016 16:48:36 -0700 (PDT) To: Jens Axboe CC: Christoph Hellwig , Mike Snitzer , "linux-block@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] block: Fix race triggered by blk_set_queue_dying() Message-ID: Date: Tue, 16 Aug 2016 16:48:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsXCddJ5ke7GJZvDDRqOi1msvtvPZrFy9VEm i723tC3aNn5ldGDxuHy21GP3zQY2j/f7rrJ5fN4kF8ASxWWTkpqTWZZapG+XwJWxt2c/Y8Fs 9orTu9ayNzBOZuti5OSQEDCR2Pp6EWMXIxeHkMBSJonPp/exQjg7GCUmXHvOClN16tBkqMRS RonmndtZQBIiAgoSPb9XsoEkmAVaGCUWTZjLBJJgEzCS+PZ+JlARB4ewgLPE1NnZIGFeATuJ L1dWga1mEVCVuHpjKtgcUYEwiWl337JD1AhKnJz5BKyVWUBTYv0ufZAws4C8xPa3c5hBVkkI TGKVeLd0KthxQgLqEieXzGeawCg4C0n7LIT2WUjaFzAyr2IUy83MKc5NTy0wNNErTsxLySzO 1kvOz93ECAnqwh2Mr297H2IU4GBU4uG9YbU5XIg1say4MvcQowQHs5II76lFQCHelMTKqtSi /Pii0pzU4kOM0hwsSuK8F6M/hgkJpCeWpGanphakFsFkmTg4pRoYNX5GTBSNP+X9WraRr2xO /eEvV/JCj9VncYlsSeh9LuqcImIUarZ8lVLttUrjFwf2SExvaVpuu7ivuq81+0Cv9aF7L3fP aXG4FP5cJC/i59H37wPiezSOVikvEbvT9+LSJQOdd08aXvD6aLe/7Vy/3HeWsdvVlxyMInv2 MpmtEOq29b0va7BEiaU4I9FQi7moOBEALzh+hGYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJMWRmVeSWpSXmKPExsXCtZEjRTdk2eZwg7Y2M4vVd/vZLFauPspk sfeWtkXbxq+MDiwel8+Weuy+2cDm8X7fVTaPz5vkAliiuGxSUnMyy1KL9O0SuDL29uxnLJjN XnF611r2BsbJbF2MnBwSAiYSpw5NZu1i5OIQEljMKPH3wkZ2kISIgIJEz++VbCAJZoEWRok9 +9+zgiTYBIwkvr2fydLFyMEhLOAsMXV2NkiYV8BO4suVVWBDWQRUJa7emMoCYosKhElMu/uW HaJGUOLkzCdgcWYBdYk/8y4xQ9jyEtvfzmGewMgzC0nZLCRls5CULWBkXsUolpuZU5ybnllg aKRXnJiXklmcrZecn7uJERxanFE7GK9PND/EyMTBKdXAuCQ+eGd0yP4vAlN31TIcNjjI1lmv x/Yqbs2jxWsu7qtQE9vdFZFgk3r7glvDjePzJhhndz5PllAK1lKN3Ll00xy2jpbF+SZ6/kLs 3Gsd+TbsePik16ww9oX90n1JZ/gtdq52+vP/w83euf5uXMatzz6b1qXy60a/nXSYMXZJjq/V 6vVhYql6SizFGYmGWsxFxYkAV59mrt0BAAA= X-EOPAttributedMessage: 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:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(305945005)(8936002)(31696002)(86362001)(33646002)(81166006)(575784001)(36756003)(69596002)(83506001)(230700001)(11100500001)(4001350100001)(229853001)(2270400002)(65806001)(68736007)(106466001)(65956001)(19580405001)(87936001)(47776003)(2906002)(19580395003)(64126003)(7846002)(23676002)(4326007)(92566002)(7696003)(586003)(626004)(356003)(53416004)(50466002)(54356999)(189998001)(97736004)(81156014)(110136002)(77096005)(8676002)(50986999)(31686004)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB097; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:29RRtlqyFHz1Hmkq093mRdKPH6xCO/NAKNMiwP/pMFFok2j/HRE2LYQMjDhxcqflC+tS2L44FcQt+/ME+qqFooR4IYx7bW1oHCRVnUcqdKfX2OaOcL+5X+8AUOvZg0tTP2T8LhxAdS0FIVQSX525yeROmh4tDOPFLrNOlxgx5YzS6+MIIO+kOgATRooLvqXPDeCwrAd8pLhm+AGmkWjm2u5bEFUmC5I93362LwIsNEu+bxX99zcK7fi4z+3EYYehHgYuIAHQ5tGKViNeGrQmf8UGquAvmFmYElDIsruIvK7O0fYNaOJNuwt7+V6ItllF1a54mvXY9LK+zU1fyRCpwHcFlpStQwncGkiPSMrTcHXcpx77Xlh9MI7uxF2hwMg32J7beRcRhjedJGiC/fVLqwYmk0asapXj3352nbpV2f/9DDVzXkvbL64NezyR1Gi2J6Dt1FQE0yUkP/1qFSwpEDqmohO5Hwgvdp2Pt6xRcFB9qefpv+Mb8X7X4hVaMWUzXqC84kdnnQzwqmcBPcta7A== X-MS-Office365-Filtering-Correlation-Id: 49ac3994-9909-48ad-2ca3-08d3c62fdab6 X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB097; 2:AIPGeMuUum5/ofc80S8BK5u2Pa5XC8iqwnJZ5PWpx/0gT0oDMfU+qZRz3ift83J1/WwlbA40LUkmE84qULzxhN955o+RSWMtVVjlk170++D0m6JU5nEBpnR6I1inisuYG2/HByzCze7NRMNzghbacepQS3L5T4fKvpgIWRiv9AFFwkDR9VkrrnGdDAc+bFk8; 3:kka6Ht7Uzbpq9wUwTskP2RdSCDgvg3fdpprapVzyPw3t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FCiF6zu1nqkNRIedcg3M//TIJ3O3xAZl0yL6ZdBHsJLLexitwTHduhZaNOfJ9x7G/+rE0lTDCRwa3IGOAVg3FggDXdciY3rNFIOiz/QgGc9+5OUBWou9gH9KxXolrDGmEUkIskgqOKux88ktOAXB/vlXl5YIsb2C0q8TrXhr3wd98bqAaFy/OCJ+tlG3/E3Vyacf48ksNdhQug4jsmngFlJZvO4N/hMIJ3ZdM7CA7cYvr6L59WhH8zwQ6KzVvOqSR593t1ibozHpZClBrBBaT2YbBidq3LZCpMozEq3Z4ckPVDX5O2gdY83x+GvepWOaWs8Gsn//k40hTDG9ZOY+wG00YwbHOIhowIuSCXM2zreWG72fCC4FFQJQDNrAMSWmMyL1RA3/0r72Kw0X2Xf2Nzk+d5H94cewjVbe92HKVlvYt9ayOiMlDx7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(3002001)(10201501046)(6055026); SRVR:BLUPR02MB097; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB097; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB097; 4:5TplGTpdWGTCJPUfwfFEZFhW3gNH/JpIr2k7+sF5ALoGgrqYi9fDf8g5+F7UzjS3WgYaO2uA2zp6TpqkTFkKI4woIB+4j+9oyd/nDb9vNf+kSdK2AmDOyF1Z/CdG8fkkEQsDijDvGD/muLmr/wbUxjwU1sQmNRhjWVa3csQSM9L2ajsdhuQDtzey3yzGEftX/9g19jLzgxk4z6rdmibR4/hHLVhdk03pu/6gm3Yu02kKSkq9uhrd5CztXYrRIYCQlDCPkAGbGqVnPPD0wyoSMZlbNXyc1R83DGaM893Ocf+HY6nzeAhwtJ4eSU+22g4k1QsyTlXfdfjOpVpfH47EX822ujPXMzfRW89/slTsAsVSpQo8HIZiLzLcI5/rn1Pq6e8pQv14lN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53WDMwNklNdnFxSEdKY2sr?= =?utf-8?B?OHBFR3lPdmQvQjJJSkRVL29KdS92SkNWeDltNXpjbmZaaElpc1NFaVE9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB097; 6:Snz6BCS/MltCzv8BcASQDGPIofeHxUVJG2XlOdxBi1/a6bdTZxgZRXakMUVoS3vLMQVO9xHGTp2I/j9PKyOkUoD0O7HptIZkgiC5l7Uq7W8J4RpQuUPetRuq1Ma26Wo4R/R81Q+VMJLwhdmHH3noGpFZknusPsVnW/AdY4puNbt/exAIqcnSfTTcyhR7N6rKUyGO/uHkTt8tC1jfMw9E7WmboJLtBH4tQRM9gH2YWRoTzIFvAZb4pWQGJTrnqv40JKpV2mfRayT6KwPcVqggx5LakiXFR7YNnBWghQv8yuTM6Zk2zjC+URvMAqBf81088acBMhquaKMb9mpcpXVEeA==; 5:VHH6yXbVUn7LYj50jGJ7KXKF6HU+fjUA26MtWxLhJ9VPQpkwucQKgqf+uK9ZzgkO2/76t1lMaDXKqHn3EH4FvSQ2/Fpl7fyUUVfFt5LsjmaWmkE9qQJCSgH/823hwsXQMpRlXw04agomLQevdBcA2g==; 24:QEZDQ/ReRoSvr22HYO/97m9zK9JvEEGsir/Oj4GUOFWx41Pk/6ZxfBNzFeSEAF75xjg2CNf1L1yHI4kpgscPGEbJwa3QR9mqPJYDd+hd+sM=; 7:EUbdU8hqNTJgj4EeSEMddYG/XpvouKup6BX30z8sfn78JDbUR/JFAg5M1CILJGMIdCVX8HXoZ0s7sWd485I9RL3pKYJAhOBMocP+DJfDgbqQP/U2eA5bVlByE0amTdFcWk9Xq8/8HPTFzBDaMJ2emJUcRDnWdUlujDIMZZWDEr28ctolb3jrelRT+Enrp3SCxx3Z1ghk8FoCOoLxUnskhNZDfnfuFzgXM4mO8rHPjA2RGFQrVvq8B/Gf95s/1xKk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB097; 20:atE1sSf7Y5HbRJL836mP722wnP7owBkfP1sru6LNp/nWodCxQ1Itug45kp4ckgczWyU++XMKqCuxO7q2VhsSzQA4myWdwzKr2kgNBCrXrUq3j3EdNDyfDdU+2YJaA50YGmvGq1Od/P4mOdlO9j2ifsrgBGLlf+91Fgt6VL9Q5nqsOSKa0G4euL+JTJtuxDpmd62E2yY5MyMPBFBf3AtqGHaHSIxmAdJek2NDm3yYKntj0eSmyKT9uSnlA7J8R6Sq X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2016 23:48:41.9670 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB097 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP blk_set_queue_dying() can be called while another thread is submitting I/O or changing queue flags, e.g. through dm_stop_queue(). Hence protect the QUEUE_FLAG_DYING flag change with locking. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mike Snitzer Cc: stable --- block/blk-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index e0bc563..96d5835 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -515,7 +515,9 @@ EXPORT_SYMBOL_GPL(blk_queue_bypass_end); void blk_set_queue_dying(struct request_queue *q) { - queue_flag_set_unlocked(QUEUE_FLAG_DYING, q); + spin_lock_irq(q->queue_lock); + queue_flag_set(QUEUE_FLAG_DYING, q); + spin_unlock_irq(q->queue_lock); if (q->mq_ops) blk_mq_wake_waiters(q);