From patchwork Wed Oct 9 11:30:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11181023 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 E3CAB912 for ; Wed, 9 Oct 2019 11:30:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C38C521721 for ; Wed, 9 Oct 2019 11:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727657AbfJILaX (ORCPT ); Wed, 9 Oct 2019 07:30:23 -0400 Received: from icp-osb-irony-out3.external.iinet.net.au ([203.59.1.153]:33301 "EHLO icp-osb-irony-out3.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfJILaX (ORCPT ); Wed, 9 Oct 2019 07:30:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BYAQBjw51d/0e30XYNWRwBAQEBAQcBAREBBAQBAYF7iF2PKAEBAQMGgRGKHYUfjA8JAQEBAQEBAQEBNwEBhDsDAgKCcTgTAgwBAQEEAQEBAQEFAwGFWIYaAgEDIwRSEBgNAiYCAkcQBoUsr3J1fzMaiiyBDCiBZYpBeIEHgUSDHYQNg0WCWASPNDeGPEOWWYIslTQMjhUDixwtqUeBek0uCoMoT5BGjyeCVAEB X-IPAS-Result: A2BYAQBjw51d/0e30XYNWRwBAQEBAQcBAREBBAQBAYF7iF2PKAEBAQMGgRGKHYUfjA8JAQEBAQEBAQEBNwEBhDsDAgKCcTgTAgwBAQEEAQEBAQEFAwGFWIYaAgEDIwRSEBgNAiYCAkcQBoUsr3J1fzMaiiyBDCiBZYpBeIEHgUSDHYQNg0WCWASPNDeGPEOWWYIslTQMjhUDixwtqUeBek0uCoMoT5BGjyeCVAEB X-IronPort-AV: E=Sophos;i="5.67,273,1566835200"; d="scan'208";a="216228978" Received: from unknown (HELO [192.168.1.222]) ([118.209.183.71]) by icp-osb-irony-out3.iinet.net.au with ESMTP; 09 Oct 2019 19:30:21 +0800 Subject: [PATCH v5 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: Wed, 09 Oct 2019 19:30:21 +0800 Message-ID: <157062062120.32346.6331183312304681728.stgit@fedora-28> In-Reply-To: <157062043952.32346.977737248061083292.stgit@fedora-28> References: <157062043952.32346.977737248061083292.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. */