diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-04-29 09:03:03 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-05-07 10:21:58 +0900 |
commit | 8aa6f1c5bd7043734fff1961a4795da9cc5d0f50 (patch) | |
tree | c2b9ae38929b9511919fabda9429eec05e75d5c2 /fs/f2fs/f2fs.h | |
parent | 817202d937e6cca7e60f42e6495aaa51d70d9d7e (diff) | |
download | linux-8aa6f1c5bd7043734fff1961a4795da9cc5d0f50.tar.gz linux-8aa6f1c5bd7043734fff1961a4795da9cc5d0f50.tar.bz2 linux-8aa6f1c5bd7043734fff1961a4795da9cc5d0f50.zip |
f2fs: fix to truncate inline data in inode page when setattr
Previous we do not truncate inline data in inode page when setattr, so following
case could still read the inline data which has already truncated:
1.write inline data
2.ftruncate size to 0
3.ftruncate size to max inline data size
4.read from offset 0
This patch introduces truncate_inline_data() to fix this problem.
change log from v1:
o fix a bug and do not truncate first page data after truncate inline data.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 2b67679f88b6..676a2c6ccec7 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1410,5 +1410,6 @@ bool f2fs_may_inline(struct inode *); int f2fs_read_inline_data(struct inode *, struct page *); int f2fs_convert_inline_data(struct inode *, pgoff_t); int f2fs_write_inline_data(struct inode *, struct page *, unsigned int); +void truncate_inline_data(struct inode *, u64); int recover_inline_data(struct inode *, struct page *); #endif |