ocfs2/dlm: fix misuse of list_move_tail() in dlm_run_purge_list()
authorXue jiufei <xuejiufei@huawei.com>
Mon, 23 Jun 2014 20:22:08 +0000 (13:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Jun 2014 23:47:45 +0000 (16:47 -0700)
When a lockres in purge list but is still in use, it should be moved to
the tail of purge list.  dlm_thread will continue to check next lockres in
purge list.  However, code list_move_tail(&dlm->purge_list,
&lockres->purge) will do *no* movements, so dlm_thread will purge the same
lockres in this loop again and again.  If it is in use for a long time,
other lockres will not be processed.

Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/dlm/dlmthread.c

index 9db869de829d0ebcf35ff598c3ee4b7541934f26..cf53a822f07fbc908b1afcfd3c0ee22fb328fb85 100644 (file)
@@ -264,7 +264,7 @@ static void dlm_run_purge_list(struct dlm_ctxt *dlm,
                             "used %d, state %d\n", dlm->name,
                             lockres->lockname.len, lockres->lockname.name,
                             !unused, lockres->state);
-                       list_move_tail(&dlm->purge_list, &lockres->purge);
+                       list_move_tail(&lockres->purge, &dlm->purge_list);
                        spin_unlock(&lockres->spinlock);
                        continue;
                }