Skip to content

Commit 540d34c

Browse files
Yongpeng YangJaegeuk Kim
authored andcommitted
f2fs: avoid unnecessary block mapping lookups in f2fs_read_data_large_folio
In the second call to f2fs_map_blocks within f2fs_read_data_large_folio, map.m_len exceeds the logical address space to be read. This patch ensures map.m_len does not exceed the required address space. Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 93ffb6c commit 540d34c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/f2fs/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ static int f2fs_read_data_large_folio(struct inode *inode,
24682468
ffs = NULL;
24692469
nrpages = folio_nr_pages(folio);
24702470

2471-
for (; nrpages; nrpages--) {
2471+
for (; nrpages; nrpages--, max_nr_pages--) {
24722472
sector_t block_nr;
24732473
/*
24742474
* Map blocks using the previous result first.

0 commit comments

Comments
 (0)