@@ -97,7 +97,7 @@ static int ext4_ext_trunc_restart_fn(struct inode *inode, int *dropped)
9797 * Drop i_data_sem to avoid deadlock with ext4_map_blocks. At this
9898 * moment, get_block can be called only for blocks inside i_size since
9999 * page cache has been already dropped and writes are blocked by
100- * i_mutex . So we can safely drop the i_data_sem here.
100+ * i_rwsem . So we can safely drop the i_data_sem here.
101101 */
102102 BUG_ON (EXT4_JOURNAL (inode ) == NULL );
103103 ext4_discard_preallocations (inode , 0 );
@@ -4574,7 +4574,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,
45744574
45754575 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT ;
45764576
4577- /* Wait all existing dio workers, newcomers will block on i_mutex */
4577+ /* Wait all existing dio workers, newcomers will block on i_rwsem */
45784578 inode_dio_wait (inode );
45794579
45804580 /* Preallocate the range including the unaligned edges */
@@ -4740,7 +4740,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
47404740 goto out ;
47414741 }
47424742
4743- /* Wait all existing dio workers, newcomers will block on i_mutex */
4743+ /* Wait all existing dio workers, newcomers will block on i_rwsem */
47444744 inode_dio_wait (inode );
47454745
47464746 ret = ext4_alloc_file_blocks (file , lblk , max_blocks , new_size , flags );
@@ -5573,7 +5573,7 @@ static int ext4_insert_range(struct inode *inode, loff_t offset, loff_t len)
55735573 * stuff such as page-cache locking consistency, bh mapping consistency or
55745574 * extent's data copying must be performed by caller.
55755575 * Locking:
5576- * i_mutex is held for both inodes
5576+ * i_rwsem is held for both inodes
55775577 * i_data_sem is locked for write for both inodes
55785578 * Assumptions:
55795579 * All pages from requested range are locked for both inodes
0 commit comments