From: Eric Sandeen Date: Sat, 2 Aug 2008 22:51:06 +0000 (-0400) Subject: ext4: fix ext4_da_write_begin error path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d5a0d4f732af3438e592efab4cb80076d1dd81b5;p=linux-beck.git 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: Eric Sandeen Acked-by: Mingming Cao Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index efe8caa3811c..37f834bc7cd6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2280,8 +2280,11 @@ retry: } 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,