Whamcloud - gitweb
LU-13903 uapi: fixup UAPI headers for native Linux client. 64/44664/5
authorJames Simmons <jsimmons@infradead.org>
Sat, 4 Sep 2021 12:33:53 +0000 (08:33 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Sep 2021 14:07:41 +0000 (14:07 +0000)
commitd963e66f609c3bf4766fe4f8d6eeb93a5471c569
tree6f72538653a92ea17255c6bb1f4aea239ec1ac65
parented4a625d88567a2498c3fe32fd340ae7985e6ad0
LU-13903 uapi: fixup UAPI headers for native Linux client.

This covers all the UAPI problems outside of the user land
wiretest utility. One set of problems is build and the second is
that UAPI header definitions are either user land only or never
used to valid data going to or from user land.

1) Use UAPI header definitions to validate data send to or from
   kernel space. We check lum_hash_type using LMV_HASH_TYPE_MASK.
   This avoids a round trip to the server which will report back
   an error. The other case is we check the values returned for
   LL_IOC_HSM_ACTION. We keep the original behavior of passing
   unknown data to the user land application but add debug
   logging if the data looks corrupt to help track down bug
   issues.

2) We can use QIF_DQBLKSIZE* instead of Lustre specific values
   for our quota handling. QIF_DQBLKSIZE* is a Linux UAPI quota
   value.

3) The NOTIFY_GRACE_* macros are used only by user land. Move
   to lustreapi.h

4) A few of the UAPI definitions are used by utility code
   present on the client and the Lustre kernel server code; which
   are not sent over the wire. Handle these special cases. This
   covers the missing LCM_USER_MIRROR_FLAGS, LCME_TEMPLATE_FLAGS,
   and LQUOTA_* values. Once server code merges upstream we can
   clean this up.

5) lcfg_cmd2data() is server specific so in case of a client build
   we can have get_llog_event_name() just always return NULL.

6) Don't package OpenSFS UAPI headers when building for native
   Linux client.

Change-Id: I258ee917b005e438eb7c15fa6e0c4b72e9ea9d56
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/44664
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
12 files changed:
config/lustre-build.m4
lustre.spec.in
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/ptlrpc/wiretest.c
lustre/tests/mirror_io.c
lustre/utils/lfs.c
lustre/utils/obd.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c