Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5a0d4f7 authored by Eric Sandeen's avatar Eric Sandeen Committed by Theodore Ts'o
Browse files

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: default avatarEric Sandeen <sandeen@redhat.com>
Acked-by: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent e9e34f4e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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,