提交 7cbdfd4c 编写于 作者: N NeilBrown 提交者: Yongqiang Liu

SUNRPC: use _bh spinlocking on ->transport_lock

stable inclusion
from stable-v4.19.258
commit bcab4d551a3d15bdf8efaac7b61420219bd154b6
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5UQH4
CVE: NA

--------------------------------

Prior to Linux 5.3, ->transport_lock in sunrpc required the _bh style
spinlocks (when not called from a bottom-half handler).

When upstream 3848e96e was backported to
stable kernels, the spin_lock/unlock calls should have been changed to
the _bh version, but this wasn't noted in the patch and didn't happen.

So convert these lock/unlock calls to the _bh versions.

This patch is required for any stable kernel prior to 5.3 to which the
above mentioned patch was backported.  Namely 4.9.y, 4.14.y, 4.19.y.
Signed-off-by: NNeilBrown <neilb@suse.de>
Reported-by: NEugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: NEugeniu Rosca <erosca@de.adit-jv.com>
Tested-by: NEugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 d2189b9e
......@@ -1572,9 +1572,9 @@ static void xprt_destroy(struct rpc_xprt *xprt)
* is cleared. We use ->transport_lock to ensure the mod_timer()
* can only run *before* del_time_sync(), never after.
*/
spin_lock(&xprt->transport_lock);
spin_lock_bh(&xprt->transport_lock);
del_timer_sync(&xprt->timer);
spin_unlock(&xprt->transport_lock);
spin_unlock_bh(&xprt->transport_lock);
/*
* Destroy sockets etc from the system workqueue so they can
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册