]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Don't change task->tk_status after the call to rpc_exit_task
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 10 May 2023 16:28:00 +0000 (12:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:03:17 +0000 (14:03 +0100)
commit599db54f58034b111c4d698eddc0d82d58aa18a7
tree019a9e5177176d9ea8dcaf40558a476abf572037
parent659c898becf4dd6bbe0e31defeeb7f646a4cd59c
SUNRPC: Don't change task->tk_status after the call to rpc_exit_task

commit d180891fba995bd54e25b089b1ec98d134873586 upstream.

Some calls to rpc_exit_task() may deliberately change the value of
task->tk_status, for instance because it gets checked by the RPC call's
rpc_release() callback. That makes it wrong to reset the value to
task->tk_rpc_status.
In particular this causes a bug where the rpc_call_done() callback tries
to fail over a set of pNFS/flexfiles writes to a different IP address,
but the reset of task->tk_status causes nfs_commit_release_pages() to
immediately mark the file as having a fatal error.

Fixes: 84e2e4200463 ("SUNRPC: Fix races with rpc_killall_tasks()")
Cc: stable@vger.kernel.org # 6.1.x
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/sched.c