Whamcloud - gitweb
LU-14786 lod: create missing debugfs file 13/44113/3
authorJames Simmons <jsimmons@infradead.org>
Tue, 29 Jun 2021 17:14:39 +0000 (13:14 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Jul 2021 18:47:27 +0000 (18:47 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/44113
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lproc_lod.c
lustre/tests/conf-sanity.sh

index c89692d..3e72da6 100644 (file)
@@ -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)
index ed38515..48d84a8 100644 (file)
@@ -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