Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3817377pxb; Tue, 10 Nov 2020 00:14:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAnymzZJzItW/XIDFFu2rP5tXHXRkUQb0uj7lz7oRm1jiVDXUskSIFdiRLe2gClx1fXc2D X-Received: by 2002:a17:906:a43:: with SMTP id x3mr19268814ejf.197.1604996047569; Tue, 10 Nov 2020 00:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604996047; cv=none; d=google.com; s=arc-20160816; b=OXzCFOadO3iOhjNbdIkL3AFdeZFAiJaIh0O8CX1DxSQuyUVWFTOcmuorZlApcfTXQf DfF0ctp+sq27OcQxBJYlQBzBrNj9+gnEQRSuneH+ADwl+/ZsjMlnO8sWAW9i63EVRW/9 ODO2z4xydyUT2MqI14O5a03BcwlRlYqwQ5LKlmMArwjpLQM7NK+G7dDB5sEON4bW0DCc vV+RsuYoBekcSzCGZzsycZXoZjxGtxz69yXfsacJrgSO2owFigvSZkcN5D1e99DlJW7G bhjKk/GB7eIZ/aOTUDlsk8ZegvqlQCalbybxA9wNEk1DXwHZyr0Ftx1sjDt+yWlvfcBq ygNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=YleeopDaCgXcJmdy4XOEQs2LFG2krgZZ0q7A6+K5Zb4=; b=zo88pjPTYiQhlBFc2kdcALRU1QjuDcyHPzi2VNNVvhBH5Viybg1dT4gz/7DgBy/iRQ +VeOVrl3LiH8bkTzaK/elb5Ohd/leMgLV8+9/xFCMyaacEoSxBTrfrTxdyZ5/yyDVARe MA9jk0co/V8p5pF77hwgzf1w/KoAItuiQ1jPRMlHElAp9pcwlpdmlb12b6xXRTeQNjZg 3UT0UwWxzlKs+hKyo03M5bEhOcsM/Swgv52+uK2VKLF2R2ppFDbtIQSyinjSSZszmr1r PuG5TVO3H0yu9w3pff2rz4g6KV3T3jAje3krLeY9J2IxU5eJxwpjtAwVGl+zVWH6AkUX AWZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r9GxOzmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si8098186ejh.230.2020.11.10.00.13.44; Tue, 10 Nov 2020 00:14:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r9GxOzmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730302AbgKJILi (ORCPT + 99 others); Tue, 10 Nov 2020 03:11:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgKJILh (ORCPT ); Tue, 10 Nov 2020 03:11:37 -0500 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8674FC0613D1 for ; Tue, 10 Nov 2020 00:11:37 -0800 (PST) Received: by mail-qk1-x74a.google.com with SMTP id x2so8060633qkd.23 for ; Tue, 10 Nov 2020 00:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=YleeopDaCgXcJmdy4XOEQs2LFG2krgZZ0q7A6+K5Zb4=; b=r9GxOzmAmzQQaWAt/+yFLYbYHyhxxLRGGimYAU20+AVeE8DakDhPbv6BD81yZlmwAV aWijN3T/Oe/5LaZMduyilZWCPgqw79cloIqB9l6RW8L8LBUJuXNTmxsK3XVghP1etkon MDPuXpq42XCNDizGM9rPg7t1Veo16QDQqlPNdM8idYbG171Av02C5zgl052gC8pBtsTp CJayAsLpURbvTMotciq/6Onx7fzYk/SbweHDPIdB+lnEg/4wb1JAEY3N+WXib33+DUDE xvKGw6DknZT+3MsBgWD/aQ++X9ogR8lL1V7NGbPxqgEAzb7KY0GZYqrNq3/2R4Nyfd7W cRFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=YleeopDaCgXcJmdy4XOEQs2LFG2krgZZ0q7A6+K5Zb4=; b=jujHH+DsujzdhJrn7RqzaKwBcqj2xwgzd8WZRdf5m6WprHMtybefMRtx0HQdnTjuJG wLLDc0kNKbT1HdZAtniRh0A8E+xby7PQVHa1632IcihxKEhh5+Iode8qBJT1nmhh2pus P2VSq5Oi423yDk+KHo7RpoYjnoD+LFbIdK5G8MM7tVjCW9Wyt6bpD3I4fpCphCqzqGzM IuyC2k1cjNLVdOcjNIt4r8o2vI/w8W1JegmHJBVKZzUtbpjA7F1JcgZBDUIbhzZjgAQX rtQIqIEz8ciIxUbwbSdjhEHWwpxcn4hJO2NtMnhYlbu794slpbLSgxzJyFH5yOgoKTPb pw9Q== X-Gm-Message-State: AOAM533xrwlwqYE8z+fTL2Cu/VqOh/Tw+9mYCAL1q69T6f5LvYp7FGqI K+L4KFmptPrQwywYDJeUzOk/9odW4ORf7A== Sender: "robinhsu via sendgmr" X-Received: from robinhsu-p520.ntc.corp.google.com ([2401:fa00:fc:202:1ea0:b8ff:fe77:fe45]) (user=robinhsu job=sendgmr) by 2002:a0c:e0c9:: with SMTP id x9mr18369611qvk.56.1604995896460; Tue, 10 Nov 2020 00:11:36 -0800 (PST) Date: Tue, 10 Nov 2020 16:10:39 +0800 Message-Id: <20201110081038.261786-1-robinhsu@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH] f2fs-tools: skipped to end on error syntax error From: Robin Hsu To: linux-f2fs-devel@lists.sourceforge.net, jaegeuk@kernel.org, chao@kernel.org Cc: linux-kernel@vger.kernel.org, Robin Hsu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When error were found, we won't need to do any initialization but just quit. Signed-off-by: Robin Hsu --- fsck/main.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index 32559f1..e70048b 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -597,20 +597,22 @@ void f2fs_parse_options(int argc, char *argv[]) } } - add_default_options(); + if (err == NOERROR) { + add_default_options(); - if (optind >= argc) { - MSG(0, "\tError: Device not specified\n"); - error_out(prog); - } + if (optind >= argc) { + MSG(0, "\tError: Device not specified\n"); + error_out(prog); + } - c.devices[0].path = strdup(argv[optind]); - if (argc > (optind + 1)) { - c.dbg_lv = 0; - err = EUNKNOWN_ARG; + c.devices[0].path = strdup(argv[optind]); + if (argc > (optind + 1)) { + c.dbg_lv = 0; + err = EUNKNOWN_ARG; + } + if (err == NOERROR) + return; } - if (err == NOERROR) - return; /* print out error */ switch (err) { -- 2.29.2.222.g5d2a92d10f8-goog