Whamcloud - gitweb
LU-17471 osd-ldiskfs: brw_stats symlink module option 17/56917/3
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 5 Nov 2024 21:01:14 +0000 (14:01 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 9 Dec 2024 06:14:36 +0000 (06:14 +0000)
Add a module option to symlink /proc/fs/lustre/osd-*/*/brw_stats
to /sys/kernel/debug/*/*/brw_stats for backward compatibility
for systems that need this for monitoring tools that depend on the
old /proc pathname instead of always creating it at startup.

Otherwise, "lctl get_param osd-ldiskfs.*.brw_stats" will display
the stats for both the original and symlinked parameter file,
which can confuse other monitoring tools.

To enable the /proc/.../brw_stats symlink, add the following line
into /etc/modprobe.d/lustre.conf before loading modules/mounting:

  options osd_ldiskfs symlink_brw_stats=1

By default the symlink is not created, since newer tools should
be using the /sys/kernel/debug/.../brw_stats parameter file.

Remove sanity test_0f that is verifying the old parameter path,
since it is just too messy to get the interoperability correct.

Test-Parameters: trivial
Fixes: 47ccacd58d ("LU-17471 osd: add symlink for brw_stats")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib61630cf2bc89b84af438c811754a85e403ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56917
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c
lustre/tests/except/sanity.0f.ex [new file with mode: 0644]
lustre/tests/sanity.sh

index 4d3e9c7..b789e87 100644 (file)
@@ -37,6 +37,10 @@ void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf)
 }
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 17, 53, 0)
+static int symlink_brw_stats;
+module_param(symlink_brw_stats, int, 0644);
+MODULE_PARM_DESC(symlink_brw_stats, "create /proc brw_stats symlink");
+
 static void osd_symlink_brw_stats(struct osd_device *osd)
 {
        size_t len_root;
@@ -46,6 +50,9 @@ static void osd_symlink_brw_stats(struct osd_device *osd)
        char *p;
        char *path;
 
+       if (!symlink_brw_stats)
+               return;
+
        OBD_ALLOC(path, PATH_MAX);
        if (path == NULL)
                return;
index 37b091d..d6b6945 100644 (file)
 #include "osd_internal.h"
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 17, 53, 0)
+static int symlink_brw_stats;
+module_param(symlink_brw_stats, int, 0644);
+MODULE_PARM_DESC(symlink_brw_stats, "create /proc brw_stats symlink");
+
 static void osd_symlink_brw_stats(struct osd_device *osd)
 {
        size_t len_root;
@@ -33,6 +37,9 @@ static void osd_symlink_brw_stats(struct osd_device *osd)
        char *p;
        char *path;
 
+       if (!symlink_brw_stats)
+               return;
+
        OBD_ALLOC(path, PATH_MAX);
        if (path == NULL)
                return;
diff --git a/lustre/tests/except/sanity.0f.ex b/lustre/tests/except/sanity.0f.ex
new file mode 100644 (file)
index 0000000..7e15dd7
--- /dev/null
@@ -0,0 +1,2 @@
+#facet op need_version                jira     space_separated_subtests
+mds1   <= 2.14.55-100-g8a84c7f9c7     LU-14927 0f
index 731d0e7..ae0deb6 100755 (executable)
@@ -241,20 +241,6 @@ test_0e() { # LU-13417
 }
 run_test 0e "Enable DNE MDT balancing for mkdir in the ROOT"
 
-test_0f() { # LU-17471
-       (( $MDS1_VERSION < $(version_code 2.17.53) )) ||
-               skip "MDS >= 2.17.53 removes /proc/.../brw_stats symlink"
-       (( $MDS1_VERSION < $(version_code 2.14.55-100-g8a84c7f9c7) ||
-          $MDS1_VERSION > $(version_code 2.15.60-25) )) ||
-               skip "MDS was missing /proc/.../brw_stats value"
-
-       local path="lustre/osd-$FSTYPE/$FSNAME-MDT0000/brw_stats"
-       local out_proc=$(do_facet mds1 grep snapshot_time /proc/fs/$path)
-
-       [[ -n "$out_proc" ]] || error "brw_stats /proc/fs/$path not found"
-}
-run_test 0f "Symlink to /sys/kernel/debug/*/*/brw_stats should work properly"
-
 test_1() {
        test_mkdir $DIR/$tdir
        test_mkdir $DIR/$tdir/d2