]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: fix possible double free in ocfs2_write_begin_nolock
authorXue jiufei <xuejiufei@huawei.com>
Tue, 5 Nov 2013 05:55:08 +0000 (16:55 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:55:08 +0000 (16:55 +1100)
commitc4b8964176905d755df5b739d13f84cffddfe23b
tree4527fee7a621b8244e0f3231046582a7155aa6be
parentfbdd518659bd759db27dfcb0b9f16b601a1ae182
ocfs2: fix possible double free in ocfs2_write_begin_nolock

When ocfs2_write_cluster_by_desc() failed in ocfs2_write_begin_nolock()
because of ENOSPC, it goes to out_quota, freeing data_ac(meta_ac).  Then
it calls ocfs2_try_to_free_truncate_log() to free space.  If enough space
freed, it will try to write again.  Unfortunately, some error happenes
before ocfs2_lock_allocators(), it goes to out and free data_ac(meta_ac)
again.

Signed-off-by: joyce <xuejiufei@huawei.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/aops.c