From patchwork Tue Oct 17 09:13:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10011403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A02860211 for ; Tue, 17 Oct 2017 09:13:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FE4A28815 for ; Tue, 17 Oct 2017 09:13:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44EDD28818; Tue, 17 Oct 2017 09:13:50 +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=-6.9 required=2.0 tests=BAYES_00,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 CF71428815 for ; Tue, 17 Oct 2017 09:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934682AbdJQJNn (ORCPT ); Tue, 17 Oct 2017 05:13:43 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:48202 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934677AbdJQJNf (ORCPT ); Tue, 17 Oct 2017 05:13:35 -0400 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Tue, 17 Oct 2017 03:13:23 -0600 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH v2 6/6] btrfs-progs: rescue: Fix zero-log mounted branch Date: Tue, 17 Oct 2017 17:13:12 +0800 Message-Id: <20171017091312.31045-7-wqu@suse.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171017091312.31045-1-wqu@suse.com> References: <20171017091312.31045-1-wqu@suse.com> 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 Seems to be a typo that, in (ret > 0) branch of check_mounted(), zero-log set the return value but doesn't return. Fix it by adding back the missing return. Signed-off-by: Qu Wenruo --- cmds-rescue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-rescue.c b/cmds-rescue.c index 5b51952cdc10..c40088ad374e 100644 --- a/cmds-rescue.c +++ b/cmds-rescue.c @@ -178,6 +178,7 @@ static int cmd_rescue_zero_log(int argc, char **argv) } else if (ret) { error("%s is currently mounted", devname); ret = -EBUSY; + goto out; } root = open_ctree(devname, 0, OPEN_CTREE_WRITES | OPEN_CTREE_PARTIAL);