lkml.org 
[lkml]   [2016]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] f2fs: fix to clear private data in page
Date
From: Chao Yu <yuchao0@huawei.com>

Private data in page should be removed during ->releasepage or
->invalidatepage, otherwise garbage data would be remained in that page.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fs/f2fs/data.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 38ce5d6..888f178 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1723,6 +1723,7 @@ void f2fs_invalidate_page(struct page *page, unsigned int
offset,
if (IS_ATOMIC_WRITTEN_PAGE(page))
return;

+ set_page_private(page, 0);
ClearPagePrivate(page);
}

@@ -1736,6 +1737,7 @@ int f2fs_release_page(struct page *page, gfp_t wait)
if (IS_ATOMIC_WRITTEN_PAGE(page))
return 0;

+ set_page_private(page, 0);
ClearPagePrivate(page);
return 1;
}
--
2.7.2
\
 
 \ /
  Last update: 2016-04-28 17:41    [W:0.077 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site