All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: include invalid uid/gid in the error message
@ 2013-05-22  9:59 Tigran Mkrtchyan
  2013-05-22 11:51 ` Jim Rees
  0 siblings, 1 reply; 2+ messages in thread
From: Tigran Mkrtchyan @ 2013-05-22  9:59 UTC (permalink / raw)
  To: linux-nfs; +Cc: Tigran Mkrtchyan

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

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfs: include invalid uid/gid in the error message
  2013-05-22  9:59 [PATCH] nfs: include invalid uid/gid in the error message Tigran Mkrtchyan
@ 2013-05-22 11:51 ` Jim Rees
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Rees @ 2013-05-22 11:51 UTC (permalink / raw)
  To: Tigran Mkrtchyan; +Cc: linux-nfs

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 <tigran.mkrtchyan@desy.de>
  ---
   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 majordomo@vger.kernel.org
  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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-22 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22  9:59 [PATCH] nfs: include invalid uid/gid in the error message Tigran Mkrtchyan
2013-05-22 11:51 ` Jim Rees

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.