f2fs: fix wrong alloc_type in f2fs_do_replace_block
PATCH 1/1 f2fs: fix wrong alloc_type in f2fs_do_replace_block
If the alloc_type of the original curseg is LFS,
when we change_curseg and then do recover curseg,
the alloc_type becomes SSR.
Signed-off-by Wang Xiaojun <[email protected]>
--- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+)
fs/f2fs/segment.c +3 -0
@@ -3539,6 +3539,7 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,struct seg_entry *se;int type;unsigned short old_blkoff; +unsigned char old_alloc_type; segno =GET_SEGNO (sbi, new_blkaddr); se =get_seg_entry (sbi, segno);
@@ -3572,6 +3573,7 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, old_cursegno = curseg->segno; old_blkoff = curseg->next_blkoff; + old_alloc_type = curseg->alloc_type;/* change the current segment */ if (segno != curseg->segno) {
@@ -3606,6 +3608,7 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,change_curseg (sbi, type, true); } curseg->next_blkoff = old_blkoff; + curseg->alloc_type = old_alloc_type; }up_write (&sit_i->sentry_lock);
Signature · 8 lines
2.25.4 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 5 lines · Wang Xiaojun
If the
alloc_typeof the original curseg is LFS,
when wechange_cursegand then do recover curseg,
thealloc_typebecomes SSR.Signed-off-by Wang Xiaojun <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel