Skip to content

Commit 25ae837

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()
Callers may pass fio parameter with NULL value to f2fs_allocate_data_block(), so we should make sure accessing fio's field after fio's validation check. Fixes: f608c38 ("f2fs: clean up parameter of f2fs_allocate_data_block()") Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent a303b0a commit 25ae837

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/f2fs/segment.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,12 +3417,12 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
34173417
f2fs_inode_chksum_set(sbi, page);
34183418
}
34193419

3420-
if (F2FS_IO_ALIGNED(sbi))
3421-
fio->retry = false;
3422-
34233420
if (fio) {
34243421
struct f2fs_bio_info *io;
34253422

3423+
if (F2FS_IO_ALIGNED(sbi))
3424+
fio->retry = false;
3425+
34263426
INIT_LIST_HEAD(&fio->list);
34273427
fio->in_list = true;
34283428
io = sbi->write_io[fio->type] + fio->temp;

0 commit comments

Comments
 (0)