ocfs2: fix BUG in ocfs2_downconvert_thread_do_work()
authorJoseph Qi <joseph.qi@huawei.com>
Thu, 6 Aug 2015 22:46:23 +0000 (15:46 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:09:46 +0000 (13:09 +0000)
commita39b992834774fb13b4665c754a5b77a38703d10
tree7c8b096925f1142ee5b10e4f9cb1715c9d7bf2fe
parent4e915c0d3eae53d2aa75b47b24310323d2e07a53
ocfs2: fix BUG in ocfs2_downconvert_thread_do_work()

commit 209f7512d007980fd111a74a064d70a3656079cf upstream.

The "BUG_ON(list_empty(&osb->blocked_lock_list))" in
ocfs2_downconvert_thread_do_work can be triggered in the following case:

ocfs2dc has firstly saved osb->blocked_lock_count to local varibale
processed, and then processes the dentry lockres.  During the dentry
put, it calls iput and then deletes rw, inode and open lockres from
blocked list in ocfs2_mark_lockres_freeing.  And this causes the
variable `processed' to not reflect the number of blocked lockres to be
processed, which triggers the BUG.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ocfs2/dlmglue.c