mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
f2fs: fix to use correct segment type in f2fs_allocate_data_block()
@type in f2fs_allocate_data_block() indicates log header's type, it
can be CURSEG_COLD_DATA_PINNED or CURSEG_ALL_DATA_ATGC, rather than
type of data/node, however IS_DATASEG()/IS_NODESEG() only accept later
one, fix it.
Fixes: 093749e296 ("f2fs: support age threshold based garbage collection")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
9ddabae70a
commit
7324858237
|
|
@ -3540,12 +3540,12 @@ int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
|||
locate_dirty_segment(sbi, GET_SEGNO(sbi, old_blkaddr));
|
||||
locate_dirty_segment(sbi, GET_SEGNO(sbi, *new_blkaddr));
|
||||
|
||||
if (IS_DATASEG(type))
|
||||
if (IS_DATASEG(curseg->seg_type))
|
||||
atomic64_inc(&sbi->allocated_data_blocks);
|
||||
|
||||
up_write(&sit_i->sentry_lock);
|
||||
|
||||
if (page && IS_NODESEG(type)) {
|
||||
if (page && IS_NODESEG(curseg->seg_type)) {
|
||||
fill_node_footer_blkaddr(page, NEXT_FREE_BLKADDR(sbi, curseg));
|
||||
|
||||
f2fs_inode_chksum_set(sbi, page);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user