Re: [PATCH v4 1/2] NFSD: Return nfserr_serverfault if splice_ok but buf->pages have data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Sep 15, 2022, at 12:59 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> 
> On Tue, 2022-09-13 at 14:01 -0400, Anna Schumaker wrote:
>> From: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
>> 
>> 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@xxxxxxxxxx>
>> ---
>> 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 1e9690a061ec..01dd73ed5720 100644
>> --- a/fs/nfsd/nfs4xdr.c
>> +++ b/fs/nfsd/nfs4xdr.c
>> @@ -3994,7 +3994,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
>> 	}
>> 	if (resp->xdr->buf->page_len && splice_ok) {
>> 		WARN_ON_ONCE(1);
>> -		return nfserr_resource;
>> +		return nfserr_serverfault;
>> 	}
>> 	xdr_commit_encode(xdr);
>> 
> 
> IIRC the problem is that nfserr_resource is not valid in v4.1+. Do we
> also need to change the nfserr_resource return in the if block above
> this one?

I discovered that nfsd4_encode_operation() converts nfserr_resource
to the status code that is proper for the minor version that is in
use. We're good to go there.

--
Chuck Lever







[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux