ptlrpc_set_wait can wait either with or without signals blocked.
After it has waited, it possibly checks if a signal is pending and if
so, marks the set as interrupted.
The code for the check examines lwi.lwi_allow_intr which was set
before the wait. Converting this to use upstream wait primitives
will remove lwi, so we need another way to handle this.
The current test looks wrong. It is
if (rc == -ETIMEDOUT &&
(!lwi.lwi_allow_intr || set->set_allow_intr) &&
signal_pending(current)) {
but if lwi.lwi_allow_intr is true, then the wait will have allowed
signals and so the set will already have been interrupted if needed.
So the case where lwi.lwi_allow_intr is true and set->set_allow_intr
is also true, should be irrelevant.
i.e. the condition should just be
if (rc == -ETIMEDOUT &&
!lwi.lwi_allow_intr &&
signal_pending(current)) {
which it was before
Commit
afcf3026c6ad ("LU-6684 lfsck: stop lfsck even
if some servers offline")
Given this, if we move the l_wait_event() into each branch of the
'if', we can then move the extra condition and
ptlrpc_interrupted_set() call into the 'else' branch - the only place
the condition would fire, and simplify the condition to
if (rc == -ETIMEDOUT &&
signal_pending(current)) {
This will make the two waits separate, so they can be easily
converted.
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I1e1819c697cea47607d5fc4a018c898236b33f4b
Reviewed-on: https://review.whamcloud.com/35981
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>