Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f799bdb3 authored by Andy Adamson's avatar Andy Adamson Committed by Trond Myklebust
Browse files

nfs4 use mandatory attribute file type in nfs4_get_root



S_ISDIR(fsinfo.fattr->mode) checks the file type rather than the mode bits,
so we should be checking for the NFS_ATTR_FATTR_TYPE fattr property.

Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
parent 7e27d6e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh)
		goto out;
	}

	if (!(fsinfo.fattr->valid & NFS_ATTR_FATTR_MODE)
	if (!(fsinfo.fattr->valid & NFS_ATTR_FATTR_TYPE)
			|| !S_ISDIR(fsinfo.fattr->mode)) {
		printk(KERN_ERR "nfs4_get_rootfh:"
		       " getroot encountered non-directory\n");