]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SUNRPC: Prevent looping due to rpc_signal_task() races
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 1 Feb 2025 20:00:02 +0000 (15:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2025 15:45:36 +0000 (16:45 +0100)
commitc688d2d8b0d89eb76212c6f0a3f67fa51ef2010d
tree1af308bbd411f6f83900004089ca7cd5fe4e3467
parent93200181c56ea04ce1b88c021d03aa33d20602b9
SUNRPC: Prevent looping due to rpc_signal_task() races

[ Upstream commit 5bbd6e863b15a85221e49b9bdb2d5d8f0bb91f3d ]

If rpc_signal_task() is called while a task is in an rpc_call_done()
callback function, and the latter calls rpc_restart_call(), the task can
end up looping due to the RPC_TASK_SIGNALLED flag being set without the
tk_rpc_status being set.
Removing the redundant mechanism for signalling the task fixes the
looping behaviour.

Reported-by: Li Lingfeng <lilingfeng3@huawei.com>
Fixes: 39494194f93b ("SUNRPC: Fix races with rpc_killall_tasks()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/sunrpc/sched.h
include/trace/events/sunrpc.h
net/sunrpc/sched.c