Commit 0568c518 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: down i_data_sem only for read when walking tree for fiemap

Not sure why I put this in as down_write originally; all we are
doing is walking the tree, nothing will change under us and
concurrent reads should be no problem.
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 6fd058f7
...@@ -3312,10 +3312,10 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -3312,10 +3312,10 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
* Walk the extent tree gathering extent information. * Walk the extent tree gathering extent information.
* ext4_ext_fiemap_cb will push extents back to user. * ext4_ext_fiemap_cb will push extents back to user.
*/ */
down_write(&EXT4_I(inode)->i_data_sem); down_read(&EXT4_I(inode)->i_data_sem);
error = ext4_ext_walk_space(inode, start_blk, len_blks, error = ext4_ext_walk_space(inode, start_blk, len_blks,
ext4_ext_fiemap_cb, fieinfo); ext4_ext_fiemap_cb, fieinfo);
up_write(&EXT4_I(inode)->i_data_sem); up_read(&EXT4_I(inode)->i_data_sem);
} }
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment