From patchwork Mon Sep 26 02:56:19 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: 9350133 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 9407E6077A for ; Mon, 26 Sep 2016 03:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87BA728C64 for ; Mon, 26 Sep 2016 03:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ACE228D0A; Mon, 26 Sep 2016 03:31:09 +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 C41AA28C64 for ; Mon, 26 Sep 2016 03:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941260AbcIZDbI (ORCPT ); Sun, 25 Sep 2016 23:31:08 -0400 Received: from mail-cys01nam02on0069.outbound.protection.outlook.com ([104.47.37.69]:35098 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932234AbcIZDbG (ORCPT ); Sun, 25 Sep 2016 23:31:06 -0400 X-Greylist: delayed 1142 seconds by postgrey-1.27 at vger.kernel.org; Sun, 25 Sep 2016 23:31:06 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=VpbSZzo0O7eZwE3Wbcau7cy6vtX0lXGOqkLJ7QbKG6k=; b=VV/Eyo28h56q1+ey/9QSfxyawukGQdUXHeIA8KA02InNbk07bqWVwbKmliQezyR+G8Mj1GyqnjUqOicT5arIZh/ikzCxVIlQAVknsqLQRaBlTq7bPkVHiXhzABPBVwhsOCAyQfzdOdJtBgLh2YwD2O+dHAtyRoazKnqBbk5Ig3c= Received: from BY2PR02CA0113.namprd02.prod.outlook.com (10.163.44.167) by BL2PR02MB2131.namprd02.prod.outlook.com (10.167.97.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 26 Sep 2016 02:56:24 +0000 Received: from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::157) by BY2PR02CA0113.outlook.office365.com (2a01:111:e400:5261::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5 via Frontend Transport; Mon, 26 Sep 2016 02:56:24 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) 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.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.5 via Frontend Transport; Mon, 26 Sep 2016 02:56:23 +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 F3.A0.26959.60C88E75; Sun, 25 Sep 2016 19:46:33 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.301.0; Sun, 25 Sep 2016 19:56:19 -0700 X-AuditID: 0ac94369-babff7000001694f-76-57e88c064bf3 Received: from [10.50.231.77] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 75.8A.03606.35E88E75; Sun, 25 Sep 2016 19:56:20 -0700 (PDT) To: Jens Axboe CC: "linux-block@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] genhd: Handle part_tbl and part pointers correctly Message-ID: Date: Sun, 25 Sep 2016 19:56:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsXCddJ5kS5nz4twg0mrNS3+7znGZrH3lrYD k8fE5nfsHp83yQUwRXHZpKTmZJalFunbJXBlbF38lKXgjlDFydnyDYyb+bsYOTkkBEwklr0/ wdzFyMUhJLCUSWLh4fMsEM4ORokPrd8YYar+LP8NVTWXUeLSg2ksIAkRAVmJ77tfs4HYzAL2 Entvt4I1sAkYSXx7PxOsRljAWWLGgntgNq+AncSb7a9ZQWwWAVWJbzdPsIPYogIRErcedkDV CEqcnPkEyOYAmqkpsX6XPsR4eYntb+cwQ9zzmkVi/UFvEFtIQF3i5JL5TBMYBWch6Z6F0D0L SfcCRuZVjGK5mTnFuempBYamesWJeSmZxdl6yfm5mxghoZq5g/HuE+9DjAIcjEo8vB6Hn4cL sSaWFVfmHmKU4GBWEuH90fIiXIg3JbGyKrUoP76oNCe1+BCjNAeLkjiv270vYUIC6Yklqdmp qQWpRTBZJg5OqQZGqVvSGe2n9/Tet07bvfz+lnRxeVVrFxWr6jmyV8QdGx99iRa8ejbm3EGT gztXhChvXryF76UgW8XXpdypF11cmoNuG36zOmW1T2MDS8WfcPGzF3Qef3/p0BLNJrprd9Bh Jzn7ScYX7/xelfNj4pZV19jPWPolFEnazozKW1h4/v/mIK2expUPlFiKMxINtZiLihMB+HeC EVECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGJMWRmVeSWpSXmKPExsXCtZEjRTek70W4wc6z7Bb/9xxjs9h7S9uB yWNi8zt2j8+b5AKYorhsUlJzMstSi/TtErgyti5+ylJwR6ji5Gz5BsbN/F2MnBwSAiYSf5b/ Zu5i5OIQEpjNKHFt93ZGkISIgKzE992v2UBsZgF7iTPbp7KC2GwCRhLf3s9kAbGFBZwlZiy4 B2bzCthJvNn+GqyGRUBV4tvNE+wgtqhAhMSthx1QNYISJ2c+YYGYqS7xZ94lZghbXmL72znM Exh5ZiEpm4WkbBaSsgWMzKsYxXIzc4pz0zMLDI30ihPzUjKLs/WS83M3MYJDhjNqB+P1ieaH GJk4OKUaGGPfumn2VGxYv719vYdw9vf0GmmV1C+y/nm3G1+1fz4VVGtW9nDPfdkJ/jUW5/fY HjQxLVjPyzOntSUtmt+jw3fHk71rl4qxFZWsvyq+yKf8UnnU2k/3dxRPZc66phDDF/M3YNpR 1bS900QsL72tmfL6KCe3cm2Ja4T88b8BtpwmF46WBfnaKrEUZyQaajEXFScCAPoyA+nJAQAA X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(106466001)(305945005)(110136003)(92566002)(7846002)(2270400002)(4001350100001)(586003)(230700001)(65806001)(65956001)(81166006)(81156014)(47776003)(23676002)(11100500001)(50986999)(229853001)(5660300001)(33646002)(19580395003)(31686004)(8676002)(83506001)(356003)(87936001)(54356999)(626004)(65826007)(2906002)(50466002)(64126003)(31696002)(69596002)(36756003)(86362001)(6916009)(77096005)(68736007)(189998001)(19580405001)(4326007)(8936002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB2131; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:giBxf4yVx6jqxk0q+lcdMKzbXqr4jQKd8+XWeOeT360H0oNjtmDj6RaafcZ5cA0aoGx/8F8Ph1TzItM/1pxC3GgNxOwuDGaOcLiKC994yz5ruk+l18/0u4ALdKRLdJmm+8kd8Jo0xa9Watukc4VBAd3gz/a96cZm8CdpCmuCsPFBn5v2r4A16+N8APZIZ3RBny7Ff78kvkknIZlAvIHOor4GydX1z948AGOH5GtDNRCaDdJ5OMPs6L3ixDmonaOan2JQ4yqXRe6M0I0n0KwUAzLMb9PcIMGEDbncYiFpEgvgiReLZ8jNCQFST8V6qQcwUa7tFsri96qcp5+EGcJEqsCGf1i2jJMpg+ZDVvpRp+R6CWXlmuYudGydyLDBHb3FBVBQHXWk1phHzdUZugFN/w7aDLR92p+iqZWNNvIu6/7QoJR67cHuinpxURv4bpl345IEnrkpefkWeW57YphvczhHUl7AxyVMe0ZBdK2q7u911YQ0094aU4Q86snNaHIMXpYgw2KGqF2R5oNz+hntFQ== X-MS-Office365-Filtering-Correlation-Id: fe43e454-31b9-4f93-ffa3-08d3e5b8b365 X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2131; 2:hkmg8hXDvnUDmmQCMVz4g+9ZN+ojEbPmab1PKOEE1MzIbrpEf5cHlSOAtBhpLiNEcA4DKfJt/+82yoa9EzXShmHQR+JHES3g4tsOH3mtakZTRIp4oHdwTpClAHPa1oixdcuf5j5qAqFsqoczrmdpSM6xLwiXYr41Q1y+PYKv1UQ+f+sXBDkMFeWeCeVBo49d; 3:bD6Pzjr4VvircZJ0x/EdMe5NDVwuKvRhTJueSzKLcov6OAw6JyvUH701fxxoovmxqon/FR+026Cp31Uw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daL5/DjtI1awX4N6x7TR4RAMzK+XSEscHjLfLpimtfBTvmRrPGpiLTwhH553qTzpx4tKOTSlSr1S0qYm9+P5QMznLyb+QUBFtnniqlhoHyppQ1y8Mq8MtZOwgpA073Evo8B0XeVgu8JmAjr95ighL3q/XWO95M1aYDcF6jA9bWxcCjHR0VEnSFaNQJTO/eQCiN5ktNVFgTdptFqLL08DUPWl7K09bQRpgSE+XNP1xdgI8XzT2qkilPYrELvwSvBYkuXsP6LsCU+veR9Swf/TZyd4t0WIfgO21wXsjCUvJ8D5qnF8bJJRuezAgewqB03qVuk5flHbLAWSLs9Rs+dSadulkBkfofAQayENKTFwHKjJ+A16uOVBEq4v4PvCtPsdCUGVF0XWwQ2C4/FF511txvq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BL2PR02MB2131; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02MB2131; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2131; 4:+yqNPupFE/SE/XC+3WvJ5Pmyj79t8H0xs+/brS409auwCpDUny8qVKuUbbdWJ4pZjGPT/cSbEWh6NM1GUBAizVcbwgXe0Xfc08eN1DYMDvH0Thzj+crgXV81uytb4uPCmthEdRNjPKiKLzp6ZKAp4nXzUoi0VsSVrs12z3nf34Ysp8+F828vLuIqNWhTeZhPr1T2X45ffLagqbxJyWmczCJLlHL0W3V59bnwTwNtpgIs09MJagV+e8bs54/JAG+8T+XR4d/wi2vvs4Tc/p5w4+HdPAHOJI9Djykq1OZLS96BCzJG6OHp+qa4xTxmJ7jVeoyXqdekJF0QxZyAERmaanQ62okLfCwvnZe0d0OuxB+wHzD7eLz6POyX7vb9B7b+qfgZfDfF9ipk+e8dd82EKPKIuv+4kQHwwwAP9OktKbuovovS17ZGSmm/Bn6dW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ofEaa9mR61zhBs549kJGT4Dw1AII4x2FtdpnHGYgSXa6EslDyakwFrDnaz/F9nWQ7eXTy/vZgJzORN1C1azpEfeFLl6QKLW1UHzVldtGh2MvfOd7PaYdJE1X/5y56WTX6YOht8nx1tddfqkCbL3WSw6kZs9eiHS7/E8i5Av/8pWYUGWW+BSespAXyqD3Ff/R2 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 02:56:23.5765 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR02MB2131 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 This patch ensures that sparse does not complain about disk->part_tbl manipulations nor about part_tbl->part accesses. Signed-off-by: Bart Van Assche --- block/genhd.c | 7 ++++--- block/partition-generic.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index fcd6d4f..a54c8ce 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1072,7 +1072,7 @@ static const struct attribute_group *disk_attr_groups[] = { static void disk_replace_part_tbl(struct gendisk *disk, struct disk_part_tbl *new_ptbl) { - struct disk_part_tbl *old_ptbl = disk->part_tbl; + struct disk_part_tbl *old_ptbl = rcu_dereference(disk->part_tbl); rcu_assign_pointer(disk->part_tbl, new_ptbl); @@ -1098,7 +1098,7 @@ static void disk_replace_part_tbl(struct gendisk *disk, */ int disk_expand_part_tbl(struct gendisk *disk, int partno) { - struct disk_part_tbl *old_ptbl = disk->part_tbl; + struct disk_part_tbl *old_ptbl = rcu_dereference(disk->part_tbl); struct disk_part_tbl *new_ptbl; int len = old_ptbl ? old_ptbl->len : 0; int i, target; @@ -1303,7 +1303,8 @@ struct gendisk *alloc_disk_node(int minors, int node_id) kfree(disk); return NULL; } - disk->part_tbl->part[0] = &disk->part0; + rcu_assign_pointer(rcu_dereference(disk->part_tbl)->part[0], + &disk->part0); /* * set_capacity() and get_capacity() currently don't use diff --git a/block/partition-generic.c b/block/partition-generic.c index 71d9ed9..df38027 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -252,13 +252,13 @@ void __delete_partition(struct percpu_ref *ref) void delete_partition(struct gendisk *disk, int partno) { - struct disk_part_tbl *ptbl = disk->part_tbl; + struct disk_part_tbl *ptbl = rcu_dereference(disk->part_tbl); struct hd_struct *part; if (partno >= ptbl->len) return; - part = ptbl->part[partno]; + part = rcu_dereference(ptbl->part[partno]); if (!part) return; @@ -293,7 +293,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, err = disk_expand_part_tbl(disk, partno); if (err) return ERR_PTR(err); - ptbl = disk->part_tbl; + ptbl = rcu_dereference(disk->part_tbl); if (ptbl->part[partno]) return ERR_PTR(-EBUSY);