[PATCH] ubifs: atomically set inode->i_flags in ubifs_set_inode_flags()

Artem Bityutskiy dedekind1 at gmail.com
Tue Apr 15 06:31:13 PDT 2014


On Tue, 2014-04-15 at 14:15 +0800, Zhang Zhen wrote:
> Use set_mask_bits() to atomically set i_flags instead of clearing out the
> S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
> UBIFS_IMMUTABLE, UBIFS_APPEND_FL, etc. flags, since this opens up a race
> where an immutable file has the immutable flag cleared for a brief
> window of time.
> 
> Signed-off-by: Zhang Zhen <zhenzhang.zhang at huawei.com>

Looks correct to me. Does it fix a real-life bug or just a hypothetical
issue? Also, did you test it?

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list