mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
always call inode_change_ok early in ->setattr
Make sure we call inode_change_ok before doing any changes in ->setattr, and make sure to call it even if our fs wants to ignore normal UNIX permissions, but use the ATTR_FORCE to skip those. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
1025774ce4
commit
db78b877f7
6 changed files with 48 additions and 48 deletions
|
|
@ -232,16 +232,16 @@ static int logfs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
struct inode *inode = dentry->d_inode;
|
||||
int err = 0;
|
||||
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (attr->ia_valid & ATTR_SIZE) {
|
||||
err = logfs_truncate(inode, attr->ia_size);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
setattr_copy(inode, attr);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue