Skip to contentSkip to conversation

f2fs: Fix bad unlock balance detected.

PATCH Changman Lee 1 participant 1 message Jan 29, 2013 1 message not in the archive VFS

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

The blocked means gc can't proceed anymore due to not enough free sections.
Look at the f2fs_gc -> do_garbage_collect -> gc_node_segment and gc_data_segment. Before returning GC_BLOCKED as gc_status, mutex_lock(&sbi->cp_mutex) and blokc_operation(sbi) is called. So unblock_operations should always be called.

Quoted 14 lines · majianpeng

Only !blocked is true,it can call the unblock_operations in func write_checkpoint.

---
 fs/f2fs/checkpoint.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +0 -0
index ff3c843..76308d3 100644
@@ -760,8 +760,10 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool blocked, bool is_umount)
 	/* unlock all the fs_lock[] in do_checkpoint() */
 	do_checkpoint(sbi, is_umount);

fs/f2fs/checkpoint.c void write_checkpoint(struct f2fs_sb_info *sbi, bool blocked, bool is_umount) · line 769

Quoted 10 lines
fs/f2fs/checkpoint.c +4 -2
 
-	unblock_operations(sbi);
-	mutex_unlock(&sbi->cp_mutex);
+	if (!blocked) {
+		unblock_operations(sbi);
+		mutex_unlock(&sbi->cp_mutex);
+	}
 }
 
 void init_orphan_info(struct f2fs_sb_info *sbi)

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html