Whamcloud - gitweb
LU-13805 obd: Reserve unaligned DIO connect flag
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 9 Aug 2023 16:16:25 +0000 (12:16 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 3 Mar 2024 10:23:53 +0000 (10:23 +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.

Lustre-commit: https://review.whamcloud.com/51075
Lustre-change: 4c96cbf89dba5e4bf8ddf98a18b72142c22a4289

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I8b149cc54f4fb11e64182c65f2fbb01f8a3d3868
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53708
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@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 464b7c8..7c48041 100644 (file)
@@ -520,6 +520,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 96f1cba..32a044a 100644 (file)
@@ -872,6 +872,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 97a2bd0..43cbcd1 100644 (file)
@@ -683,6 +683,7 @@ static const char *const obd_connect_names[] = {
        "replay_create",                /* 0x80000000 */
        "large_nid",                    /* 0x100000000 */
        "compressed_file",              /* 0x200000000 */
+       "unaligned_dio",                /* 0x400000000 */
        NULL
 };
 
index 11a99f0..31d1e26 100644 (file)
@@ -1465,6 +1465,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 48e070f..642b0cc 100644 (file)
@@ -686,6 +686,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 18126a3..06bfee2 100644 (file)
@@ -1501,6 +1501,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);