Re: [RFC PATCH v3 09/61] e2fsck: create logs for mult-threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 18, 2020 at 07:38:55AM -0800, Saranya Muruganandam wrote:
> From: Li Xi <lixi@xxxxxxx>
> 
> 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



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux