Whamcloud - gitweb
LU-13031 jobstats: store jobid in xattr when files are created 82/50982/8
authorThomas Bertschinger <bertschinger@lanl.gov>
Fri, 5 May 2023 21:05:22 +0000 (17:05 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 7 Aug 2023 03:49:43 +0000 (03:49 +0000)
commit23a2db28dcf1422a6a6da575e907fd257106d402
tree5b3d14c9e383a7107b40cf37f81aa362739af465
parent22c8093c4e96039567f2d1f741d939c01f1a8cbd
LU-13031 jobstats: store jobid in xattr when files are created

This change stores the jobid of the process that creates a file in an
extended attribute in the file's MDT inode, at file creation time.

The name of the xattr is determined by a new sysfs parameter
"mdt.*.job_xattr" so that the admin can choose a name that does
not conflict with other uses they may have for a given xattr.
The default value is "user.job". A value of "NONE" means that
the jobid will not be stored in the inode.

If the name is in the user namespace "user.", then the name portion
can be up to 7 alphanumeric characters long. The admin can choose
the trusted namespace to prevent users from modifying the value,
but only "trusted.job" is allowed in this namespace.

Allowing users to modify the contents of the xattr is helpful so
that the jobid can be preserved even when files are moved with tools
like `cp` or `rsync`, and when copied from one filesystem to another.

Signed-off-by: Thomas Bertschinger <bertschinger@lanl.gov>
Change-Id: Iad78a5ec6fbc4b761ff481141763bdd0cdcd0128
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50982
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/md_object.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/tests/sanity.sh