From: Yongpeng Yang <[email protected]>

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 <[email protected]>
---
 fs/f2fs/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index f32eb51ccee4..40c32267ead9 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2456,7 +2456,7 @@ static int f2fs_read_data_large_folio(struct inode *inode,
        ffs = NULL;
        nrpages = folio_nr_pages(folio);
 
-       for (; nrpages; nrpages--) {
+       for (; nrpages; nrpages--, max_nr_pages--) {
                sector_t block_nr;
                /*
                 * Map blocks using the previous result first.
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to