]> git.baikalelectronics.ru Git - kernel.git/commit
nilfs2: use inode_set_flags() in nilfs_set_inode_flags()
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Thu, 16 Apr 2015 19:46:50 +0000 (12:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Apr 2015 13:04:04 +0000 (09:04 -0400)
commite6164388a1ae324d5ec152a9e2d21a6b5ab35095
tree20d2aac1037c83c46e62e6d6bca4393a019780f6
parenta5983ff05d8e18aaf9f840ee4e3eb3072cf62bab
nilfs2: use inode_set_flags() in nilfs_set_inode_flags()

Use inode_set_flags() to atomically set i_flags instead of clearing out
the S_IMMUTABLE, S_APPEND, etc.  flags and then setting them from the
FS_IMMUTABLE_FL, FS_APPEND_FL flags to avoid a race where an immutable
file has the immutable flag cleared for a brief window of time.

This is a similar fix to commit 67d6c2a25f2d ("ext4: atomically set
inode->i_flags in ext4_set_inode_flags()").

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nilfs2/inode.c