From: Eric Biggers <ebiggers3@gmail.com>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-fscrypt@vger.kernel.org, Eric Biggers <ebiggers@google.com>
Subject: [PATCH v2 5/5] f2fs: switch to fscrypt_prepare_setattr()
Date: Wed, 29 Nov 2017 12:35:32 -0800 [thread overview]
Message-ID: <20171129203532.87729-6-ebiggers3@gmail.com> (raw)
In-Reply-To: <20171129203532.87729-1-ebiggers3@gmail.com>
From: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
fs/f2fs/file.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index ae2cf96190e4..52b8f95b9bee 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -743,6 +743,10 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
if (err)
return err;
+ err = fscrypt_prepare_setattr(dentry, attr);
+ if (err)
+ return err;
+
if (is_quota_modification(inode, attr)) {
err = dquot_initialize(inode);
if (err)
@@ -758,14 +762,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
}
if (attr->ia_valid & ATTR_SIZE) {
- if (f2fs_encrypted_inode(inode)) {
- err = fscrypt_get_encryption_info(inode);
- if (err)
- return err;
- if (!fscrypt_has_encryption_key(inode))
- return -ENOKEY;
- }
-
if (attr->ia_size <= i_size_read(inode)) {
down_write(&F2FS_I(inode)->i_mmap_sem);
truncate_setsize(inode, attr->ia_size);
--
2.15.0.531.g2ccb3012c9-goog
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2017-11-29 20:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 20:35 [PATCH v2 0/5] f2fs: switch to new fscrypt helper functions Eric Biggers
2017-11-29 20:35 ` [PATCH v2 1/5] f2fs: switch to fscrypt_file_open() Eric Biggers
2017-11-29 20:35 ` [PATCH v2 2/5] f2fs: switch to fscrypt_prepare_link() Eric Biggers
2017-11-29 20:35 ` [PATCH v2 3/5] f2fs: switch to fscrypt_prepare_rename() Eric Biggers
2017-11-29 20:35 ` [PATCH v2 4/5] f2fs: switch to fscrypt_prepare_lookup() Eric Biggers
2017-11-29 20:35 ` Eric Biggers [this message]
2017-12-01 7:12 ` [PATCH v2 0/5] f2fs: switch to new fscrypt helper functions Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171129203532.87729-6-ebiggers3@gmail.com \
--to=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).