NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()
stable inclusion from stable-v5.10.44 commit b4651cea43afd4fa3f0091bfed5ab4b5030d0425 bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=441 CVE: NA ------------------------------------------------- [ Upstream commit dfe1fe75 ] If the inode is being evicted, but has to return a delegation first, then it can cause a deadlock in the corner case where the server reboots before the delegreturn completes, but while the call to iget5_locked() in nfs4_opendata_get_inode() is waiting for the inode free to complete. Since the open call still holds a session slot, the reboot recovery cannot proceed. In order to break the logjam, we can turn the delegation return into a privileged operation for the case where we're evicting the inode. We know that in that case, there can be no other state recovery operation that conflicts. Reported-by: Nzhangxiaoxu (A) <zhangxiaoxu5@huawei.com> Fixes: 5fcdfacc ("NFSv4: Return delegations synchronously in evict_inode") Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: N1205068450 <1205068450@qq.com> Reviewed-by: Jian Cheng <cj.chengjian(a)huawei.com>
Showing
想要评论请 注册 或 登录