[<prev] [next>] [day] [month] [year] [list]
Message-id: <000401cf0503$0d122f10$27368d30$@samsung.com>
Date: Mon, 30 Dec 2013 10:00:43 +0800
From: Chao Yu <chao2.yu@...sung.com>
To: ??? <jaegeuk.kim@...sung.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Subject: [f2fs-dev] [PATCH] f2fs: avoid to read inline data except first page
Here is a case which could read inline page data not from first page.
1. write inline data
2. lseek to offset 4096
3. read 4096 bytes from offset 4096
(read_inline_data read inline data page to non-first page,
And previously VFS has add this page to page cache)
4. ftruncate offset 8192
5. read 4096 bytes from offset 4096
(we meet this updated page with inline data in cache)
So we should leave this page with inited data and uptodate flag
for this case.
Signed-off-by: Chao Yu <chao2.yu@...sung.com>
---
fs/f2fs/inline.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 33a07e1..4796037 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -44,6 +44,12 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
struct page *ipage;
void *src_addr, *dst_addr;
+ if (page->index) {
+ zero_user_segment(page, 0, PAGE_CACHE_SIZE);
+ SetPageUptodate(page);
+ return 0;
+ }
+
ipage = get_node_page(sbi, inode->i_ino);
if (IS_ERR(ipage))
return PTR_ERR(ipage);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists