OSDN Git Service

[PATCH] EXT3: ext3 block bitmap leakage
authorKirill Korotaev <dev@openvz.org>
Fri, 30 Jun 2006 09:41:05 +0000 (13:41 +0400)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Jul 2006 05:29:09 +0000 (07:29 +0200)
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: Vasiliy Averin <vvs@sw.ru>
Signed-Off-By: Andrey Savochkin <saw@sawoct.com>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>
CC: Dmitry Monakhov <dmonakhov@sw.ru>
fs/ext3/inode.c

index bcd86f6..d8f5a9b 100644 (file)
@@ -570,6 +570,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 */