Whamcloud - gitweb
LU-12811 ptlrpc: pass buffer size to the swabbing functions 35/36435/9
authorEmoly Liu <emoly@whamcloud.com>
Mon, 23 Dec 2019 02:32:31 +0000 (10:32 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:50:18 +0000 (05:50 +0000)
commit6099136315e8f71c52ea720c7622a7c05b8e3640
tree05379264c28fc0f6c3b1d2964c81fb6b4035b43f
parent037abde0c33f4fff49c237e8588a45cc3da21c59
LU-12811 ptlrpc: pass buffer size to the swabbing functions

By adding a separate rmf_swab_len() function pointer to
req_msg_field, the buffer size can be passed to the swabbing
functions, e.g. lustre_swab_fiemap() in this patch, to avoid
invalid access, especially for small buffer.

Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I997e6a828f2f1cdfdb8a5fa241fa43ca0ae3677e
Reviewed-on: https://review.whamcloud.com/36435
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
lustre/include/lustre_swab.h
lustre/ptlrpc/layout.c
lustre/ptlrpc/pack_generic.c