Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chengguang Xu and committed by
Theodore Ts'o
0a1e8258 e647e291

+2 -1
+2 -1
fs/ext4/acl.c
··· 248 248 error = posix_acl_update_mode(inode, &mode, &acl); 249 249 if (error) 250 250 goto out_stop; 251 - update_mode = 1; 251 + if (mode != inode->i_mode) 252 + update_mode = 1; 252 253 } 253 254 254 255 error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */);