The patch titled Subject: ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 has been removed from the -mm tree. Its filename was ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2.patch This patch was dropped because it was folded into ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work.patch ------------------------------------------------------ From: Joseph Qi <joseph.qi@xxxxxxxxxx> Subject: ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 Changes since v1: As Mark suggested, we can only add it to loop condition and explain the case with comments instead of BUG. Signed-off-by: Joseph Qi <joseph.qi@xxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/dlmglue.c | 18 ++++++++++++------ fs/ocfs2/ocfs2.h | 1 - fs/ocfs2/super.c | 1 - 3 files changed, 12 insertions(+), 8 deletions(-) diff -puN fs/ocfs2/dlmglue.c~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 fs/ocfs2/dlmglue.c --- a/fs/ocfs2/dlmglue.c~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 +++ a/fs/ocfs2/dlmglue.c @@ -3198,7 +3198,6 @@ void ocfs2_mark_lockres_freeing(struct o spin_lock_irqsave(&osb->dc_task_lock, flags2); list_del_init(&lockres->l_blocked_list); osb->blocked_lock_count--; - osb->blocked_lock_processed--; spin_unlock_irqrestore(&osb->dc_task_lock, flags2); /* * Warn if we recurse into another post_unlock call. Strictly @@ -4016,6 +4015,7 @@ static void ocfs2_schedule_blocked_lock( static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) { + unsigned long processed; unsigned long flags; struct ocfs2_lock_res *lockres; @@ -4024,17 +4024,23 @@ static void ocfs2_downconvert_thread_do_ * wake happens part-way through our work */ osb->dc_work_sequence = osb->dc_wake_sequence; - osb->blocked_lock_processed = osb->blocked_lock_count; - while (osb->blocked_lock_processed) { - BUG_ON(list_empty(&osb->blocked_lock_list)); - + processed = osb->blocked_lock_count; + /* + * blocked lock processing in this loop might call iput which can + * remove items off osb->blocked_lock_list. Downconvert up to + * 'processed' number of locks, but stop short if we had some + * removed in ocfs2_mark_lockres_freeing when downconverting. + */ + while (processed && !list_empty(&osb->blocked_lock_list)) { lockres = list_entry(osb->blocked_lock_list.next, struct ocfs2_lock_res, l_blocked_list); list_del_init(&lockres->l_blocked_list); osb->blocked_lock_count--; - osb->blocked_lock_processed--; spin_unlock_irqrestore(&osb->dc_task_lock, flags); + BUG_ON(!processed); + processed--; + ocfs2_process_blocked_lock(osb, lockres); spin_lock_irqsave(&osb->dc_task_lock, flags); diff -puN fs/ocfs2/ocfs2.h~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 fs/ocfs2/ocfs2.h --- a/fs/ocfs2/ocfs2.h~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 +++ a/fs/ocfs2/ocfs2.h @@ -424,7 +424,6 @@ struct ocfs2_super */ struct list_head blocked_lock_list; unsigned long blocked_lock_count; - unsigned long blocked_lock_processed; /* List of dquot structures to drop last reference to */ struct llist_head dquot_drop_list; diff -puN fs/ocfs2/super.c~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 fs/ocfs2/super.c --- a/fs/ocfs2/super.c~ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work-v2 +++ a/fs/ocfs2/super.c @@ -2089,7 +2089,6 @@ static int ocfs2_initialize_super(struct osb->dc_wake_sequence = 0; INIT_LIST_HEAD(&osb->blocked_lock_list); osb->blocked_lock_count = 0; - osb->blocked_lock_processed = 0; spin_lock_init(&osb->osb_lock); spin_lock_init(&osb->osb_xattr_lock); ocfs2_init_steal_slots(osb); _ Patches currently in -mm which might be from joseph.qi@xxxxxxxxxx are ocfs2-fix-bug-in-ocfs2_downconvert_thread_do_work.patch ocfs2-fix-shift-left-overflow.patch ocfs2-fix-race-between-dio-and-recover-orphan.patch ocfs2-fix-several-issues-of-append-dio.patch ocfs2-do-not-bug-if-buffer-not-uptodate-in-__ocfs2_journal_access.patch ocfs2-clean-up-unused-local-variables-in-ocfs2_file_write_iter.patch ocfs2-adjust-code-to-match-locking-unlocking-order.patch ocfs2-set-filesytem-read-only-when-ocfs2_delete_entry-failed.patch ocfs2-set-filesytem-read-only-when-ocfs2_delete_entry-failed-v2.patch ocfs2-fix-race-between-crashed-dio-and-rm.patch ocfs2-avoid-access-invalid-address-when-read-o2dlm-debug-messages.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html