Whamcloud - gitweb
LU-12443 ptlrpc: fix reply buffers shrinking and growing 43/35243/7
authorMikhail Pershin <mpershin@whamcloud.com>
Mon, 17 Jun 2019 08:00:31 +0000 (11:00 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Sep 2019 23:01:05 +0000 (23:01 +0000)
commitcedbb25e984ceb85a66bc5a315fbfa05c5bcb423
treede466225550ca4d654d8facc8be9d61afcbf991c
parentce47ba3d0983e341f7c9a62da5e851933ff4f307
LU-12443 ptlrpc: fix reply buffers shrinking and growing

The req_capsule_shrink() doesn't update capsule itself with
new buffer lenghts after the shrinking. Usually it is not
needed because reply is packed already. But if reply buffers
are re-allocated by req_capsule_server_grow() then non-updated
lenghts from capsule are used causing bigger reply message.
That may cause client buffer re-allocation with resend.

Patch does the following:
- update capsule lenght after the shrinking
- introduce lustre_grow_msg() to grow msg field in-place
- update req_capsule_server_grow() to use generic
  lustre_grow_msg() and make it able to grow reply without
  re-allocation if reply buffer is big enough already
- update sanity test 271f to use bigger file size to exceed
  current maximum reply buffer size allocated on client.

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I154c55d98f41406d0c932c7e8705e0ecf3dfa935
Reviewed-on: https://review.whamcloud.com/35243
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_net.h
lustre/ptlrpc/layout.c
lustre/ptlrpc/pack_generic.c
lustre/tests/sanity.sh