Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp219233pxb; Wed, 11 Nov 2020 01:45:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj10Ml2qnO3rnYQcRNf88y9uHA5I3O7fiJbQi5/3Bley0MRd2NZjWy0v3IHMJXAxMO1zXT X-Received: by 2002:a17:906:2444:: with SMTP id a4mr25322180ejb.415.1605087906820; Wed, 11 Nov 2020 01:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605087906; cv=none; d=google.com; s=arc-20160816; b=Wib5MuxWgTY8t006aaEcM6H5xbQpm344WwTHGTOUmpQm4GjBO6HEb7BAYnby5y0/f5 NzgYTrMBBKV8q5/BPtUZBtE28RmzZa3Gsdtp6oawZgd6FfLVXiRqouYTDbAIXUbJ1GsF zxfL2NYSO7IwYqH4RWsoszZVoW98RzAQeZRUA9voQ+ZsXnqb2wA0Yj2ju4x0i1UiS3D4 Y5+wL0DXXncbGo2PRK5XYFrN9blzeXcogv4FKpf/EwT0MZ6HpulmIE/5Apb1oXtnVbyh PE+q90BHhKrgCfTHpDZ5bU/2WeHrxevzUgO1Anw5m2jOMPjHzzjJLVul97uU+tD0FULj D9IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HWsx9B0i+km7rETi/ATPtzslVhr3RwpBYH13dBR/3Ho=; b=r9sdC87eSzcTnQ7yg/ZPplH9YgLVDlo03fENyFNZTKWz8036kELGEz6EF97oY6zAHX RPVaG+6kXDIPRS3hsR4Ewov6DTG0mWrg1FJvm+b1aj3Xfv6FaK3t6Eg9RO9gxZLOzf52 R+HsVTduzBD6qdII8+Rd7MiZtJ5bOHry+J/YbUZRWLF+iDNP6kCbP6QKznjhZwLXLN8F k3bEOgLQGz+72ZhI6w2K/Mpp5WUaKiehQBWkH1U22MBahpsTchudJw9DTJZQYREkCuM/ I0GHjEpmwelFOgHXdN2bf/3N+boTI5xGV+ugbSxgwveJatgTJ/SjeI8HeJ7+mN8V/1UL Tf3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aKabU+d7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu5si656216ejb.544.2020.11.11.01.44.43; Wed, 11 Nov 2020 01:45:06 -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=@gmail.com header.s=20161025 header.b=aKabU+d7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726567AbgKKJmn (ORCPT + 99 others); Wed, 11 Nov 2020 04:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgKKJmm (ORCPT ); Wed, 11 Nov 2020 04:42:42 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CC9C0613D1 for ; Wed, 11 Nov 2020 01:42:42 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id t18so711921plo.0 for ; Wed, 11 Nov 2020 01:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HWsx9B0i+km7rETi/ATPtzslVhr3RwpBYH13dBR/3Ho=; b=aKabU+d70ye27wRjrFfr+zLkzU7wnCVr3xRHRKWIE7Oq9GDMjvy8utFfxpWMpQBPFs 3YfKsz8+rgkxal0IkYjsU9OGcszs+1HpGO90e0i5dny0FGSHqHz0rDENOBO8ri83guof AAWx+LuEEG4CvzX/MhgwPMNjaZTMBkIM1+Cii+f3+8mMCKSTQ9ezsWb/smYac4M1MafP gY+xV99NJcackueC0L6Lbkf5RumOpkFhaQTVCHq6kCMmepexWf72hRpaW+xOgdzRyPXQ sH5QOCosy2tgkj8ZeyXlbRigHC/NKh6eGKv0ecQwnZCjrOyb+ITneQakI9fL/7RYE0e+ cPPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HWsx9B0i+km7rETi/ATPtzslVhr3RwpBYH13dBR/3Ho=; b=N4ymu5eMw8CdXJIpkrQMuHuyfj+qpkn6zooqqueVfVRmmVQiGkYW8xjyi3Nk2TH8ON V7GePvD8klYd4J2FfAkUPwQksBmfW3l6MeyYUNPiHQFvVKerRW23HgIkfgA0jzTISJ02 kPkaz1+HrJT0TF+zrwlEMAga9BCvsIE2G20V09c7e5VCTaJwdwMpxltT3zHQj4GOzBJZ +9LaUGuO/cnltxFwCm/xgyGMZpSB0N45euNTOkdJsMzBm3VutatMd8LGNDflWGJAL8At SJ7BPhO2XT3YTdT04gf37y0Hx5LdzCTeWJX8x8FHHNTLPlTvUovbBVJoGCcbfNtVHXZW rUoQ== X-Gm-Message-State: AOAM533yPhz1GYP9Fuz2cFPryx4dHctKBCR8v/nMopRptO1OHTYs4MHe W84Ap8hiaDJ/DuIKuh9z+Zg= X-Received: by 2002:a17:90b:300a:: with SMTP id hg10mr3134852pjb.30.1605087762350; Wed, 11 Nov 2020 01:42:42 -0800 (PST) Received: from robinhsu-p520.ntc.corp.google.com ([2401:fa00:fc:202:1ea0:b8ff:fe77:fe45]) by smtp.gmail.com with ESMTPSA id o132sm1857300pfg.100.2020.11.11.01.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 01:42:41 -0800 (PST) From: Robin Hsu To: linux-f2fs-devel@lists.sourceforge.net, jaegeuk@kernel.org, chao@kernel.org Cc: linux-kernel@vger.kernel.org, Robin Hsu Subject: [PATCH] f2fs-tools: skipped to end on error syntax error Date: Wed, 11 Nov 2020 17:40:57 +0800 Message-Id: <20201111094057.565522-1-robinh3123@gmail.com> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Hsu 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