Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1659144rwb; Mon, 7 Nov 2022 04:26:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Xe/687DTHHpW3CGwtkwtYjU/gEg9Zst4Ys7BKRzYjeyfrkhO7QKWAz2ULPteVHiy9oAKs X-Received: by 2002:a17:907:744:b0:741:36b9:d2cc with SMTP id xc4-20020a170907074400b0074136b9d2ccmr46135416ejb.613.1667823968109; Mon, 07 Nov 2022 04:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667823968; cv=none; d=google.com; s=arc-20160816; b=sryWmC965yD9SJOlNfYQOfQYRUzk28/v0kH1XOZpcFUafkSp9nOF7UrCl8/er7KGG+ zaf5lzzqV8JFOjksoXLfqtUVX1MMiNejTWu2W2tgRXXOE6X5ypBpKgvSHcoIZOBymjWX UOBl3P3A33UkYt/z/TJPS83ds90JoW+r31Vjdq5DQjKjDdAy5wduGzgT7L5TQhz/332d jY7GUnsliGarPAdCeZInUJH5Wu9WQD5K0FabpMWLeuFKUUrLJgqdlLocpldS3uZ8RaFs z38bR7rbehQgqHOPHxXDY1j899XKSCJhzToA1CasgJ9i7LoMA+bCptRbPEgQYu3U3/MK 4Qsg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=caV4R+OWTjHvOPUyveUfpCTXxcmng8ZhQguB5J9grQE=; b=0XI8LKV49PykFPX4UMBdPUkatXWH2NUY16ZP8QMEPQx6z1iAG5VTo3TRhV09KXS9vp ECBxljPRYW5Yj6swumlbaRfplmZirzbqRANboSjbj6mcMVZPrtEBjbHwvbUx22lXE5SX nmimthDXcrJ05uSLlDzxKMT59NN4ZXEBvRjwlAmQhKPSO6yMowudpMGibqjXtIbCsJ4J /sPHUIPJnlLnzR4+qM4iQ8nvO6sgVps/3raaDsgj8MBdGGMphRxgfaz5F2SuqRRp+Xa6 s5XEqZfWEOeQPA/IBKcZ6wlSZn451WhvmwAlEpOSKxl+zQoFwpdE9PUgetbfqGj43R5p BHBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OQoMrQ0i; 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 nd12-20020a170907628c00b0078a3ef9f092si9987900ejc.998.2022.11.07.04.25.44; Mon, 07 Nov 2022 04:26:08 -0800 (PST) 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=OQoMrQ0i; 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 S232124AbiKGMZQ (ORCPT + 99 others); Mon, 7 Nov 2022 07:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbiKGMZA (ORCPT ); Mon, 7 Nov 2022 07:25:00 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A1E1B1C1 for ; Mon, 7 Nov 2022 04:24:58 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id p21so10900701plr.7 for ; Mon, 07 Nov 2022 04:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=caV4R+OWTjHvOPUyveUfpCTXxcmng8ZhQguB5J9grQE=; b=OQoMrQ0i6opj6kTmNXcce/l92K59Fb4sRo0kSWE3wwxHHiTH19bWHOAzC3vVhpeczS AT6C2p/GQWcsA/D2XYVvEEABkevsnMN3gOp4yk3mnGJ6rgoLlZXtQYZGw0u7W2C47arn hqu+nWMC46vHVIso98QTAr2fTgF/bkLnPGZpwe2b/shii0JuKpBZ7bWrGe4cU0YugQOL CWUlXpB4YV8iF8XUSbFR5N6SgFz10/LJQ22SLKS8Maau8cMdaC3TxLMTdHpMaL7Tcax7 KVJhJRcA8kLzNQCLXq+opu2S2rWqGar72zywnOzXSNMpnrpJ/JojL3fmqEKQjvtlUtzS PWOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=caV4R+OWTjHvOPUyveUfpCTXxcmng8ZhQguB5J9grQE=; b=crbQySqcl4MnAQrIU9vaOAiXkY/HqdfMTcHiQnjLgudb5yck4GBgwt5dzGULmmdDag Bz5hcJhNPoEgf2BOdgFJ+qw8iFE7YZq2zFNQWxSStYK2u835pjkK7Ul+WBkpt/XfmOuy JXr/YyPjUEFMtc3OjOLZEvDQk/v9VxpaXFKsP8114hyRKSI0c3f6UkH1ikH6oXfVPrwD SQwLTDGDn6F6JJ1uaD3im3ZVbAATkn44FRONHdp3hbjtCRK7EOthy/O6IRlnqK9ItZ9r Ts0dT7GDN0OgdxNbfnFuZX8ztXhgCQ6Hvmt15q0R1jGVMTI2ngohHGNDK4LST951lmZg sdZQ== X-Gm-Message-State: ANoB5plRoJ1GORDxUCJYakekAjxUP7IJvIQie0t523TTFa+SOi0VWXxm 7rak/tL++MuM2c+9sEA4bEY= X-Received: by 2002:a17:903:247:b0:188:88be:4fb1 with SMTP id j7-20020a170903024700b0018888be4fb1mr220789plh.34.1667823898003; Mon, 07 Nov 2022 04:24:58 -0800 (PST) Received: from localhost ([2406:7400:63:f20b:312d:45b2:85c1:c486]) by smtp.gmail.com with ESMTPSA id o16-20020a170902d4d000b0018157b415dbsm4889228plg.63.2022.11.07.04.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 04:24:57 -0800 (PST) From: "Ritesh Harjani (IBM)" To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org, Harshad Shirwadkar , Wang Shilong , Andreas Dilger , Li Xi , "Ritesh Harjani (IBM)" Subject: [RFCv1 25/72] e2fsck: Add e2fsck_pass1_thread_join return value Date: Mon, 7 Nov 2022 17:51:13 +0530 Message-Id: <44270897e6bf20bdb883d3e3cab43a83806e696c.1667822611.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 This adds the return value to e2fsck_pass1_thread_join() to check for any error in pass1 threads join operation. Signed-off-by: Ritesh Harjani (IBM) --- e2fsck/pass1.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 596096d1..4b165600 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -2174,8 +2174,9 @@ static errcode_t e2fsck_pass1_thread_prepare(e2fsck_t global_ctx, e2fsck_t *thre return 0; } -static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx) +static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx) { + errcode_t retval = 0; int flags = global_ctx->flags; FILE *global_logf = global_ctx->logf; FILE *global_problem_logf = global_ctx->problem_logf; @@ -2195,6 +2196,14 @@ static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx) global_ctx->fs->priv_data = global_ctx; global_ctx->logf = global_logf; global_ctx->problem_logf = global_problem_logf; + return retval; +} + +static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx) +{ + errcode_t retval; + + retval = e2fsck_pass1_thread_join_one(global_ctx, thread_ctx); if (thread_ctx->logf) fclose(thread_ctx->logf); if (thread_ctx->problem_logf) { @@ -2202,7 +2211,7 @@ static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx) fclose(thread_ctx->problem_logf); } ext2fs_free_mem(&thread_ctx); - return 0; + return retval; } static int e2fsck_pass1_threads_join(struct e2fsck_thread_info *infos, @@ -2226,7 +2235,13 @@ static int e2fsck_pass1_threads_join(struct e2fsck_thread_info *infos, if (ret == 0) ret = rc; } - e2fsck_pass1_thread_join(global_ctx, infos[i].eti_thread_ctx); + rc = e2fsck_pass1_thread_join(global_ctx, infos[i].eti_thread_ctx); + if (rc) { + com_err(global_ctx->program_name, rc, + _("while joining pass1 thread\n")); + if (ret == 0) + ret = rc; + } } free(infos); -- 2.37.3