]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fix ext3 block bitmap leakage
authorKirill Korotaev <dev@openvz.org>
Mon, 26 Feb 2007 00:48:36 +0000 (01:48 +0100)
committerAdrian Bunk <bunk@stusta.de>
Mon, 26 Feb 2007 00:48:36 +0000 (01:48 +0100)
This patch fixes ext3 block bitmap leakage,
which leads to the following fsck messages on
_healthy_ filesystem:
Block bitmap differences:  -64159 -73707

All kernels up to 2.6.17 have this bug.

Found by
   Vasily Averin <vvs@sw.ru> and Andrey Savochkin <saw@sawoct.com>
Test case triggered the issue was created by
   Dmitry Monakhov <dmonakhov@sw.ru>

Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
fs/ext3/inode.c

index 4fafef3c511fa95b19273299613636b2d4d2317d..ef05ecef0d91088ea72169458acb5e9446deeb67 100644 (file)
@@ -516,6 +516,7 @@ static int ext3_alloc_branch(handle_t *handle, struct inode *inode,
 
        branch[0].key = cpu_to_le32(parent);
        if (parent) {
+               keys = 1;
                for (n = 1; n < num; n++) {
                        struct buffer_head *bh;
                        /* Allocate the next block */