From 6f74bb60ff6c58f4a2647556124c501100330f4c Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 3 Nov 2022 11:47:46 +0100 Subject: [PATCH] LU-16205 sec: reserve flag for fid2path for encrypted files Reserve OBD_CONNECT2_ENCRYPT_FID2PATH connection flag for fid2path support for encrypted files. This connection flag is required so that newer servers continue to return -ENODATA to older clients. Test-Parameters: trivial Signed-off-by: Sebastien Buisson Change-Id: I505b90a061687a7ef481adacca98908c96e487be Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49028 Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/include/uapi/linux/lustre/lustre_idl.h | 1 + lustre/obdclass/lprocfs_status.c | 3 +++ lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 5 files changed, 9 insertions(+) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 74b725b..5fb89c8 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -841,6 +841,7 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT2_LOCK_CONTENTION 0x2000000ULL /* contention detect */ #define OBD_CONNECT2_ATOMIC_OPEN_LOCK 0x4000000ULL /* lock on first open */ #define OBD_CONNECT2_ENCRYPT_NAME 0x8000000ULL /* name encrypt */ +#define OBD_CONNECT2_ENCRYPT_FID2PATH 0x40000000ULL /* fid2path enc file */ /* XXX README XXX README XXX README XXX README XXX README XXX README XXX * Please DO NOT add OBD_CONNECT flags before first ensuring that this value * is not in use by some other branch/patch. Email adilger@whamcloud.com diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 165281c..c61033f 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -648,6 +648,9 @@ static const char *const obd_connect_names[] = { "lock_contend", /* 0x2000000 */ "atomic_open_lock", /* 0x4000000 */ "name_encryption", /* 0x8000000 */ + "mkdir_replay", /* 0x10000000 */ + "dmv_inherit", /* 0x20000000 */ + "encryption_fid2path", /* 0x40000000 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 7b7b3e4..f5966fe 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1402,6 +1402,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_ATOMIC_OPEN_LOCK); LASSERTF(OBD_CONNECT2_ENCRYPT_NAME == 0x8000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_ENCRYPT_NAME); + LASSERTF(OBD_CONNECT2_ENCRYPT_FID2PATH == 0x40000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_ENCRYPT_FID2PATH); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index d6d0a2b..7fbc301 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -643,6 +643,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_PCCRO); CHECK_DEFINE_64X(OBD_CONNECT2_ATOMIC_OPEN_LOCK); CHECK_DEFINE_64X(OBD_CONNECT2_ENCRYPT_NAME); + CHECK_DEFINE_64X(OBD_CONNECT2_ENCRYPT_FID2PATH); CHECK_VALUE_X(OBD_CKSUM_CRC32); CHECK_VALUE_X(OBD_CKSUM_ADLER); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 4ee1ad5..3be88de 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1428,6 +1428,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_ATOMIC_OPEN_LOCK); LASSERTF(OBD_CONNECT2_ENCRYPT_NAME == 0x8000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_ENCRYPT_NAME); + LASSERTF(OBD_CONNECT2_ENCRYPT_FID2PATH == 0x40000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_ENCRYPT_FID2PATH); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", -- 1.8.3.1