Yunlei He fe94793e55 f2fs: get victim segment again after new cp
Previous selected segment may become free after write_checkpoint,
if we do garbage collect on this segment, and then new_curseg happen
to reuse it, it may cause f2fs_bug_on as below.

	panic+0x154/0x29c
	do_garbage_collect+0x15c/0xaf4
	f2fs_gc+0x2dc/0x444
	f2fs_balance_fs.part.22+0xcc/0x14c
	f2fs_balance_fs+0x28/0x34
	f2fs_map_blocks+0x5ec/0x790
	f2fs_preallocate_blocks+0xe0/0x100
	f2fs_file_write_iter+0x64/0x11c
	new_sync_write+0xac/0x11c
	vfs_write+0x144/0x1e4
	SyS_write+0x60/0xc0

Here, maybe we check sit and ssa type during reset_curseg. So, we check
segment is stale or not, and select a new victim to avoid this.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2016-07-22 11:55:31 -07:00
..
2016-01-20 17:09:18 -08:00
2016-05-27 15:26:11 -07:00
2016-05-20 17:58:30 -07:00
2016-05-23 17:04:14 -07:00
2016-05-23 17:04:14 -07:00
2016-04-26 12:00:48 -04:00
2016-01-22 18:04:28 -05:00
2016-05-23 17:04:14 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-05-26 19:34:26 -07:00
2016-05-26 20:00:28 -07:00
2016-01-22 18:04:28 -05:00
2016-05-23 17:04:14 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-04-18 11:18:55 +02:00
2016-01-22 18:04:28 -05:00