|
@@ -218,15 +218,22 @@ int
|
|
|
ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
|
|
|
{
|
|
|
int error;
|
|
|
+ int update_mode = 0;
|
|
|
+ umode_t mode = inode->i_mode;
|
|
|
|
|
|
if (type == ACL_TYPE_ACCESS && acl) {
|
|
|
- error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
|
|
|
+ error = posix_acl_update_mode(inode, &mode, &acl);
|
|
|
if (error)
|
|
|
return error;
|
|
|
+ update_mode = 1;
|
|
|
+ }
|
|
|
+ error = __ext2_set_acl(inode, acl, type);
|
|
|
+ if (!error && update_mode) {
|
|
|
+ inode->i_mode = mode;
|
|
|
inode->i_ctime = current_time(inode);
|
|
|
mark_inode_dirty(inode);
|
|
|
}
|
|
|
- return __ext2_set_acl(inode, acl, type);
|
|
|
+ return error;
|
|
|
}
|
|
|
|
|
|
/*
|