Whamcloud - gitweb
e2fsck: copy context when using multi-thread fsck
authorLi Xi <lixi@ddn.com>
Mon, 5 Aug 2019 04:01:17 +0000 (12:01 +0800)
committerLi Dongyang <dongyangli@ddn.com>
Fri, 28 Apr 2023 00:35:53 +0000 (10:35 +1000)
commita3ed854087dc8fca46483223bbc043d1a3b71784
treefeded95c9e78c19fb9860ef56dd3176c0981f382
parent6b511e90192bbe269771ff8a60059b9b5214bac3
e2fsck: copy context when using multi-thread fsck

This patch only copy the context to a new one when -m is enabled.
It doesn't actually start any thread. When pass1 test finishes,
the new context is copied back to the original context.

Since the signal handler only changes the original context, so
add global_ctx in "struct e2fsck_struct" and use that to check
whether there is any signal of canceling.

This patch handles the long jump properly so that all the existing
tests can be passed even the context has been copied. Otherwise,
test f_expisize_ea_del would fail when aborting.

E2fsprogs-commit: 05a637a9e68d3f7e15323deeab00981d4b7df7e8

Change-Id: I4994e62bdf27c385b02e55de82a9dafcc6a12139
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
e2fsck/unix.c