summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2013-12-30 09:29:06 +0800
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-01-06 16:42:22 +0900
commit18309aaa41909cfddb93e932b16a7d14ec425c9b (patch)
tree96de141ec3b472824dbda3e6948c4d10d464d70e /fs/f2fs/inline.c
parenta225dca39495f7c18f1210306281c9c41a3454f6 (diff)
f2fs: avoid to left uninitialized data in page when read inline data
Change log from v1: o reduce unneeded memset in __f2fs_convert_inline_data >From 58796be2bd2becbe8d52305210fb2a64e7dd80b6 Mon Sep 17 00:00:00 2001 From: Chao Yu <chao2.yu@samsung.com> Date: Mon, 30 Dec 2013 09:21:33 +0800 Subject: [PATCH] f2fs: avoid to left uninitialized data in page when read inline data We left uninitialized data in the tail of page when we read an inline data page. So let's initialize left part of the page excluding inline data region. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 688305afbc7..89f0c18cd73 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -43,8 +43,7 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
if (IS_ERR(ipage))
return PTR_ERR(ipage);
- zero_user_segment(page, INLINE_DATA_OFFSET,
- INLINE_DATA_OFFSET + MAX_INLINE_DATA);
+ zero_user_segment(page, MAX_INLINE_DATA, PAGE_CACHE_SIZE);
/* Copy the whole inline data block */
src_addr = inline_data_addr(ipage);
@@ -88,7 +87,7 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
return err;
}
- zero_user_segment(page, 0, PAGE_CACHE_SIZE);
+ zero_user_segment(page, MAX_INLINE_DATA, PAGE_CACHE_SIZE);
/* Copy the whole inline data block */
src_addr = inline_data_addr(ipage);