From: Alexander.Boyko Date: Wed, 25 Sep 2013 09:18:26 +0000 (+0400) Subject: LU-4007 libcfs: fix for removing lcw at lcw_dispatch_main X-Git-Tag: 2.5.51~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=85899bef9dbdbd5b9c2361974ec42f3cc5c3e4a1 LU-4007 libcfs: fix for removing lcw at lcw_dispatch_main lcw_dispatch_main() creates zombies list and moves lcw into it. But removes entry from another list in the zombies loop. Signed-off-by: Alexander Boyko Xyratex-bug-id: MRP-1179 Change-Id: I9daec3d9b3dbbf244a28b829cd724c8ec60c4b6c Reviewed-on: http://review.whamcloud.com/7755 Reviewed-by: Dmitry Eremin Tested-by: Jenkins Reviewed-by: Doug Oucharek Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Liang Zhen Reviewed-by: Isaac Huang --- diff --git a/libcfs/libcfs/watchdog.c b/libcfs/libcfs/watchdog.c index 93802ac..3a97431 100644 --- a/libcfs/libcfs/watchdog.c +++ b/libcfs/libcfs/watchdog.c @@ -281,13 +281,13 @@ static int lcw_dispatch_main(void *data) } spin_unlock_bh(&lcw_pending_timers_lock); - while (!cfs_list_empty(&zombies)) { - lcw = cfs_list_entry(lcw_pending_timers.next, - struct lc_watchdog, lcw_list); - cfs_list_del(&lcw->lcw_list); - LIBCFS_FREE(lcw, sizeof(*lcw)); - } - } + while (!cfs_list_empty(&zombies)) { + lcw = cfs_list_entry(zombies.next, + struct lc_watchdog, lcw_list); + cfs_list_del_init(&lcw->lcw_list); + LIBCFS_FREE(lcw, sizeof(*lcw)); + } + } complete(&lcw_stop_completion);