mbox series

[v1,0/5] Fix NFSv3 READDIRPLUS failures

Message ID 165445865736.1664.4497130284832282034.stgit@bazille.1015granger.net (mailing list archive)
Headers show
Series Fix NFSv3 READDIRPLUS failures | expand

Message

Chuck Lever June 5, 2022, 7:58 p.m. UTC
While looking into the filecache CPU soft lock-up issue, I ran
across this problem. I thought I could run it down in just an
afternoon (I was wrong) and that this problem probably affects more
users than the soft lock-up (jury's still out).

Anyway, NFSD's new READDIRPLUS dirent encoder blows past the end of
the directory payload xdr_stream when the client requests more than
a page worth of directory entries. I tracked this down to how
xdr_get_next_encode_buffer() computes xdr->end. First patch in this
series is the fix. The remaining patches are clean-ups and
optimizations.

I want to get this into 5.19-rc quickly. I would appreciate getting
at least two R-b's for this series.

---

Chuck Lever (5):
      SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()
      SUNRPC: Optimize xdr_reserve_space()
      SUNRPC: Clean up xdr_commit_encode()
      SUNRPC: Clean up xdr_get_next_encode_buffer()
      SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer()


 net/sunrpc/xdr.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

--
Chuck Lever

Comments

NeilBrown June 7, 2022, 11:37 a.m. UTC | #1
On Mon, 06 Jun 2022, Chuck Lever wrote:
> While looking into the filecache CPU soft lock-up issue, I ran
> across this problem. I thought I could run it down in just an
> afternoon (I was wrong) and that this problem probably affects more
> users than the soft lock-up (jury's still out).
> 
> Anyway, NFSD's new READDIRPLUS dirent encoder blows past the end of
> the directory payload xdr_stream when the client requests more than
> a page worth of directory entries. I tracked this down to how
> xdr_get_next_encode_buffer() computes xdr->end. First patch in this
> series is the fix. The remaining patches are clean-ups and
> optimizations.
> 
> I want to get this into 5.19-rc quickly. I would appreciate getting
> at least two R-b's for this series.

Just for completeness:
  Reviewed-by: NeilBrown <neilb@suse.de>
for the whole series. Nothing I saw would justify any delay.

NeilBrown

> 
> ---
> 
> Chuck Lever (5):
>       SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()
>       SUNRPC: Optimize xdr_reserve_space()
>       SUNRPC: Clean up xdr_commit_encode()
>       SUNRPC: Clean up xdr_get_next_encode_buffer()
>       SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer()
> 
> 
>  net/sunrpc/xdr.c | 31 ++++++++++++++++++++++---------
>  1 file changed, 22 insertions(+), 9 deletions(-)
> 
> --
> Chuck Lever
> 
>
Chuck Lever June 7, 2022, 2:16 p.m. UTC | #2
> On Jun 7, 2022, at 7:37 AM, NeilBrown <neilb@suse.de> wrote:
> 
> On Mon, 06 Jun 2022, Chuck Lever wrote:
>> While looking into the filecache CPU soft lock-up issue, I ran
>> across this problem. I thought I could run it down in just an
>> afternoon (I was wrong) and that this problem probably affects more
>> users than the soft lock-up (jury's still out).
>> 
>> Anyway, NFSD's new READDIRPLUS dirent encoder blows past the end of
>> the directory payload xdr_stream when the client requests more than
>> a page worth of directory entries. I tracked this down to how
>> xdr_get_next_encode_buffer() computes xdr->end. First patch in this
>> series is the fix. The remaining patches are clean-ups and
>> optimizations.
>> 
>> I want to get this into 5.19-rc quickly. I would appreciate getting
>> at least two R-b's for this series.
> 
> Just for completeness:
>  Reviewed-by: NeilBrown <neilb@suse.de>
> for the whole series. Nothing I saw would justify any delay.

Thanks for your review. I have some thoughts about how to deal
idiomatically with your inlining optimization suggestion. I will
post a v2, I think that patch will be the only update.


> NeilBrown
> 
>> 
>> ---
>> 
>> Chuck Lever (5):
>>      SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()
>>      SUNRPC: Optimize xdr_reserve_space()
>>      SUNRPC: Clean up xdr_commit_encode()
>>      SUNRPC: Clean up xdr_get_next_encode_buffer()
>>      SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer()
>> 
>> 
>> net/sunrpc/xdr.c | 31 ++++++++++++++++++++++---------
>> 1 file changed, 22 insertions(+), 9 deletions(-)
>> 
>> --
>> Chuck Lever

--
Chuck Lever