Skip to content

Commit

Permalink
ext4: compare old and new mode before setting update_mode flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chengguang Xu authored and Theodore Ts'o committed Dec 10, 2018
1 parent e647e29 commit 0a1e825
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ext4/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ ext4_set_acl(struct inode *inode, struct posix_acl *acl, int type)
error = posix_acl_update_mode(inode, &mode, &acl);
if (error)
goto out_stop;
update_mode = 1;
if (mode != inode->i_mode)
update_mode = 1;
}

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

0 comments on commit 0a1e825

Please sign in to comment.