diff options
author | Eric Biggers <ebiggers@google.com> | 2017-11-29 12:43:17 -0800 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-01-17 21:48:05 +0100 |
commit | 252153ba518ac0bcde6b7152c63380d4415bfe5d (patch) | |
tree | 87d6f03684c1a169a9e07b88685f5b74cca74f73 /fs/ubifs | |
parent | a0b3ccd9636014664e5dec80a86ef624399c105c (diff) | |
download | linux-252153ba518ac0bcde6b7152c63380d4415bfe5d.tar.bz2 |
ubifs: switch to fscrypt_prepare_setattr()
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/file.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 3a3cdafaab45..9fe194a4fa9b 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1284,13 +1284,9 @@ int ubifs_setattr(struct dentry *dentry, struct iattr *attr) if (err) return err; - if (ubifs_crypt_is_encrypted(inode) && (attr->ia_valid & ATTR_SIZE)) { - err = fscrypt_get_encryption_info(inode); - if (err) - return err; - if (!fscrypt_has_encryption_key(inode)) - return -ENOKEY; - } + err = fscrypt_prepare_setattr(dentry, attr); + if (err) + return err; if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size < inode->i_size) /* Truncation to a smaller size */ |