Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp965277rwb; Fri, 23 Sep 2022 06:36:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4G/GmagC9iTO4U/obYHP6zNAvuzbBj2mKaPhJG58ze7jvoeB6FYzrmgjzBiyH4vPuzeYQZ X-Received: by 2002:a17:907:78b:b0:741:3d29:33d2 with SMTP id xd11-20020a170907078b00b007413d2933d2mr7392402ejb.103.1663940165477; Fri, 23 Sep 2022 06:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663940165; cv=none; d=google.com; s=arc-20160816; b=A+k35SNtqGrK587TCnnaQH8tdZ68wujrmWL+o5ST83wB1CTJ9Eg74MruZX+rOAdQc/ vbwjo4KUJJ+cbw+e0i2mGIDdRi8MMAg/lBbGBQ0KdKb55WQoHWVpsqzUKQX+LcLgyiJS HtKG+mpNpv1YoLUXLbfcflo6R7Ra2VJbmOIaWFSiLGUm4XIs7iP5/qx7WV+z9PHP0Az/ M0BVY/Eoy0OFnB2JbKVhITKx17laEocQAoyYSgrF7FGU7fWLVPLUInxRJyZH8HnrTBEV LvGPXwjMq7Ro0zwQIXMlmYhZ2wq7mwWePkd37rKDN+Y+Tx+KOfyXSHaJeQJW1g9iR6E/ 2/Aw== 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; bh=q7meu/hqTStnsFjKaDHV2BjHrnnbIm2vFOLwyk1LR1M=; b=G9afoUvvLuXINRSy5u7LNeYtsP84D4sXKL7EAXoiHUYM1TiNDVPGmLxXADxsrvnlyH +drAeoT/kMpHWlvb99EFp3wA0rCGNNLGUs8FASROhfyoOrZ0JulWge7Vj2ye5/6+TjOW heVH/F1zNruMp4PF1tyi+vBdaWEtsLsdTbEHW4cDScwzbmE/IEXzgOB22lJqoFhwdt4x SjN2L1HdVV1dEsu3w1+Aj8wbPHGF9i04DqNUEyopGCDMStEKA1MruvFaQQ6sL9XUa8UI q/oTYLPmuaP2NB7hAMS/nhPg4vqKNCPfY3rGw96/2CE1Ki45gmFtdq0WcRYQE/pIzYRS B+hQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd16-20020a170907629000b0073d92f673f8si9497590ejc.937.2022.09.23.06.35.40; Fri, 23 Sep 2022 06:36:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbiIWN2o (ORCPT + 99 others); Fri, 23 Sep 2022 09:28:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231148AbiIWN2e (ORCPT ); Fri, 23 Sep 2022 09:28:34 -0400 Received: from shell.v3.sk (mail.v3.sk [167.172.186.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4559613BCE3 for ; Fri, 23 Sep 2022 06:28:33 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 7D2F4E388A; Fri, 23 Sep 2022 13:14:59 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7c61O-K0wscc; Fri, 23 Sep 2022 13:14:59 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 30B2FE388C; Fri, 23 Sep 2022 13:14:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lG-8kUw-xDL2; Fri, 23 Sep 2022 13:14:59 +0000 (UTC) Received: from localhost (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id 06DD1E388A; Fri, 23 Sep 2022 13:14:59 +0000 (UTC) From: Lubomir Rintel To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org, Lubomir Rintel Subject: [PATCH] tune2fs: print error message when closing the fs fails Date: Fri, 23 Sep 2022 15:28:17 +0200 Message-Id: <20220923132817.1701711-1-lkundrak@v3.sk> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 I encountered an I/O error on writing the superblock on a drive: ... pwrite64(3, ..., 114688, 97844727808) =3D 114688 fsync(3) =3D -1 EIO (Input/output error) close(3) =3D 0 ... The error was silently ignored, only indicated by the exit value. Let's print an error message. The error message was taken from mke2fs in order to reuse the translations. Signed-off-by: Lubomir Rintel --- misc/tune2fs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 088f87e5..d8ba4415 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -3745,5 +3745,13 @@ closefs: =20 if (feature_64bit) convert_64bit(fs, feature_64bit); - return (ext2fs_close_free(&fs) ? 1 : rc); + + retval =3D ext2fs_close_free(&fs); + if (retval) { + com_err("tune2fs", retval, + _("while writing out and closing file system")); + rc =3D 1; + } + + return rc; } --=20 2.37.3