From: James Simmons Date: Thu, 22 Aug 2019 23:52:12 +0000 (-0400) Subject: LU-12094 ptlrpc: protect obd_import in lprocfs_import_seq_write X-Git-Tag: 2.12.58~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6d68eb9f73a0582ad5c215d210275ca20436f1d0;p=fs%2Flustre-release.git LU-12094 ptlrpc: protect obd_import in lprocfs_import_seq_write The obd_import can disappear so take the cl_sem to protect it. Change-Id: I36f2c4c606a0470781a692631265938848173f8b Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/35853 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 546aa3c..f2d747a 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -1378,6 +1378,8 @@ lprocfs_import_seq_write(struct file *file, const char __user *buffer, if (strncmp(prefix, kbuf, prefix_len) != 0) GOTO(out, count = -EINVAL); + LPROCFS_CLIMP_CHECK(obd); + uuid = kbuf + prefix_len; ptr = strstr(uuid, "::"); if (ptr) { @@ -1403,6 +1405,7 @@ lprocfs_import_seq_write(struct file *file, const char __user *buffer, } } + LPROCFS_CLIMP_EXIT(obd); if (do_reconn) ptlrpc_recover_import(imp, uuid, 1);