From: Chao Yu Date: Mon, 15 Sep 2014 10:05:44 +0000 (+0800) Subject: f2fs: fix to search whole dirty segmap when get_victim X-Git-Tag: fixes-for-v3.18-merge-window~8^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=210f41bc048263d572515e1e0edc28d362ce673e;p=pandora-kernel.git f2fs: fix to search whole dirty segmap when get_victim In ->get_victim we get max_search value from dirty_i->nr_dirty without protection of seglist_lock, after that, nr_dirty can be increased/decreased before we hold seglist_lock lock. Then in main loop we attempt to traverse all dirty section one time to find victim section, but it's not accurate to use max_search as the total loop count, because we might lose checking several sections or check sections redundantly for the case of nr_dirty are increased or decreased previously. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- Reading git-diff-tree failed