Whamcloud - gitweb
LU-18624 zfs: disable compression by default 90/57990/5
authorJames Simmons <jsimmons@infradead.org>
Sat, 8 Feb 2025 01:51:19 +0000 (20:51 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Feb 2025 02:55:12 +0000 (02:55 +0000)
By default ZFS is enabling compression which is causing test
failures for us. It should the administrators choice to use
ZFS with compression turned on or off. Change mount.lustre
zfs backend to handle compression=val mount option. By default
we will turn it off.

For the test suite we can use <facet_type>_FS_MKFS_OPTS to
turn on compression for testing.

Disable lots of conf-sanity test which are broken with ZFS 2.X.

Change-Id: I752c883f6f912a340aa346e1dfb8bf7bdef24939
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57990
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/utils/libmount_utils_zfs.c

index c0585d7..158688d 100755 (executable)
@@ -29,6 +29,13 @@ fi
 #                                     8  22  40 165  (min)
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="45 69 106 111 114"
 
+if [[ "$mds1_FSTYPE" == "zfs" ]]; then
+       always_except LU-18652 32b 32c 32e 32h
+       always_except LU-18652 108a 112a 112b 113 117 119 121 122a
+       always_except LU-18652 123aa 123ab 123ac 123ad 123ae 123af 123ag 123ah 123ahi
+       always_except LU-18652 123F 123G 123H 126 129 132 133 135 136 137 150 152 153a 153b 153c 155 802a
+fi
+
 build_test_filter
 
 # use small MDS + OST size to speed formatting time
index 68a1c8d..4852b1c 100644 (file)
@@ -786,6 +786,7 @@ int zfs_make_lustre(struct mkfs_opts *mop)
         * zfs 0.6.1 - system attribute based xattrs
         * zfs 0.6.5 - large block support
         * zfs 0.7.0 - large dnode support
+        * zfs 2.2.6 - compression handling
         *
         * Check if zhp is NULL as a defensive measure. Any dataset
         * validation errors that would cause zfs_open() to fail
@@ -793,6 +794,8 @@ int zfs_make_lustre(struct mkfs_opts *mop)
         */
        zhp = zfs_open(g_zfs, ds, ZFS_TYPE_FILESYSTEM);
        if (zhp) {
+               char *opt;
+
                /* zfs 0.6.1 - system attribute based xattrs */
                if (!strstr(mop->mo_mkfsopts, "xattr="))
                        zfs_set_prop_str(zhp, "xattr", "sa");
@@ -809,6 +812,24 @@ int zfs_make_lustre(struct mkfs_opts *mop)
                                zfs_set_prop_str(zhp, "recordsize", "1M");
                }
 
+               /* zfs 2.2.6 - compression handling */
+               opt = strstr(mop->mo_mkfsopts, "compression=");
+               if (opt) {
+                       char *end = index(opt, ',');
+                       size_t len = strlen(opt);
+
+                       if (end) {
+                               len = end - opt;
+                               end = strndup(opt, len);
+                       }
+                       zfs_set_prop_str(zhp, "compression", end ? end : opt);
+                       if (end)
+                               free(end);
+               } else {
+                       /* By default turn off compression */
+                       zfs_set_prop_str(zhp, "compression", "off");
+               }
+
                zfs_close(zhp);
        }