From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 593BDC4338F for ; Sat, 24 Jul 2021 07:14:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 368F660EAF for ; Sat, 24 Jul 2021 07:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234170AbhGXGdg (ORCPT ); Sat, 24 Jul 2021 02:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbhGXGdg (ORCPT ); Sat, 24 Jul 2021 02:33:36 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95CFC061575; Sat, 24 Jul 2021 00:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=IzbPl3rhQlkNu4LwWkqjxNIKlOD/VrKugpLHg7bjM8A=; b=eoEMdpdTs3bWusstwvIzLeI/Rd E2qoQwNPvcZ3QYNvQ7o/GaYGetkCjvFYv+Ux6V7MDmINK/zK6r//BJmtGhGWDwka2Ji6/vXl7QA0D MQvbP7frLdq4G3kNP/3K8ZpGBWdnvH/ZWgR+JGD/n3LAVv7P6VSyS3eL7k65gMNS3oyzq2sCbquZh KJDCpEKr5SFDr4qqMhaW3WXcZ2xrg8qPGUNt7mJGmxUgSjGHO8szI/keunn5dZ4/LlrCqTxc26V7l PBwYbpRpSSuCgnFj0VkNx6NVwWwyos2/5F/We2tnCrQVs0lmWML8Anf3UrCzXLv86jzgADlG87cpO iBaRCSfQ==; Received: from [2001:4bb8:184:87c5:85d0:a26b:ef67:d32c] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7Bqe-00C4X1-U1; Sat, 24 Jul 2021 07:13:29 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Josef Bacik , David Sterba , Naohiro Aota , linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, Chaitanya Kulkarni , Ming Lei Subject: [PATCH 02/10] block: assert the locking state in delete_partition Date: Sat, 24 Jul 2021 09:12:41 +0200 Message-Id: <20210724071249.1284585-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210724071249.1284585-1-hch@lst.de> References: <20210724071249.1284585-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add a lockdep assert instead of the outdated locking comment. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ming Lei --- block/partitions/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 4230d4f71879..9902b1635b7d 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -281,12 +281,10 @@ struct device_type part_type = { .uevent = part_uevent, }; -/* - * Must be called either with open_mutex held, before a disk can be opened or - * after all disk users are gone. - */ static void delete_partition(struct block_device *part) { + lockdep_assert_held(&part->bd_disk->open_mutex); + fsync_bdev(part); __invalidate_device(part, true); -- 2.30.2