Now page cache of meta inode is used by garbage collection for encrypted page,
it may contain random data, so we should zero it before issuing discard.

Signed-off-by: Chao Yu <[email protected]>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 16aa66e..bdf874a 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -504,7 +504,7 @@ void discard_next_dnode(struct f2fs_sb_info *sbi, block_t 
blkaddr)
 
        if (err) {
                struct page *page = grab_meta_page(sbi, blkaddr);
-               /* zero-filled page */
+               memset(page_address(page), 0, F2FS_BLKSIZE);
                set_page_dirty(page);
                f2fs_put_page(page, 1);
        }
-- 
2.3.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to