瀏覽代碼

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>
Chao Yu 10 年之前
父節點
當前提交
cb5c94cf3a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/f2fs/segment.c

+ 1 - 1
fs/f2fs/segment.c

@@ -519,7 +519,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);
 	}