Skip to content

Commit f799bdb

Browse files
androsadamsonTrond Myklebust
authored andcommitted
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: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
1 parent 7e27d6e commit f799bdb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/nfs/getroot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh)
146146
goto out;
147147
}
148148

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

0 commit comments

Comments
 (0)