From: Hiroya Nozaki Date: Mon, 22 Jul 2013 16:06:48 +0000 (+0800) Subject: staging/lustre/ptlrpc: Race between start and stop service threads X-Git-Tag: v3.12-rc1~183^2~760 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be8e0702619eb3e77ec41c3b8825d0bbdfd8cda;p=pandora-kernel.git staging/lustre/ptlrpc: Race between start and stop service threads When ptlrpc_start_thread fails to create a new thread, it will finalize and free a struct ptlrpc_thread created and used here. Considering this, it can be a problem when ptlrpc_svcpt_stop_thread is driven and handles the struct ptlrpc_thread right after or right before failure of cfs_create_thread. Because this situation let the both of ptlrpc_start_thread and ptlrpc_svcpt_stop_threads access the freed ptlrpc_thread and cause OS panic. Or, it may happen that ptlrpc_svcpt_stop_threads waits forever holding an already-freed waitq. This patch adds an error handling into ptlrpc_start_thread to fix this problem. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2889 Lustre-change: http://review.whamcloud.com/5552 Signed-off-by: Hiroya Nozaki Reviewed-by: Liang Zhen Reviewed-by: Nikitas Angelinas Reviewed-by: Keith Mannthey Reviewed-by: Oleg Drokin Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed