From patchwork Thu Oct 3 10:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11172445 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E3BD14DB for ; Thu, 3 Oct 2019 10:25:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C3FA21A4C for ; Thu, 3 Oct 2019 10:25:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbfJCKZb (ORCPT ); Thu, 3 Oct 2019 06:25:31 -0400 Received: from icp-osb-irony-out7.external.iinet.net.au ([203.59.1.107]:42874 "EHLO icp-osb-irony-out7.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfJCKZb (ORCPT ); Thu, 3 Oct 2019 06:25:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CrAQDHy5Vd/7q70HYNWRwBAQEEAQEMBAEBgWeIXI8qAwaBEYoakSwJAQEBAQEBAQEBNwEBhDsDAgKCaDgTAgwBAQEEAQEBAQEFAwGFWIYaAgEDIwRSEBgNAiYCAkcQBoUsrgx1fzMaiieBDCiBZYpBeIEHgUSDHYQNg0SCWASPMDeGOUOWVIItlTMMjhMDixwtqT6Bek0uCoMoT5BGjy6CVAEB X-IPAS-Result: A2CrAQDHy5Vd/7q70HYNWRwBAQEEAQEMBAEBgWeIXI8qAwaBEYoakSwJAQEBAQEBAQEBNwEBhDsDAgKCaDgTAgwBAQEEAQEBAQEFAwGFWIYaAgEDIwRSEBgNAiYCAkcQBoUsrgx1fzMaiieBDCiBZYpBeIEHgUSDHYQNg0SCWASPMDeGOUOWVIItlTMMjhMDixwtqT6Bek0uCoMoT5BGjy6CVAEB X-IronPort-AV: E=Sophos;i="5.67,251,1566835200"; d="scan'208";a="207652666" Received: from unknown (HELO [192.168.1.222]) ([118.208.187.186]) by icp-osb-irony-out7.iinet.net.au with ESMTP; 03 Oct 2019 18:25:30 +0800 Subject: [PATCH v4 02/17] vfs: add missing blkdev_put() in get_tree_bdev() From: Ian Kent To: linux-xfs Cc: Brian Foster , Eric Sandeen , David Howells , Dave Chinner , Al Viro Date: Thu, 03 Oct 2019 18:25:28 +0800 Message-ID: <157009832879.13858.5261547183927327078.stgit@fedora-28> In-Reply-To: <157009817203.13858.7783767645177567968.stgit@fedora-28> References: <157009817203.13858.7783767645177567968.stgit@fedora-28> User-Agent: StGit/unknown-version MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org There appear to be a couple of missing blkdev_put() in get_tree_bdev(). --- fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index a7f62c964e58..fd816014bd7d 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1268,6 +1268,7 @@ int get_tree_bdev(struct fs_context *fc, mutex_lock(&bdev->bd_fsfreeze_mutex); if (bdev->bd_fsfreeze_count > 0) { mutex_unlock(&bdev->bd_fsfreeze_mutex); + blkdev_put(bdev, mode); warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev); return -EBUSY; } @@ -1276,8 +1277,10 @@ int get_tree_bdev(struct fs_context *fc, fc->sget_key = bdev; s = sget_fc(fc, test_bdev_super_fc, set_bdev_super_fc); mutex_unlock(&bdev->bd_fsfreeze_mutex); - if (IS_ERR(s)) + if (IS_ERR(s)) { + blkdev_put(bdev, mode); return PTR_ERR(s); + } if (s->s_root) { /* Don't summarily change the RO/RW state. */