NFS: Fix an Oops in nfs_d_automount()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 14 Nov 2022 22:30:39 +0000 (17:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:13 +0000 (13:14 +0100)
commitf12377abac15fb4e8698225ac386894f8ae63598
treef211b4663cfe42a229ae4c6169722bb554ea0584
parent9a96aff53c2165a3017531bfd6b1930a4591a6a0
NFS: Fix an Oops in nfs_d_automount()

[ Upstream commit 35e3b6ae84935d0d7ff76cbdaa83411b0ad5e471 ]

When mounting from a NFSv4 referral, path->dentry can end up being a
negative dentry, so derive the struct nfs_server from the dentry
itself instead.

Fixes: 2b0143b5c986 ("VFS: normal filesystems (and lustre): d_inode() annotations")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/namespace.c