mirror of
https://github.com/torvalds/linux
synced 2024-10-07 20:05:15 +00:00
ubifs: switch to fscrypt_prepare_setattr()
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
a0b3ccd963
commit
252153ba51
|
@ -1284,13 +1284,9 @@ int ubifs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (ubifs_crypt_is_encrypted(inode) && (attr->ia_valid & ATTR_SIZE)) {
|
err = fscrypt_prepare_setattr(dentry, attr);
|
||||||
err = fscrypt_get_encryption_info(inode);
|
if (err)
|
||||||
if (err)
|
return err;
|
||||||
return err;
|
|
||||||
if (!fscrypt_has_encryption_key(inode))
|
|
||||||
return -ENOKEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size < inode->i_size)
|
if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size < inode->i_size)
|
||||||
/* Truncation to a smaller size */
|
/* Truncation to a smaller size */
|
||||||
|
|
Loading…
Reference in a new issue