linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] NFSD: Remove setting unused variable in nfsd_vfs_read()
@ 2011-04-27 19:47 bjschuma
  2011-04-27 19:47 ` [PATCH 2/3] NFSD: Check status from nfsd4_map_bcts_dir() bjschuma
  2011-04-27 19:47 ` [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session() bjschuma
  0 siblings, 2 replies; 4+ messages in thread
From: bjschuma @ 2011-04-27 19:47 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Bryan Schumaker

From: Bryan Schumaker <bjschuma@netapp.com>

Compiling gave me this warning:
fs/nfsd/vfs.c: In function ‘nfsd_vfs_read’:
fs/nfsd/vfs.c:880:16: warning: variable ‘inode’ set but not used
[-Wunused-but-set-variable]

I discovered that a local variable "inode" was being set towards the
beginning of nfsd_vfs_read() and then ignored for the rest of the
function.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfsd/vfs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 129f3c9..07b1e58 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -877,13 +877,11 @@ static __be32
 nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
               loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
 {
-	struct inode *inode;
 	mm_segment_t	oldfs;
 	__be32		err;
 	int		host_err;
 
 	err = nfserr_perm;
-	inode = file->f_path.dentry->d_inode;
 
 	if (file->f_op->splice_read && rqstp->rq_splice_ok) {
 		struct splice_desc sd = {
-- 
1.7.4.4


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

* [PATCH 2/3] NFSD: Check status from nfsd4_map_bcts_dir()
  2011-04-27 19:47 [PATCH 1/3] NFSD: Remove setting unused variable in nfsd_vfs_read() bjschuma
@ 2011-04-27 19:47 ` bjschuma
  2011-04-27 19:47 ` [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session() bjschuma
  1 sibling, 0 replies; 4+ messages in thread
From: bjschuma @ 2011-04-27 19:47 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Bryan Schumaker

From: Bryan Schumaker <bjschuma@netapp.com>

Compiling gave me this warning:
fs/nfsd/nfs4state.c: In function ‘nfsd4_bind_conn_to_session’:
fs/nfsd/nfs4state.c:1623:9: warning: variable ‘status’ set but not used
[-Wunused-but-set-variable]

The local variable "status" was being set by nfsd4_map_bcts_dir() and
then ignored before calling nfsd4_new_conn().

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfsd/nfs4state.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4cf04e1..e00061a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1637,8 +1637,9 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
 		return nfserr_badsession;
 
 	status = nfsd4_map_bcts_dir(&bcts->dir);
-	nfsd4_new_conn(rqstp, cstate->session, bcts->dir);
-	return nfs_ok;
+	if (!status)
+		nfsd4_new_conn(rqstp, cstate->session, bcts->dir);
+	return status;
 }
 
 static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4_sessionid *sid)
-- 
1.7.4.4


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

* [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session()
  2011-04-27 19:47 [PATCH 1/3] NFSD: Remove setting unused variable in nfsd_vfs_read() bjschuma
  2011-04-27 19:47 ` [PATCH 2/3] NFSD: Check status from nfsd4_map_bcts_dir() bjschuma
@ 2011-04-27 19:47 ` bjschuma
  2011-04-28 21:02   ` J. Bruce Fields
  1 sibling, 1 reply; 4+ messages in thread
From: bjschuma @ 2011-04-27 19:47 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Bryan Schumaker

From: Bryan Schumaker <bjschuma@netapp.com>

Compiling gave me this warning:
fs/nfsd/nfs4xdr.c: In function ‘nfsd4_decode_bind_conn_to_session’:
fs/nfsd/nfs4xdr.c:427:6: warning: variable ‘dummy’ set but not used
[-Wunused-but-set-variable]

The local variable "dummy" wasn't being used past the READ32() macro that
set it.  READ_BUF() should ensure that the xdr buffer is pushed past the
data read into dummy already, so nothing needs to be read in.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfsd/nfs4xdr.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index c6766af..6191eec 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -424,14 +424,12 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
 static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp, struct nfsd4_bind_conn_to_session *bcts)
 {
 	DECODE_HEAD;
-	u32 dummy;
 
 	READ_BUF(NFS4_MAX_SESSIONID_LEN + 8);
 	COPYMEM(bcts->sessionid.data, NFS4_MAX_SESSIONID_LEN);
 	READ32(bcts->dir);
 	/* XXX: Perhaps Tom Tucker could help us figure out how we
 	 * should be using ctsa_use_conn_in_rdma_mode: */
-	READ32(dummy);
 
 	DECODE_TAIL;
 }
-- 
1.7.4.4


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

* Re: [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session()
  2011-04-27 19:47 ` [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session() bjschuma
@ 2011-04-28 21:02   ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2011-04-28 21:02 UTC (permalink / raw)
  To: bjschuma; +Cc: linux-nfs

On Wed, Apr 27, 2011 at 03:47:16PM -0400, bjschuma@netapp.com wrote:
> From: Bryan Schumaker <bjschuma@netapp.com>
> 
> Compiling gave me this warning:
> fs/nfsd/nfs4xdr.c: In function ‘nfsd4_decode_bind_conn_to_session’:
> fs/nfsd/nfs4xdr.c:427:6: warning: variable ‘dummy’ set but not used
> [-Wunused-but-set-variable]
> 
> The local variable "dummy" wasn't being used past the READ32() macro that
> set it.  READ_BUF() should ensure that the xdr buffer is pushed past the
> data read into dummy already, so nothing needs to be read in.
> 
> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> ---
>  fs/nfsd/nfs4xdr.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index c6766af..6191eec 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -424,14 +424,12 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
>  static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp, struct nfsd4_bind_conn_to_session *bcts)
>  {
>  	DECODE_HEAD;
> -	u32 dummy;
>  
>  	READ_BUF(NFS4_MAX_SESSIONID_LEN + 8);
>  	COPYMEM(bcts->sessionid.data, NFS4_MAX_SESSIONID_LEN);
>  	READ32(bcts->dir);
>  	/* XXX: Perhaps Tom Tucker could help us figure out how we
>  	 * should be using ctsa_use_conn_in_rdma_mode: */
> -	READ32(dummy);

That leaves it unclear what the comment was referring to.... OK, fixed
that up and applied all 3 patches.  Thanks!

--b.

>  
>  	DECODE_TAIL;
>  }
> -- 
> 1.7.4.4
> 

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

end of thread, other threads:[~2011-04-28 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 19:47 [PATCH 1/3] NFSD: Remove setting unused variable in nfsd_vfs_read() bjschuma
2011-04-27 19:47 ` [PATCH 2/3] NFSD: Check status from nfsd4_map_bcts_dir() bjschuma
2011-04-27 19:47 ` [PATCH 3/3] NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session() bjschuma
2011-04-28 21:02   ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).