提交 d5a0d4f7 编写于 作者: E Eric Sandeen 提交者: Theodore Ts'o

ext4: fix ext4_da_write_begin error path

ext4_da_write_begin needs to call journal_stop before returning,
if the page allocation fails.
Signed-off-by: NEric Sandeen <sandeen@redhat.com>
Acked-by: NMingming Cao <cmm@us.ibm.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 e9e34f4e
......@@ -2280,8 +2280,11 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
}
page = __grab_cache_page(mapping, index);
if (!page)
return -ENOMEM;
if (!page) {
ext4_journal_stop(handle);
ret = -ENOMEM;
goto out;
}
*pagep = page;
ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册