From patchwork Wed Aug 14 01:03:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 11093015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDBB41510 for ; Wed, 14 Aug 2019 01:04:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5E462873E for ; Wed, 14 Aug 2019 01:04:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA1EC28741; Wed, 14 Aug 2019 01:04:17 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 73FFF2873E for ; Wed, 14 Aug 2019 01:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726807AbfHNBEQ (ORCPT ); Tue, 13 Aug 2019 21:04:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:41236 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726533AbfHNBEP (ORCPT ); Tue, 13 Aug 2019 21:04:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 86997B0E5 for ; Wed, 14 Aug 2019 01:04:14 +0000 (UTC) Received: from starscream.home.jeffm.io (starscream-1.home.jeffm.io [IPv6:2001:559:c0d4::1fe]) by mail.home.jeffm.io (Postfix) with ESMTPS id 0C3CF83DC468; Tue, 13 Aug 2019 22:05:08 -0400 (EDT) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id 8C91A6093C7; Tue, 13 Aug 2019 21:04:11 -0400 (EDT) From: Jeff Mahoney To: linux-btrfs@vger.kernel.org Cc: Jeff Mahoney Subject: [PATCH 1/5] btrfs-progs: mkfs: treat btrfs_add_to_fsid as fatal error Date: Tue, 13 Aug 2019 21:03:58 -0400 Message-Id: <20190814010402.22546-1-jeffm@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When btrfs_add_to_fsid fails in mkfs we try to close the ctree. That complains that we already have a transaction open. We should be taking the error path and exit cleanly without writing. Signed-off-by: Jeff Mahoney Reviewed-by: Qu Wenruo --- mkfs/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs/main.c b/mkfs/main.c index 971cb395..b752da13 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1268,7 +1268,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv) sectorsize, sectorsize, sectorsize); if (ret) { error("unable to add %s to filesystem: %d", file, ret); - goto out; + goto error; } if (verbose >= 2) { struct btrfs_device *device;