Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: fix to add missing F2FS_IO_ALIGNED() condition

In f2fs_allocate_data_block(), we will reset fio.retry for IO
alignment feature instead of IO serialization feature.

In addition, spread F2FS_IO_ALIGNED() to check IO alignment
feature status explicitly.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
8223ecc4 9720ee80

+8 -2
+5 -1
fs/f2fs/data.c
··· 294 294 if (test_opt(sbi, LFS) && current->plug) 295 295 blk_finish_plug(current->plug); 296 296 297 + if (F2FS_IO_ALIGNED(sbi)) 298 + goto submit_io; 299 + 297 300 start = bio->bi_iter.bi_size >> F2FS_BLKSIZE_BITS; 298 301 start %= F2FS_IO_SIZE(sbi); 299 302 ··· 610 607 __submit_merged_bio(io); 611 608 alloc_new: 612 609 if (io->bio == NULL) { 613 - if ((fio->type == DATA || fio->type == NODE) && 610 + if (F2FS_IO_ALIGNED(sbi) && 611 + (fio->type == DATA || fio->type == NODE) && 614 612 fio->new_blkaddr & F2FS_IO_SIZE_MASK(sbi)) { 615 613 dec_page_count(sbi, WB_DATA_TYPE(bio_page)); 616 614 fio->retry = true;
+3 -1
fs/f2fs/segment.c
··· 3116 3116 f2fs_inode_chksum_set(sbi, page); 3117 3117 } 3118 3118 3119 + if (F2FS_IO_ALIGNED(sbi)) 3120 + fio->retry = false; 3121 + 3119 3122 if (add_list) { 3120 3123 struct f2fs_bio_info *io; 3121 3124 3122 3125 INIT_LIST_HEAD(&fio->list); 3123 3126 fio->in_list = true; 3124 - fio->retry = false; 3125 3127 io = sbi->write_io[fio->type] + fio->temp; 3126 3128 spin_lock(&io->io_lock); 3127 3129 list_add_tail(&fio->list, &io->io_list);