All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd: fix return of nfs4_acl_write_who
@ 2014-06-17 10:14 Jeff Layton
  2014-06-17 10:28 ` Christoph Hellwig
  2014-06-18 15:42 ` J. Bruce Fields
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Layton @ 2014-06-17 10:14 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

AFAICT, the only way to hit this error is to pass this function a bogus
"who" value. In that case, we probably don't want to return -1 as that
could get sent back to the client. Turn this into nfserr_serverfault,
which is a more appropriate error for a server bug like this.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/nfs4acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index d714156a19fd..b0cf00d3ee7d 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -935,5 +935,5 @@ __be32 nfs4_acl_write_who(struct xdr_stream *xdr, int who)
 		return 0;
 	}
 	WARN_ON_ONCE(1);
-	return -1;
+	return nfserr_serverfault;
 }
-- 
1.9.3


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

* Re: [PATCH] nfsd: fix return of nfs4_acl_write_who
  2014-06-17 10:14 [PATCH] nfsd: fix return of nfs4_acl_write_who Jeff Layton
@ 2014-06-17 10:28 ` Christoph Hellwig
  2014-06-18 15:42 ` J. Bruce Fields
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2014-06-17 10:28 UTC (permalink / raw)
  To: Jeff Layton; +Cc: bfields, linux-nfs

On Tue, Jun 17, 2014 at 06:14:08AM -0400, Jeff Layton wrote:
> AFAICT, the only way to hit this error is to pass this function a bogus
> "who" value. In that case, we probably don't want to return -1 as that
> could get sent back to the client. Turn this into nfserr_serverfault,
> which is a more appropriate error for a server bug like this.
> 
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] nfsd: fix return of nfs4_acl_write_who
  2014-06-17 10:14 [PATCH] nfsd: fix return of nfs4_acl_write_who Jeff Layton
  2014-06-17 10:28 ` Christoph Hellwig
@ 2014-06-18 15:42 ` J. Bruce Fields
  2014-06-18 16:03   ` Jeff Layton
  1 sibling, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2014-06-18 15:42 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs

On Tue, Jun 17, 2014 at 06:14:08AM -0400, Jeff Layton wrote:
> AFAICT, the only way to hit this error is to pass this function a bogus
> "who" value. In that case, we probably don't want to return -1 as that
> could get sent back to the client. Turn this into nfserr_serverfault,
> which is a more appropriate error for a server bug like this.

I don't really care since there shouldn't be any way to hit this, but
OK, applying for 3.17.

--b.

> 
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> ---
>  fs/nfsd/nfs4acl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index d714156a19fd..b0cf00d3ee7d 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -935,5 +935,5 @@ __be32 nfs4_acl_write_who(struct xdr_stream *xdr, int who)
>  		return 0;
>  	}
>  	WARN_ON_ONCE(1);
> -	return -1;
> +	return nfserr_serverfault;
>  }
> -- 
> 1.9.3
> 

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

* Re: [PATCH] nfsd: fix return of nfs4_acl_write_who
  2014-06-18 15:42 ` J. Bruce Fields
@ 2014-06-18 16:03   ` Jeff Layton
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2014-06-18 16:03 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs

On Wed, 18 Jun 2014 11:42:04 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Tue, Jun 17, 2014 at 06:14:08AM -0400, Jeff Layton wrote:
> > AFAICT, the only way to hit this error is to pass this function a bogus
> > "who" value. In that case, we probably don't want to return -1 as that
> > could get sent back to the client. Turn this into nfserr_serverfault,
> > which is a more appropriate error for a server bug like this.
> 
> I don't really care since there shouldn't be any way to hit this, but
> OK, applying for 3.17.
> 
> --b.
> 

Thanks. Yeah, it's pretty unlikely...

I saw a sparse warning from that and silencing it was the main impetus
for the patch. I guess we can also call it "future proofing". In the
event that some other bug ends causing this function to get passed a
bogus "who" arg, then I think we'll stand a better chance of noticing
it with this change.

> > 
> > Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> > ---
> >  fs/nfsd/nfs4acl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> > index d714156a19fd..b0cf00d3ee7d 100644
> > --- a/fs/nfsd/nfs4acl.c
> > +++ b/fs/nfsd/nfs4acl.c
> > @@ -935,5 +935,5 @@ __be32 nfs4_acl_write_who(struct xdr_stream *xdr, int who)
> >  		return 0;
> >  	}
> >  	WARN_ON_ONCE(1);
> > -	return -1;
> > +	return nfserr_serverfault;
> >  }
> > -- 
> > 1.9.3
> > 


-- 
Jeff Layton <jlayton@primarydata.com>

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

end of thread, other threads:[~2014-06-18 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-17 10:14 [PATCH] nfsd: fix return of nfs4_acl_write_who Jeff Layton
2014-06-17 10:28 ` Christoph Hellwig
2014-06-18 15:42 ` J. Bruce Fields
2014-06-18 16:03   ` Jeff Layton

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.