summaryrefslogtreecommitdiff
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-05-23 03:39:45 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2017-05-24 07:11:08 +0300
commitaaebdee8b88225ebe28af2afc60446f9fd7228f9 (patch)
tree5d55185cdfcb8ed05413bf7139df37d2dc6e7f22 /fs/f2fs/file.c
parentb82a6ea6ec39f1b5ef949a38e334eed0dc29f4d1 (diff)
downloadlinux-aaebdee8b88225ebe28af2afc60446f9fd7228f9.tar.xz
f2fs: don't bother checking for encryption key in ->write_iter()
Since only an open file can be written to, and we only allow open()ing an encrypted file when its key is available, there is no need to check for the key again before permitting each ->write_iter(). This code was also broken in that it wouldn't actually have failed if the key was in fact unavailable. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: David Gstir <david@sigma-star.at> Acked-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 30fbb4ce6a73..65915b4ce14b 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2340,11 +2340,6 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
struct blk_plug plug;
ssize_t ret;
- if (f2fs_encrypted_inode(inode) &&
- !fscrypt_has_encryption_key(inode) &&
- fscrypt_get_encryption_info(inode))
- return -EACCES;
-
inode_lock(inode);
ret = generic_write_checks(iocb, from);
if (ret > 0) {