From 61138e82b52b19ab2a73398c2a238410ed559198 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 29 Jun 2021 13:14:39 -0400 Subject: [PATCH 1/1] LU-14786 lod: create missing debugfs file While cleaning up debugfs symlinks the needed, but unused lod debugfs directory was dropped. This results in the broken symlink /sys/kernel/debug/lustre/lov/lustre-MDT0000-mdtlov lctl params handling didn't see this due to glob returning only valid directory entries so the error didn't get reported by stat(). Restore the debugfs directory and add a new test to conf-sanity to detect any potential breakage in the future. Change-Id: I8fe0732d6caeeb83554833205998e24214343f88 Test-Parameters: env=ONLY=10a testlist=conf-sanity Fixes: 462d476d ("LU-8066 obd: cleanup server sysfs symlinks handling") Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/44113 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/lod/lproc_lod.c | 3 +++ lustre/tests/conf-sanity.sh | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c index c89692d..3e72da6 100644 --- a/lustre/lod/lproc_lod.c +++ b/lustre/lod/lproc_lod.c @@ -1131,6 +1131,9 @@ int lod_procfs_init(struct lod_device *lod) obd->obd_name); kobject_put(lov); + obd->obd_debugfs_entry = debugfs_create_dir(obd->obd_name, + obd->obd_type->typ_debugfs_entry); + lod->lod_debugfs = ldebugfs_add_symlink(obd->obd_name, "lov", "../lod/%s", obd->obd_name); if (!lod->lod_debugfs) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index ed38515..48d84a8 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -596,6 +596,27 @@ test_9() { } run_test 9 "test ptldebug and subsystem for mkfs" +test_10a() { + setup + + if ! combined_mgs_mds; then + files=$(do_facet mgs "find /{proc/fs,sys/fs,sys/kernel/debug}/lustre -type l -exec test ! -e {} \; -print") + [ -z $files ] || echo "MGS $files is a broken symlink" + fi + + files=$(do_facet mds1 "find /{proc/fs,sys/fs,sys/kernel/debug}/lustre -type l -exec test ! -e {} \; -print") + [ -z $files ] || echo "MDS $files is a broken symlink" + + files=$(do_facet ost1 "find /{proc/fs,sys/fs,sys/kernel/debug}/lustre -type l -exec test ! -e {} \; -print") + [ -z $files ] || echo "OSS $files is a broken symlink" + + files=$(do_facet client "find /{proc/fs,sys/fs,sys/kernel/debug}/lustre -type l -exec test ! -e {} \; -print") + [ -z $files ] || echo "clients $files is a broken symlink" + + cleanup || error "cleanup failed with rc $?" +} +run_test 10a "find lctl param broken symlinks" + # # Test 16 was to "verify that lustre will correct the mode of OBJECTS". # But with new MDS stack we don't care about the mode of local objects -- 1.8.3.1