From: Eric Biggers Date: Wed, 29 Nov 2017 20:43:17 +0000 (-0800) Subject: ubifs: switch to fscrypt_prepare_setattr() X-Git-Tag: Ubuntu-5.10.0-12.13~8593^2~6 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=252153ba518ac0bcde6b7152c63380d4415bfe5d;p=mirror_ubuntu-hirsute-kernel.git ubifs: switch to fscrypt_prepare_setattr() Signed-off-by: Eric Biggers Signed-off-by: Richard Weinberger --- 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 */