Skip to content

Commit 5fa8cf6

Browse files
committed
NFS: Fix an Oops in nfs_d_automount()
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Trond Myklebust <trond.myklebust@hammerspace.com> commit 35e3b6a 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: 2b0143b ("VFS: normal filesystems (and lustre): d_inode() annotations") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> (cherry picked from commit 35e3b6a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 2f65d43 commit 5fa8cf6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
147147
struct nfs_fs_context *ctx;
148148
struct fs_context *fc;
149149
struct vfsmount *mnt = ERR_PTR(-ENOMEM);
150-
struct nfs_server *server = NFS_SERVER(d_inode(path->dentry));
150+
struct nfs_server *server = NFS_SB(path->dentry->d_sb);
151151
struct nfs_client *client = server->nfs_client;
152152
int timeout = READ_ONCE(nfs_mountpoint_expiry_timeout);
153153
int ret;

0 commit comments

Comments
 (0)