f2fs crypto: zero next free dnode block

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 <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2015-05-18 18:00:06 +08:00 committed by Jaegeuk Kim
parent cfc4d971df
commit cb5c94cf3a

View File

@ -519,7 +519,7 @@ void discard_next_dnode(struct f2fs_sb_info *sbi, block_t blkaddr)
if (err) { if (err) {
struct page *page = grab_meta_page(sbi, blkaddr); struct page *page = grab_meta_page(sbi, blkaddr);
/* zero-filled page */ memset(page_address(page), 0, F2FS_BLKSIZE);
set_page_dirty(page); set_page_dirty(page);
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
} }