From: Jaegeuk Kim Date: Sun, 31 Mar 2013 03:59:53 +0000 (+0900) Subject: f2fs: allocate new segment aligned with sections X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=33afa7fde0defbb362328233e600e052d0a22cd5;p=linux-beck.git f2fs: allocate new segment aligned with sections When allocating a new segment under the LFS mode, we should keep the section boundary. Reviewed-by: Namjae Jeon Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 179a13e86f69..b3486f34af78 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -362,7 +362,8 @@ static void get_new_segment(struct f2fs_sb_info *sbi, if (!new_sec && ((*newseg + 1) % sbi->segs_per_sec)) { segno = find_next_zero_bit(free_i->free_segmap, TOTAL_SEGS(sbi), *newseg + 1); - if (segno < TOTAL_SEGS(sbi)) + if (segno - *newseg < sbi->segs_per_sec - + (*newseg % sbi->segs_per_sec)) goto got_it; } find_other_zone: