ext4: do not ask jbd2 to write data for delalloc buffers
[sfrench/cifs-2.6.git] / fs / ext4 / inode.c
index 8ba46ad06aedb9f8f6c7ee56b2979e541c9ce51c..17bfa42ac97132dff751baace2e73c4c9de3d120 100644 (file)
@@ -695,7 +695,10 @@ out_sem:
                    !(flags & EXT4_GET_BLOCKS_ZERO) &&
                    !IS_NOQUOTA(inode) &&
                    ext4_should_order_data(inode)) {
-                       ret = ext4_jbd2_file_inode(handle, inode);
+                       if (flags & EXT4_GET_BLOCKS_IO_SUBMIT)
+                               ret = ext4_jbd2_inode_add_wait(handle, inode);
+                       else
+                               ret = ext4_jbd2_inode_add_write(handle, inode);
                        if (ret)
                                return ret;
                }
@@ -2319,7 +2322,8 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
         * the data was copied into the page cache.
         */
        get_blocks_flags = EXT4_GET_BLOCKS_CREATE |
-                          EXT4_GET_BLOCKS_METADATA_NOFAIL;
+                          EXT4_GET_BLOCKS_METADATA_NOFAIL |
+                          EXT4_GET_BLOCKS_IO_SUBMIT;
        dioread_nolock = ext4_should_dioread_nolock(inode);
        if (dioread_nolock)
                get_blocks_flags |= EXT4_GET_BLOCKS_IO_CREATE_EXT;
@@ -3634,7 +3638,7 @@ static int __ext4_block_zero_page_range(handle_t *handle,
                err = 0;
                mark_buffer_dirty(bh);
                if (ext4_should_order_data(inode))
-                       err = ext4_jbd2_file_inode(handle, inode);
+                       err = ext4_jbd2_inode_add_write(handle, inode);
        }
 
 unlock: