On 2018/7/23 22:10, Yunlong Song wrote:
> Without this patch, f2fs only clears victim_secmap when it finds out
> that the section has no valid blocks at all, but forgets to clear the
> victim_secmap when the whole section has full valid blocks.
> 
> Signed-off-by: Yunlong Song <[email protected]>
> ---
>  fs/f2fs/segment.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index cfff7cf..255bff5 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -776,7 +776,9 @@ static void __remove_dirty_segment(struct f2fs_sb_info 
> *sbi, unsigned int segno,
>               if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t]))
>                       dirty_i->nr_dirty[t]--;
>  
> -             if (get_valid_blocks(sbi, segno, true) == 0)
> +             if (get_valid_blocks(sbi, segno, true) == 0 ||
> +                     get_valid_blocks(sbi, segno, true) ==
> +                     (sbi->segs_per_sec << sbi->log_blocks_per_seg))

BLKS_PER_SEC(sbi)?

Thanks,

>                       clear_bit(GET_SEC_FROM_SEG(sbi, segno),
>                                               dirty_i->victim_secmap);
>       }
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to