nfs4 use mandatory attribute file type in nfs4_get_root
authorAndy Adamson <andros@netapp.com>
Wed, 16 Jun 2010 13:51:02 +0000 (09:51 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 22 Jun 2010 17:17:43 +0000 (13:17 -0400)
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
fs/nfs/getroot.c

index 7428f7d..a70e446 100644 (file)
@@ -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");