Skip to content
Commit ec81c281 authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Jiri Slaby
Browse files

ext4: atomically set inode->i_flags in ext4_set_inode_flags()



commit 5f16f322 upstream.

Use cmpxchg() to atomically set i_flags instead of clearing out the
S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
where an immutable file has the immutable flag cleared for a brief
window of time.

js: there is no change for ext4. This patch defines merely
    inode_set_flags for jffs in the next patch. I wonder why do we
    have both inode_set_flags and set_mask_bits? Looks like an
    improperly resolved merge conflict.

Reported-by: default avatarJohn Sullivan <jsrhbz@kanargh.force9.co.uk>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 692f067f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment