2010-06-10 20:52:43

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 1/1] nfs4 use mandatory attribute file type in nfs4_get_root

From: Andy Adamson <[email protected]>

decode_attr_type sets fattr->mode.

Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/getroot.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 7428f7d..a70e446 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -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");
--
1.6.6



2010-06-15 13:30:56

by Andy Adamson

[permalink] [raw]
Subject: Re: [PATCH 1/1] nfs4 use mandatory attribute file type in nfs4_get_root

On Mon, Jun 14, 2010 at 6:02 PM, Trond Myklebust
<[email protected]> wrote:
> 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.

Looks good.

-->Andy

>
>>
>> Signed-off-by: Andy Adamson <[email protected]>
>> ---
>> fs/nfs/getroot.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
>> index 7428f7d..a70e446 100644
>> --- a/fs/nfs/getroot.c
>> +++ b/fs/nfs/getroot.c
>> @@ -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
>

2010-06-14 22:02:08

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 1/1] nfs4 use mandatory attribute file type in nfs4_get_root

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.

>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> fs/nfs/getroot.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
> index 7428f7d..a70e446 100644
> --- a/fs/nfs/getroot.c
> +++ b/fs/nfs/getroot.c
> @@ -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");