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>
}
#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;
char *p;
char *path;
+ if (!symlink_brw_stats)
+ return;
+
OBD_ALLOC(path, PATH_MAX);
if (path == NULL)
return;
#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;
char *p;
char *path;
+ if (!symlink_brw_stats)
+ return;
+
OBD_ALLOC(path, PATH_MAX);
if (path == NULL)
return;
--- /dev/null
+#facet op need_version jira space_separated_subtests
+mds1 <= 2.14.55-100-g8a84c7f9c7 LU-14927 0f
}
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