Whamcloud - gitweb
LU-11986 lnet: Avoid lnet debugfs read/write if ctl_table does not exist 22/34622/2
authorSonia Sharma <sharmaso@whamcloud.com>
Mon, 1 Apr 2019 12:40:27 +0000 (05:40 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 21 Apr 2019 05:47:26 +0000 (05:47 +0000)
commit013dafd857d1c8f045a704c865f99a53b777c5e3
treed128e925c670f6d2b312c8029f0a1d0c5d1f4530
parent0938b17bd93bf6cd702ddecbab790bad3a8ac1fb
LU-11986 lnet: Avoid lnet debugfs read/write if ctl_table does not exist

Running command "lctl get param -n stats" after lnet
is taken down leads to kernel panic because it
tries to read from the file which doesnt exist
anymore.

In lnet_debugfs_read() and lnet_debugfs_write(),
check if struct ctl_table is valid before trying
to read/write to it.

Change-Id: I2450d2f89c2e8a7db793680a4df581282ee46a16
Signed-off-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34622
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/module.c