mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
At several places we modify EXT4_I(inode)->i_flags without holding i_mutex (ext4_do_update_inode, ...). These modifications are racy and we can lose updates to i_flags. So convert handling of i_flags to use bitops which are atomic. https://bugzilla.kernel.org/show_bug.cgi?id=15792 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
24676da469
commit
12e9b89200
13 changed files with 136 additions and 56 deletions
|
@ -66,7 +66,7 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
|
|||
* is smaller than s_maxbytes, which is for extent-mapped files.
|
||||
*/
|
||||
|
||||
if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) {
|
||||
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
|
||||
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
|
||||
size_t length = iov_length(iov, nr_segs);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue