ext4: add i_data_sem sanity check
Each caller of ext4_ext_dirty must hold i_data_sem, The only exception is migration code, let's make it convenient. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
This commit is contained in:

committed by
Theodore Ts'o

parent
b27b1535ac
commit
4b1f166071
@@ -161,6 +161,8 @@ int __ext4_ext_dirty(const char *where, unsigned int line, handle_t *handle,
|
||||
struct inode *inode, struct ext4_ext_path *path)
|
||||
{
|
||||
int err;
|
||||
|
||||
WARN_ON(!rwsem_is_locked(&EXT4_I(inode)->i_data_sem));
|
||||
if (path->p_bh) {
|
||||
ext4_extent_block_csum_set(inode, ext_block_hdr(path->p_bh));
|
||||
/* path points to block */
|
||||
|
Reference in New Issue
Block a user