Skip to contentSkip to conversation

nfs4 use mandatory attribute file type in nfs4_get_root

PATCH In review [email protected] 3 participants 3 messages Jun 10, 2010 – Jun 15, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs4 use mandatory attribute file type in nfs4_get_root

From: Andy Adamson <[email protected]>

decode_attr_type sets fattr->mode.

---
 fs/nfs/getroot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/getroot.c +1 -1
index 7428f7d..a70e446 100644
@@ -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");
Signature · 1 line
1.6.6
#1 lore raw
Quoted 3 lines · On Thu, 2010-06-10 at 16:52 -0400, [email protected] wrote:

From: Andy Adamson <[email protected]>

decode_attr_type sets fattr->mode.

Well, yes... It sets part of fattr->mode. More specifically, though, it sets the file type part, so your patch is correct.

I'll fix up the above changelog entry so that it is a bit more descriptive. How about the following?

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.

Quoted 19 lines
---
 fs/nfs/getroot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/getroot.c +1 -1
index 7428f7d..a70e446 100644
@@ -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");

A message that is not in the archive (sent off-list or not yet received): 1276552926.3953.8.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org

#3 lore raw
Quoted 8 lines · Trond Myklebust
Quoted 3 lines · On Thu, 2010-06-10 at 16:52 -0400, [email protected] wrote:

From: Andy Adamson <[email protected]>

decode_attr_type sets fattr->mode.

Well, yes... It sets part of fattr->mode. More specifically, though, it sets the file type part, so your patch is correct.

Quoted 6 lines

I'll fix up the above changelog entry so that it is a bit more descriptive. How about the following?

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.

Looks good.

-->Andy

Quoted 27 lines
Quoted 12 lines
---
 fs/nfs/getroot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/getroot.c +0 -0
index 7428f7d..a70e446 100644

fs/nfs/getroot.c int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh) · line 152

Quoted 8 lines
fs/nfs/getroot.c +1 -1
@@ -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");

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html