diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index d15e122b470c..80b8500fa987 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1231,7 +1231,7 @@ static int ra_data_block(struct inode *inode, pgoff_t index) .encrypted_page = NULL, .in_list = 0, }; - int err; + int err = 0; folio = f2fs_grab_cache_folio(mapping, index, true); if (IS_ERR(folio)) @@ -1284,6 +1284,9 @@ static int ra_data_block(struct inode *inode, pgoff_t index) fio.encrypted_page = &efolio->page; + if (folio_test_uptodate(efolio)) + goto put_encrypted_page; + err = f2fs_submit_page_bio(&fio); if (err) goto put_encrypted_page;