fs/nfs: Use fatal_signal_pending instead of signal_pending

commit bb00238890 upstream.

We set the state of the current process to TASK_KILLABLE via
prepare_to_wait(). Should we use fatal_signal_pending() to detect
the signal here?

Fixes: b4868b44c5 ("NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE")
Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
zhouchuangao
2021-05-09 19:34:37 -07:00
committed by Greg Kroah-Hartman
parent fe201316ac
commit f76e765556

View File

@ -1647,7 +1647,7 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
rcu_read_unlock(); rcu_read_unlock();
trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0); trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);
if (!signal_pending(current)) { if (!fatal_signal_pending(current)) {
if (schedule_timeout(5*HZ) == 0) if (schedule_timeout(5*HZ) == 0)
status = -EAGAIN; status = -EAGAIN;
else else
@ -3416,7 +3416,7 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
write_sequnlock(&state->seqlock); write_sequnlock(&state->seqlock);
trace_nfs4_close_stateid_update_wait(state->inode, dst, 0); trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);
if (signal_pending(current)) if (fatal_signal_pending(current))
status = -EINTR; status = -EINTR;
else else
if (schedule_timeout(5*HZ) != 0) if (schedule_timeout(5*HZ) != 0)