2013-05-22 10:00:07

by Mkrtchyan, Tigran

[permalink] [raw]
Subject: [PATCH] nfs: include invalid uid/gid in the error message

if client receives an invalid uid/gid debug message is generated.
Unfortunately the actual invalid value is not included.

Signed-off-by: Tigran Mkrtchyan <[email protected]>
---
fs/nfs/nfs2xdr.c | 4 ++--
fs/nfs/nfs3xdr.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 62db136..85c0646 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -319,10 +319,10 @@ static int decode_fattr(struct xdr_stream *xdr, struct nfs_fattr *fattr)

return 0;
out_uid:
- dprintk("NFS: returned invalid uid\n");
+ dprintk("NFS: returned invalid uid %d\n", fattr->uid);
return -EINVAL;
out_gid:
- dprintk("NFS: returned invalid gid\n");
+ dprintk("NFS: returned invalid gid %d\n", fattr->gid);
return -EINVAL;
out_overflow:
print_overflow_msg(__func__, xdr);
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index fa6d721..cd52069 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -680,10 +680,10 @@ static int decode_fattr3(struct xdr_stream *xdr, struct nfs_fattr *fattr)
fattr->valid |= NFS_ATTR_FATTR_V3;
return 0;
out_uid:
- dprintk("NFS: returned invalid uid\n");
+ dprintk("NFS: returned invalid uid %d\n", fattr->uid);
return -EINVAL;
out_gid:
- dprintk("NFS: returned invalid gid\n");
+ dprintk("NFS: returned invalid gid %d\n", fattr->gid);
return -EINVAL;
out_overflow:
print_overflow_msg(__func__, xdr);
--
1.8.1.4



2013-05-22 11:51:37

by Jim Rees

[permalink] [raw]
Subject: Re: [PATCH] nfs: include invalid uid/gid in the error message

Tigran Mkrtchyan wrote:

if client receives an invalid uid/gid debug message is generated.
Unfortunately the actual invalid value is not included.

Signed-off-by: Tigran Mkrtchyan <[email protected]>
---
fs/nfs/nfs2xdr.c | 4 ++--
fs/nfs/nfs3xdr.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 62db136..85c0646 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -319,10 +319,10 @@ static int decode_fattr(struct xdr_stream *xdr, struct nfs_fattr *fattr)

return 0;
out_uid:
- dprintk("NFS: returned invalid uid\n");
+ dprintk("NFS: returned invalid uid %d\n", fattr->uid);
return -EINVAL;
out_gid:
- dprintk("NFS: returned invalid gid\n");
+ dprintk("NFS: returned invalid gid %d\n", fattr->gid);
return -EINVAL;
out_overflow:
print_overflow_msg(__func__, xdr);
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index fa6d721..cd52069 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -680,10 +680,10 @@ static int decode_fattr3(struct xdr_stream *xdr, struct nfs_fattr *fattr)
fattr->valid |= NFS_ATTR_FATTR_V3;
return 0;
out_uid:
- dprintk("NFS: returned invalid uid\n");
+ dprintk("NFS: returned invalid uid %d\n", fattr->uid);
return -EINVAL;
out_gid:
- dprintk("NFS: returned invalid gid\n");
+ dprintk("NFS: returned invalid gid %d\n", fattr->gid);
return -EINVAL;
out_overflow:
print_overflow_msg(__func__, xdr);
--
1.8.1.4

--
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

I can't tell what the type of fattr->uid is through the maze of include
files, but would it be a good idea to cast this to unsigned long for
printing?