diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b32fc7e45ba1..f1bcf89e1ae6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1215,6 +1215,13 @@ retry_grab: page = grab_cache_page_write_begin(mapping, index, flags); if (!page) return -ENOMEM; + /* + * The same as page allocation, we prealloc buffer heads before + * starting the handle. + */ + if (!page_has_buffers(page)) + create_empty_buffers(page, inode->i_sb->s_blocksize, 0); + unlock_page(page); retry_journal: