]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters
authorZongxun Wang <wangzongxun@huawei.com>
Mon, 16 Dec 2013 23:44:54 +0000 (10:44 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 16 Dec 2013 23:44:54 +0000 (10:44 +1100)
commit4cc6603febd9986f81ed7c2806a9e94146fdfc72
tree0a4fde91351717f3d668f34672908d30b064d485
parentd81d4312216e32360952d8c521c6261f42e07262
ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters

Even if using the same jbd2 handle, we cannot rollback a transaction.  So
once some error occurs after successfully allocating clusters, the
allocated clusters will never be used and it means they are lost.  For
example, call ocfs2_claim_clusters successfully when expanding a file, but
failed in ocfs2_insert_extent.  So we need free the allocated clusters if
they are not used indeed.

Signed-off-by: Zongxun Wang <wangzongxun@huawei.com>
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/alloc.c
fs/ocfs2/localalloc.c
fs/ocfs2/localalloc.h