Skip to content

Commit c84c242

Browse files
zangyangyang666Jaegeuk Kim
authored andcommitted
f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages
When f2fs_write_single_data_page fails, f2fs_write_cache_pages will use the last 'submitted' value incorrectly, which will cause 'nwritten' and 'wbc->nr_to_write' calculation errors Signed-off-by: zangyangyang1 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent e53c568 commit c84c242

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

fs/f2fs/compress.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,7 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,
15511551
if (!clear_page_dirty_for_io(cc->rpages[i]))
15521552
goto continue_unlock;
15531553

1554+
submitted = 0;
15541555
ret = f2fs_write_single_data_page(page_folio(cc->rpages[i]),
15551556
&submitted,
15561557
NULL, NULL, wbc, io_type,

fs/f2fs/data.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,6 +3154,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
31543154
continue;
31553155
}
31563156
#endif
3157+
submitted = 0;
31573158
ret = f2fs_write_single_data_page(folio,
31583159
&submitted, &bio, &last_block,
31593160
wbc, io_type, 0, true);

0 commit comments

Comments
 (0)