Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1223125pxu; Mon, 23 Nov 2020 15:08:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvcV1eH47GdEwO/wew8SPnewqvR7PKZaeEKOzZpGN8VIkS393Ho+Ko+NXVjxWACOWu8FKw X-Received: by 2002:a17:906:5587:: with SMTP id y7mr1752446ejp.138.1606172932113; Mon, 23 Nov 2020 15:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606172932; cv=none; d=google.com; s=arc-20160816; b=pdJuZ5JjBGZxGCOCO4zpnIjNwhMbXnw9tR2vXEv6ybRK4kd40nDdoCJAHVHrXyi2V3 eLzz7F9i9HkrC2/QwPXiVv+DbM00UtC2Pu4ndUdfKnZw7eftbWNG5CceKk4aeHxci375 3sKVvGNMCrbsnHA5yoHbPEX4ojcPnYZCFsiwGUu2mc2eqpGzp/CHojFZ3iaq22EbcOEr XW5NipatdgVcbw7nwVF3iIi61WAAEf313TKiryx8+9QfDf1BQY+PyYqTChJZE4NGLcF2 jda49fb7lJKKf3ghR0P743diPDFYzNoHRwLr1VQ/H1q6oG9sQ5G879HSRzAbk+l4PNba YcLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=MHGSQQWPBdwrvCM7i5R0g1puyaGoTj4vaZfLIsS+Zq8=; b=arGegzWQsBayDtcZMWRfKqp+Ked42u3GZ8rA+yjg6Vr8Euaoc92Pn9LDh3rS1RcgRz LrbkqOJu0Q6HI+hJvpW7CFqGE8UjzDwyvaW4lzz3ToVjKS1weVhZqDAgPiUGh8aL02xj f2PiBXuViOy9Y9b+L64OlkjflDBz81eJFiBTWKcj3SeFCgVGwaXBEypRAB5VUtFtmfqD vNE8X0+0yFc4//Pu+P7YG0Vk1swb2w6oNgIjUGbTk0QjvYKAP9gmdub6iVWhcO79UQlq kndYEMUFntr60LvRW4Yh59ruDV3VWlhTYk0dCG5R/qxZw6xejexj+HDgh4d4ztF1aTbb lC1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si9331304edv.240.2020.11.23.15.08.20; Mon, 23 Nov 2020 15:08:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731246AbgKWXFX (ORCPT + 99 others); Mon, 23 Nov 2020 18:05:23 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:41709 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728226AbgKWXFV (ORCPT ); Mon, 23 Nov 2020 18:05:21 -0500 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0ANN5BIH011354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Nov 2020 18:05:11 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 00B10420136; Mon, 23 Nov 2020 18:05:10 -0500 (EST) Date: Mon, 23 Nov 2020 18:05:10 -0500 From: "Theodore Y. Ts'o" To: Saranya Muruganandam Cc: linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, Li Xi , Wang Shilong Subject: Re: [RFC PATCH v3 09/61] e2fsck: create logs for mult-threads Message-ID: <20201123230510.GI132317@mit.edu> References: <20201118153947.3394530-1-saranyamohan@google.com> <20201118153947.3394530-10-saranyamohan@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118153947.3394530-10-saranyamohan@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 18, 2020 at 07:38:55AM -0800, Saranya Muruganandam wrote: > From: Li Xi > > When multi-threads are used, different logs should be created > for different threads. Each thread has log files with suffix > of ".$THREAD_INDEX". > > And this patch adds f_multithread_logfile test case. I'm not convinced this is the best approach; why not add a (thread-aware) log abstraction? That way there can be a single logfile, which is going to be much more user/admin/SRE-friendly. We also need to add some kind of mutex if we are multi-threading in e2fsck/message.c, since POSIX guarantees that the dio functions are thread-safe --- but only on a per function basis. So if we don't want the output to the terminal to potentially be scrambled, we need to take a mutex in print_e2fsck_message() if we are in multi-threading mode, so that only one thread is printing to the terminal at a time. (And certainly if we are going to be asking a question of the user, we *definitely* need to be taking some kind of mutex first!) - Ted