Re: [PATCH] nfsd: Use correct error code when decoding extents
From: Sergey Bashirov
Date: Wed Jun 11 2025 - 12:25:01 EST
I also have some doubts about this code:
if (xdr_stream_decode_u64(&xdr, &bex.len))
return -NFS4ERR_BADXDR;
if (bex.len & (block_size - 1))
return -NFS4ERR_BADXDR;
The first error code is clear to me, it is all about decoding. But should
not we return -NFS4ERR_EINVAL in the second check? On one hand, we
encountered an invalid value after successful decoding, but on the other
hand, we stopped decoding the extent array, so we can say that this is
also a decoding error.
--
Sergey Bashirov