Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753216AbbERKBM (ORCPT ); Mon, 18 May 2015 06:01:12 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:49536 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbbERKBI (ORCPT ); Mon, 18 May 2015 06:01:08 -0400 X-AuditID: cbfee61a-f79516d000006302-84-5559b8567777 From: Chao Yu To: Jaegeuk Kim , Changman Lee Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs crypto: zero next free dnode block Date: Mon, 18 May 2015 18:00:06 +0800 Message-id: <003101d09151$85408140$8fc183c0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdCRUHJMhFAPRH1xSwq9l+4UG7oVgg== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t9jAd2wHZGhBo/+mVtc29fIZPFk/Sxm i0uL3C0u75rD5sDisWlVJ5vH7gWfmTz6tqxi9Pi8SS6AJYrLJiU1J7MstUjfLoEro//6ZsaC G6wVP0/6NzCeZ+li5OSQEDCRmNs4hRXCFpO4cG89WxcjF4eQwCJGiQVf1rFCOK8YJaa+38wE UsUmoCKxvOM/mC0i4CUxaf8JsEnMAh4SjR3fwSYJC1hI3F3ZxghiswioSjycfBAszitgKbHn wgM2CFtQ4sfke1C9WhLrdx5ngrDlJTavecsMcZGCxI6zrxkhdulJrDnQww5RIy6x8cgtlgmM ArOQjJqFZNQsJKNmIWlZwMiyilE0tSC5oDgpPddQrzgxt7g0L10vOT93EyM4pJ9J7WBc2WBx iFGAg1GJh9fiTUSoEGtiWXFl7iFGCQ5mJRHeVZsjQ4V4UxIrq1KL8uOLSnNSiw8xSnOwKInz nsz3CRUSSE8sSc1OTS1ILYLJMnFwSjUwrkie46P796i54zuRfybbX91vu8uXK8TeWx2nWlH1 4nDuQoP/q7iT8qriOmzsKt8XrvNgusG4+WGxkFSn9tbv6yeE8tXeVlD1eRDcoiFxNN6nV8B/ nvby3tzjgrP+725Zd9T92pEHOooZ2+feVQ7rSZfQMJ/8183p0V1Lvk7X2fs1WG1apv5XYinO SDTUYi4qTgQAZbZJtWUCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 30 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 --- 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/