linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs crypto: zero next free dnode block
@ 2015-05-18 10:00 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2015-05-18 10:00 UTC (permalink / raw)
  To: Jaegeuk Kim, Changman Lee; +Cc: linux-f2fs-devel, linux-kernel

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>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-18 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 10:00 [PATCH] f2fs crypto: zero next free dnode block Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).