From patchwork Wed Oct 16 00:40:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11192137 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 99EF81390 for ; Wed, 16 Oct 2019 00:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7642C2084B for ; Wed, 16 Oct 2019 00:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729522AbfJPAlW (ORCPT ); Tue, 15 Oct 2019 20:41:22 -0400 Received: from icp-osb-irony-out1.external.iinet.net.au ([203.59.1.210]:40358 "EHLO icp-osb-irony-out1.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbfJPAlV (ORCPT ); Tue, 15 Oct 2019 20:41:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A3AADRZqZd/0e30XYNWRwBAQEBAQcBAREBBAQBAYFpBQEBCwGIYI8zAQEBAQEBBoERih2FIAGKE4F7CQEBAQEBAQEBATcBAYQ7AwICgxI2Bw4CDAEBAQQBAQEBAQUDAYVYhhoCAQMjBFIQGA0CJgICRxAGhgiuB3V/MxqKKYEMKAGBZIpBeIEHgUSDHYQNg0WCXgSPNjeGPkOWXYIslTYMjhYDix0tqUANgX1NLgqDKE+QRo9kglQBAQ X-IPAS-Result: A2A3AADRZqZd/0e30XYNWRwBAQEBAQcBAREBBAQBAYFpBQEBCwGIYI8zAQEBAQEBBoERih2FIAGKE4F7CQEBAQEBAQEBATcBAYQ7AwICgxI2Bw4CDAEBAQQBAQEBAQUDAYVYhhoCAQMjBFIQGA0CJgICRxAGhgiuB3V/MxqKKYEMKAGBZIpBeIEHgUSDHYQNg0WCXgSPNjeGPkOWXYIslTYMjhYDix0tqUANgX1NLgqDKE+QRo9kglQBAQ X-IronPort-AV: E=Sophos;i="5.67,301,1566835200"; d="scan'208";a="247444090" Received: from unknown (HELO [192.168.1.222]) ([118.209.183.71]) by icp-osb-irony-out1.iinet.net.au with ESMTP; 16 Oct 2019 08:40:47 +0800 Subject: [PATCH v6 01/12] 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, 16 Oct 2019 08:40:47 +0800 Message-ID: <157118644757.9678.8135598206478346052.stgit@fedora-28> In-Reply-To: <157118625324.9678.16275725173770634823.stgit@fedora-28> References: <157118625324.9678.16275725173770634823.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(). This change has been sent to Linus and has been included in the current rc kernel but is not present in the xfs-linux tree. --- fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index f627b7c53d2b..cfadab2cbf35 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1300,6 +1300,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; } @@ -1308,8 +1309,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. */