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:
committed by
Theodore Ts'o
parent
24676da469
commit
12e9b89200
@@ -977,11 +977,11 @@ mext_check_arguments(struct inode *orig_inode,
|
||||
}
|
||||
|
||||
/* Ext4 move extent supports only extent based file */
|
||||
if (!(EXT4_I(orig_inode)->i_flags & EXT4_EXTENTS_FL)) {
|
||||
if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) {
|
||||
ext4_debug("ext4 move extent: orig file is not extents "
|
||||
"based file [ino:orig %lu]\n", orig_inode->i_ino);
|
||||
return -EOPNOTSUPP;
|
||||
} else if (!(EXT4_I(donor_inode)->i_flags & EXT4_EXTENTS_FL)) {
|
||||
} else if (!(ext4_test_inode_flag(donor_inode, EXT4_INODE_EXTENTS))) {
|
||||
ext4_debug("ext4 move extent: donor file is not extents "
|
||||
"based file [ino:donor %lu]\n", donor_inode->i_ino);
|
||||
return -EOPNOTSUPP;
|
||||
|
Reference in New Issue
Block a user