Whamcloud - gitweb
LU-13805 obd: Reserve unaligned DIO connect flag 75/51075/7
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 9 Aug 2023 16:16:25 +0000 (12:16 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 24 Aug 2023 04:33:18 +0000 (04:33 +0000)
Unaligned DIO generally requires only client changes, but
an assert must be removed from ZFS servers for it to work
correctly.  This means we need a connect flag to recognize
whether or not a server running ZFS can safely use
unaligned DIO.

All OSTs will present this flag - to keep things simple -
but if the flag is not present, we'll still do unaligned
DIO to ldiskfs OSTs.

Actual implementation will be in another patch, this one
just creates the flag itself.

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I8b149cc54f4fb11e64182c65f2fbb01f8a3d3868
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51075
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_export.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index de28a47..de7efa7 100644 (file)
@@ -524,6 +524,11 @@ static inline bool imp_connect_replay_create(struct obd_import *imp)
 #define imp_connect_replay_create(exp) true
 #endif
 
+static inline bool exp_connect_unaligned_dio(struct obd_export *exp)
+{
+       return (exp_connect_flags2(exp) & OBD_CONNECT2_UNALIGNED_DIO);
+}
+
 enum {
        /* archive_ids in array format */
        KKUC_CT_DATA_ARRAY_MAGIC        = 0x092013cea,
index f69b0e3..6a61cae 100644 (file)
@@ -851,6 +851,9 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT2_REPLAY_CREATE      0x80000000ULL /* replay OST_CREATE */
 #define OBD_CONNECT2_LARGE_NID         0x100000000ULL /* understands large/IPv6 NIDs */
 #define OBD_CONNECT2_COMPRESS          0x200000000ULL /* compressed file */
+/* only ZFS servers require a change to support unaligned DIO, so this flag is
+ * ignored for ldiskfs servers */
+#define OBD_CONNECT2_UNALIGNED_DIO     0x400000000ULL /* unaligned DIO */
 /* 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
index 48151b9..33f61c2 100644 (file)
@@ -654,6 +654,7 @@ static const char *const obd_connect_names[] = {
        "replay_create",                /* 0x80000000 */
        "large_nid",                    /* 0x100000000 */
        "compressed_file",              /* 0x200000000 */
+       "unaligned_dio",                /* 0x400000000 */
        NULL
 };
 
index 7676db9..efdbbc2 100644 (file)
@@ -1454,6 +1454,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_LARGE_NID);
        LASSERTF(OBD_CONNECT2_COMPRESS == 0x200000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_COMPRESS);
+       LASSERTF(OBD_CONNECT2_UNALIGNED_DIO == 0x400000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_UNALIGNED_DIO);
 
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
index 39306a5..077b145 100644 (file)
@@ -685,6 +685,7 @@ check_obd_connect_data(void)
        CHECK_DEFINE_64X(OBD_CONNECT2_REPLAY_CREATE);
        CHECK_DEFINE_64X(OBD_CONNECT2_LARGE_NID);
        CHECK_DEFINE_64X(OBD_CONNECT2_COMPRESS);
+       CHECK_DEFINE_64X(OBD_CONNECT2_UNALIGNED_DIO);
 
        BLANK_LINE();
        CHECK_VALUE_X(OBD_CKSUM_CRC32);
index 99be9fb..85d9bfe 100644 (file)
@@ -1478,6 +1478,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_LARGE_NID);
        LASSERTF(OBD_CONNECT2_COMPRESS == 0x200000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_COMPRESS);
+       LASSERTF(OBD_CONNECT2_UNALIGNED_DIO == 0x400000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_UNALIGNED_DIO);
 
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);