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)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 19 Sep 2022 21:40:05 +0000 (15:40 -0600)
commita6279f7a633ed2c6cc6dafa0fea8092a38664eef
tree4989b0fbf042ac8c152ab7c29d84522b5df0ac0b
parentdc43cc1cadd3dbcbaeb9b4e09cb8c99fae885b5a
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