Whamcloud - gitweb
LU-16077 tbf: pb_uid/pb_gid ptlrpc_body fields for TBF rules 35/48235/7
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Fri, 12 Aug 2022 19:41:08 +0000 (21:41 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 18 Apr 2023 03:21:53 +0000 (03:21 +0000)
commit0544c108c12c87a43562b4ef31120448bf0018c8
treed5a60cae36d3c45c8422e22bc30e45180c324e33
parent11a89c5ec16685fda91dd7c052b72012833c2f88
LU-16077 tbf: pb_uid/pb_gid ptlrpc_body fields for TBF rules

The file UID/GID are packed inside bulk IO because the requests are
sent asynchronously (cannot use the current thread UID/GID).

This is an issue for TBF rules if the file/inode UID/GID doesn't
match the process ones (e.g: reading common libraries): we can't limit
the user RPCs doing the IOs in that case.

This patch pack UID/GID for TBF rules inside ptlrpc_body (
pb_padding64_2 -> (pb_uid, pb_gid)) to be independent of quota
interactions: it stores the client process UID/GID instead of the
values of the file attrs.
Moreover, it enables to track requests naturally without UID/GID like
ldlm_flock_enqueue.

This patch saves the process UID/GID inside the ll_inode_info struct.
Then it restores these values when sending a bulk IO from a ptlrpc
thread (like for jobids).

Add sanityn test_77jb to verify.

Fixes: e0cdde1 ("LU-9658 ptlrpc: Add QoS for uid and gid in NRS-TBF")
Test-Parameters: testlist=sanityn env=ONLY=77,ONLY_REPEAT=20
Test-Parameters: serverversion=2.12.9 testlist=sanityn env=ONLY=77
Test-Parameters: clientversion=2.12.9 testlist=sanityn env=ONLY=77
Signed-off-by: Etienne AUJAMES <etienne.aujames@cea.fr>
Change-Id: I61e42267ae568f9a1eb6fe57937a5e96f1824010
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48235
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
16 files changed:
lustre/include/cl_object.h
lustre/include/lustre_net.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/vvp_io.c
lustre/llite/vvp_object.c
lustre/osc/osc_request.c
lustre/ptlrpc/client.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/wiretest.c
lustre/tests/sanityn.sh
lustre/utils/wirecheck.c
lustre/utils/wiretest.c