Skip to content

Commit

Permalink
nfs4 use mandatory attribute file type in nfs4_get_root
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Jun 22, 2010
1 parent 7e27d6e commit f799bdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/getroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f799bdb

Please sign in to comment.