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)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Oct 2015 02:46:02 +0000 (03:46 +0100)
commit931a9653b9dd309f0dcdfaceff259316e5515e72
tree022c3ce470b510aaf9c267d3ff2def9f9582a602
parenta7c4bf9e8f7f847d7a5b33c40efde8541d652c41
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: Ben Hutchings <ben@decadent.org.uk>
fs/ocfs2/dlmglue.c