Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4112751rwb; Tue, 6 Sep 2022 02:44:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR74RoYF3thnMtMAzti/2QKpo3s75ZUdYoD6xu2TxlvSyJLzzRffx6zcwH5gLwhEESpRUnLT X-Received: by 2002:a17:907:7638:b0:76f:cad4:f176 with SMTP id jy24-20020a170907763800b0076fcad4f176mr249593ejc.647.1662457488782; Tue, 06 Sep 2022 02:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662457488; cv=none; d=google.com; s=arc-20160816; b=BgkW/k+kwvUMjWkjWeDz/1HKFRVHxnARviaZpX2DTTHZJH6sNV6+wC1Ofrv0dlZZGp Lm97Mu4U4SDJ559Cw26br3k+46EddCxFZdQKQWire57VYE+KNxop99tZ4GqnGjiVLUOv VFr53WF6d9LxOsj1YxKpa4s7Qs8+sDzwq3OXE9u4s2M5eatTX5p4q3gnH97YvuyUD+MB 3LaYCtAfv/3gLqWJTJE9nBCaX5OjAHkRa1pZ0FbiL0jJweRKHlNP7BhryXrpC/Jdvhb0 oVD6GjjrGZMZs5iziMeF/SnfKKxhoUqipsCMISNwdSDl7t3AonaBXkBrNNH0gcfyQnf1 JpJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=AOQWwaPlBKah4iqv+wxoHpRLfp1WYybJL1kCW9M6JuY=; b=f0OiHsvx4rc/3RjgKmS0yFuV42HTZtB62JZ2x1UXYZ9Yo0IZEAxlrA7l1HjYvkuBtz bzaN3CxEttvMxsEAVzd6BQ2sz9n36d5ywZaudWWM5iPIMpyf4FpksXKHR5AsCxISm1nD XdkGFV24ZD50e5SV4pbOuIxw4XyB6+DBmA8szFydZP9ENe2w3Mp9DTiyt9/FZZwqUTy3 0Xm1w/U+S2pyCVEqEWHTl0ZqfbStxoEjuY/F0whGe1hKSrNHgiYtk3ZmIdBErUIufwFR /g9gPqvcHYuJpiv6ZI2EmnybMHI3YdCny9ZLrOGHYRxkAlPX3mzMmK3q+WX4xhC2UiLK HHFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Uuuzw3hp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr3-20020a170907720300b0076f591c4692si588445ejc.330.2022.09.06.02.44.22; Tue, 06 Sep 2022 02:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Uuuzw3hp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S234047AbiIFJlf (ORCPT + 99 others); Tue, 6 Sep 2022 05:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232179AbiIFJld (ORCPT ); Tue, 6 Sep 2022 05:41:33 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846337548A for ; Tue, 6 Sep 2022 02:41:31 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id w8so16423466lft.12 for ; Tue, 06 Sep 2022 02:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=AOQWwaPlBKah4iqv+wxoHpRLfp1WYybJL1kCW9M6JuY=; b=Uuuzw3hpZQyFzLwd5Be4OsaeSyPRGEMLz/mnietoyl9+yMZe59YY4KZq15kbpod8Ur pcYK6o225UwlXeKkYaQxDPxENmgOVDOqoIEyRbrC0+W+JLFw7LeLHX0eigZzQkmBTPAu K9GmpbVV6RVuZAHhp8TQ2xM8wjE6HhkjqP6C4zikUMDdzUHZUFi4s2iUiYM5ZBybDHnh BkQyZVZh9NaPKxFrRj1dop/VQ8vFaMdM6iwEVdECZvNzPpNzwfGu1GiPG5y6yLpMJhbX ikdPscIdCMfZ1efQyeNXydmqx4cEqMkxFlHXiQ30zJelYwuveI5e9pKRdTXIzL4f1FOc 5ILQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=AOQWwaPlBKah4iqv+wxoHpRLfp1WYybJL1kCW9M6JuY=; b=fI5oWxEENcycEilsyfyQ22qlQyhIPEa58XU7lqoplVgZYZl0r46A57fr0Y646FC+9u lutUbLmVHkRBoVQhvf2yt7apXAIYlLIo6hFdRlP1LjWUYc6qEt8ScPQNTl3Delrslp8i ev2/YPSvCEhGkcTUo9Wc9E1l6U2FrcnJVTt/+anOzniwOq20F4W6bMchduCX48KxcddN 0pEj6iZ8yO8uxkkAVPhuqD1TG7zJLrVC9nig7iGiGypeODWFdbB+CSLXPt1r27HayY2x ZowYqRyC6BWFvTgZF7dzyXXCSFr3V+iolGWzd9zoFS7vAx9lOpz5iF4uZePK0bI7DQkr yS6Q== X-Gm-Message-State: ACgBeo3fpH1OTThunCGeuogWdqjiZtXVrE61OkhQVGoRyH7og2WEnQwk tI2bZUcnpoxveHOS1H1+7x99jdOGOsGZIjlB X-Received: by 2002:a05:6512:13a4:b0:477:a28a:2280 with SMTP id p36-20020a05651213a400b00477a28a2280mr16450950lfa.689.1662457289644; Tue, 06 Sep 2022 02:41:29 -0700 (PDT) Received: from smtpclient.apple ([83.234.50.195]) by smtp.gmail.com with ESMTPSA id g11-20020a2eb5cb000000b002637c04b472sm1776743ljn.83.2022.09.06.02.41.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Sep 2022 02:41:28 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH] tune2fs: tune2fs_main() should return rc when some error, occurs From: Artem Blagodarenko In-Reply-To: <7a6e1a43-d041-c3cf-a3dd-a9761d8dd4d6@huawei.com> Date: Tue, 6 Sep 2022 12:41:26 +0300 Cc: "Theodore Y. Ts'o" , Ext4 Developers List , linfeilong , wuguanghao Content-Transfer-Encoding: quoted-printable Message-Id: References: <7a6e1a43-d041-c3cf-a3dd-a9761d8dd4d6@huawei.com> To: Zhiqiang Liu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Reviewed-by: Artem Blagodarenko > On 5 Sep 2022, at 18:40, Zhiqiang Liu = wrote: >=20 >=20 > If some error occurs, tune2fs_main() will go to closefs tag for > releasing resource, and it should return correct value (rc) instead > of 0 when ext2fs_close_free(&fs) successes. >=20 > Signed-off-by: Zhiqiang Liu > --- > misc/tune2fs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/misc/tune2fs.c b/misc/tune2fs.c > index 25ade2fa..088f87e5 100644 > --- a/misc/tune2fs.c > +++ b/misc/tune2fs.c > @@ -3481,6 +3481,7 @@ _("Warning: The journal is dirty. You may wish = to replay the journal like:\n\n" > fputs(_("Error in using clear_mmp. " > "It must be used with -f\n"), > stderr); > + rc =3D 1; > goto closefs; > } > } > @@ -3744,5 +3745,5 @@ closefs: >=20 > if (feature_64bit) > convert_64bit(fs, feature_64bit); > - return (ext2fs_close_free(&fs) ? 1 : 0); > + return (ext2fs_close_free(&fs) ? 1 : rc); > } > --=20 > 2.33.0 >=20 >=20