Whamcloud - gitweb
e2fsck: fix multiply-claimed block quota accounting when deleting files
[tools/e2fsprogs.git] / e2fsck / pass1b.c
index b40f026..d22cffd 100644 (file)
@@ -637,9 +637,11 @@ static int delete_file_block(ext2_filsys fs,
        if (ext2fs_test_block_bitmap2(ctx->block_dup_map, *block_nr)) {
                n = dict_lookup(&clstr_dict, INT_TO_VOIDPTR(c));
                if (n) {
-                       p = (struct dup_cluster *) dnode_get(n);
-                       if (lc != pb->cur_cluster)
+                       if (lc != pb->cur_cluster) {
+                               p = (struct dup_cluster *) dnode_get(n);
                                decrement_badcount(ctx, *block_nr, p);
+                               pb->dup_blocks++;
+                       }
                } else
                        com_err("delete_file_block", 0,
                            _("internal error: can't find dup_blk for %llu\n"),