Skip to content

Commit 0a1e825

Browse files
Chengguang Xutytso
authored andcommitted
ext4: compare old and new mode before setting update_mode flag
If new mode is the same as old mode we don't have to reset inode mode in the rest of the code, so compare old and new mode before setting update_mode flag. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent e647e29 commit 0a1e825

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/ext4/acl.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ ext4_set_acl(struct inode *inode, struct posix_acl *acl, int type)
248248
error = posix_acl_update_mode(inode, &mode, &acl);
249249
if (error)
250250
goto out_stop;
251-
update_mode = 1;
251+
if (mode != inode->i_mode)
252+
update_mode = 1;
252253
}
253254

254255
error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */);

0 commit comments

Comments
 (0)