Messages in this thread Patch in this message | | | From | Jaegeuk Kim <> | Subject | [PATCH 2/6] f2fs crypto: not support fcollapse for encrypted inode | Date | Tue, 12 May 2015 17:40:30 -0700 |
| |
The fcollapse replaces block addresses without IOs, but this violates encryption rule in which each block is encrypted with its block offset.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 57f9a02..c4f9c08 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1081,6 +1081,9 @@ static long f2fs_fallocate(struct file *file, int mode, struct inode *inode = file_inode(file); long ret = 0; + if (f2fs_encrypted_inode(inode) && (mode & FALLOC_FL_COLLAPSE_RANGE)) + return -EOPNOTSUPP; + if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE)) return -EOPNOTSUPP; -- 2.1.1
| |