From 6d68eb9f73a0582ad5c215d210275ca20436f1d0 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 22 Aug 2019 19:52:12 -0400 Subject: [PATCH] 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 --- lustre/ptlrpc/lproc_ptlrpc.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 1.8.3.1