Whamcloud - gitweb
LU-17710 llite: protect parallel accesses to lli_*id 27/54727/5
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Wed, 10 Apr 2024 17:08:49 +0000 (19:08 +0200)
committerOleg Drokin <green@whamcloud.com>
Wed, 5 Jun 2024 04:51:26 +0000 (04:51 +0000)
commite7ab0f86e4e8dbf225e92f06f83e9f304ad0436d
treef83f418fe16c4b3de478738b5dd7b79c1ea9a42c
parent16854cad1c9f5db93c94686b45b1a57e82beafe6
LU-17710 llite: protect parallel accesses to lli_*id

OSC obtains process uid/gid/jobid from the ll_inode_info. This can be
racy if several processes access the same file. This can lead to
corrupted or incoherent set of values.

This patch replaced the fields lli_jobid/lli_uid/lli_gid by a common
"struct job_info lli_jobinfo" field.

struct job_info {
       char ji_jobid[LUSTRE_JOBID_SIZE];
       __u32 ji_uid;
       __u32 ji_gid;
};

The accesses are protected by a seqlock (lli_jobinfo_seqlock).

Additionally, this saves and restores process uid/gid values for
readahead works (cra_jobid is replaced by cra_jobinfo).

Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: Idf01c1e4b533aea405c3a4439c0df0fcfc4dea56
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54727
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Thomas Bertschinger <bertschinger@lanl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
12 files changed:
lustre/include/cl_object.h
lustre/include/lustre_net.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/rw.c
lustre/llite/vvp_io.c
lustre/llite/vvp_object.c
lustre/obdclass/jobid.c
lustre/osc/osc_request.c
lustre/ptlrpc/client.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/ptlrpcd.c