[5.19,554/717] NFSD: Return nfserr_serverfault if splice_ok but buf->pages have data

Message ID 20221022072522.883630640@linuxfoundation.org
State New
Headers
Series None |

Commit Message

Greg KH Oct. 22, 2022, 7:27 a.m. UTC
  From: Anna Schumaker <Anna.Schumaker@Netapp.com>

[ Upstream commit 06981d560606ac48d61e5f4fff6738b925c93173 ]

This was discussed with Chuck as part of this patch set. Returning
nfserr_resource was decided to not be the best error message here, and
he suggested changing to nfserr_serverfault instead.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Link: https://lore.kernel.org/linux-nfs/20220907195259.926736-1-anna@kernel.org/T/#t
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Chuck Lever Oct. 22, 2022, 2:46 p.m. UTC | #1
> On Oct 22, 2022, at 3:27 AM, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> From: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> [ Upstream commit 06981d560606ac48d61e5f4fff6738b925c93173 ]
> 
> This was discussed with Chuck as part of this patch set. Returning
> nfserr_resource was decided to not be the best error message here, and
> he suggested changing to nfserr_serverfault instead.
> 
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> Link: https://lore.kernel.org/linux-nfs/20220907195259.926736-1-anna@kernel.org/T/#t
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> fs/nfsd/nfs4xdr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index eef98e3f4ae5..1e5822d00043 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -3995,7 +3995,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
> 	if (resp->xdr->buf->page_len &&
> 	    test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
> 		WARN_ON_ONCE(1);
> -		return nfserr_resource;
> +		return nfserr_serverfault;
> 	}
> 	xdr_commit_encode(xdr);

Why is this change to be included in stable kernels?


--
Chuck Lever
  
Greg KH Oct. 23, 2022, 11:38 a.m. UTC | #2
On Sat, Oct 22, 2022 at 02:46:35PM +0000, Chuck Lever III wrote:
> 
> 
> > On Oct 22, 2022, at 3:27 AM, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > 
> > From: Anna Schumaker <Anna.Schumaker@Netapp.com>
> > 
> > [ Upstream commit 06981d560606ac48d61e5f4fff6738b925c93173 ]
> > 
> > This was discussed with Chuck as part of this patch set. Returning
> > nfserr_resource was decided to not be the best error message here, and
> > he suggested changing to nfserr_serverfault instead.
> > 
> > Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> > Link: https://lore.kernel.org/linux-nfs/20220907195259.926736-1-anna@kernel.org/T/#t
> > Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> > fs/nfsd/nfs4xdr.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> > index eef98e3f4ae5..1e5822d00043 100644
> > --- a/fs/nfsd/nfs4xdr.c
> > +++ b/fs/nfsd/nfs4xdr.c
> > @@ -3995,7 +3995,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
> > 	if (resp->xdr->buf->page_len &&
> > 	    test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
> > 		WARN_ON_ONCE(1);
> > -		return nfserr_resource;
> > +		return nfserr_serverfault;
> > 	}
> > 	xdr_commit_encode(xdr);
> 
> Why is this change to be included in stable kernels?

Is it not a valid bugfix?  If so, I will be glad to drop it, but in
reading the changelog text and the code change itself, it seems like a
valid fix to be backporting to stable kernels.

thanks,

greg k-h
  

Patch

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index eef98e3f4ae5..1e5822d00043 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3995,7 +3995,7 @@  nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
 	if (resp->xdr->buf->page_len &&
 	    test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
 		WARN_ON_ONCE(1);
-		return nfserr_resource;
+		return nfserr_serverfault;
 	}
 	xdr_commit_encode(xdr);