summaryrefslogtreecommitdiff
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2014-07-28 06:28:15 +0400
committerTheodore Ts'o <tytso@mit.edu>2014-07-28 06:28:15 +0400
commit4b1f1660710c2ddcefc08c289e66a32b6bc2a2e3 (patch)
tree915f9288771445a975f5253c6f95fa60d5f11b72 /fs/ext4/extents.c
parentb27b1535acc0e97b7435bccf205b3fe9c782afac (diff)
downloadlinux-4b1f1660710c2ddcefc08c289e66a32b6bc2a2e3.tar.xz
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>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b30172dd55eb..ee93f82630c6 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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 */