summaryrefslogtreecommitdiffstats
path: root/e2fsprogs-1.41-group-checksum-tests
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@fedoraproject.org>2008-08-23 15:54:45 +0000
committerEric Sandeen <sandeen@fedoraproject.org>2008-08-23 15:54:45 +0000
commit0fd402e7b1f64ed896b55cfecde8673f77682582 (patch)
treee4e59b14b603c6d6ae0fc9d9354004289717e902 /e2fsprogs-1.41-group-checksum-tests
parentd689fdaf3d60b36f396ce26e3d16997f094ef938 (diff)
downloade2fsprogs-0fd402e7b1f64ed896b55cfecde8673f77682582.tar.gz
e2fsprogs-0fd402e7b1f64ed896b55cfecde8673f77682582.tar.xz
e2fsprogs-0fd402e7b1f64ed896b55cfecde8673f77682582.zip
* Thu Jul 10 2008 Eric Sandeen <sandeen@redhat.com> 1.41.0-1e2fsprogs-1_41_0-2_fc10
- Don't check the group checksum when !GDT_CSUM (#459875)
Diffstat (limited to 'e2fsprogs-1.41-group-checksum-tests')
-rw-r--r--e2fsprogs-1.41-group-checksum-tests35
1 files changed, 35 insertions, 0 deletions
diff --git a/e2fsprogs-1.41-group-checksum-tests b/e2fsprogs-1.41-group-checksum-tests
new file mode 100644
index 0000000..8fedab9
--- /dev/null
+++ b/e2fsprogs-1.41-group-checksum-tests
@@ -0,0 +1,35 @@
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sun, 13 Jul 2008 23:03:59 +0000 (-0400)
+Subject: libext2fs: Don't check the group checksum when !GDT_CSUM
+X-Git-Url: http://git.kernel.org/?p=fs%2Fext2%2Fe2fsprogs.git;a=commitdiff_plain;h=4729455f0a68f2fa0a83ec8460d1d4bccba9dcfa
+
+libext2fs: Don't check the group checksum when !GDT_CSUM
+
+ext2fs_group_desc_csum_verify() is always checking the bg_checksum (to
+make sure it is zero) even when the GDT_CSUM feature is not present.
+This is normally OK, but apparently there are filesystems in the wild
+where this field has not be initialized to zero.
+
+Addresses-Debian-Bug: #490637
+
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+---
+
+diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
+index ce1508e..6a49d8f 100644
+--- a/lib/ext2fs/csum.c
++++ b/lib/ext2fs/csum.c
+@@ -60,8 +60,10 @@ STATIC __u16 ext2fs_group_desc_csum(ext2_filsys fs, dgrp_t group)
+
+ int ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group)
+ {
+- if (fs->group_desc[group].bg_checksum !=
+- ext2fs_group_desc_csum(fs, group))
++ if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
++ EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
++ (fs->group_desc[group].bg_checksum !=
++ ext2fs_group_desc_csum(fs, group)))
+ return 0;
+
+ return 1;
+