Skip to content

Commit 35e3b6a

Browse files
author
Trond Myklebust
committed
NFS: Fix an Oops in nfs_d_automount()
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 <[email protected]>
1 parent 51069e4 commit 35e3b6a

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)