summaryrefslogtreecommitdiff
path: root/e2fsck/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-07-05 13:42:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-07-05 13:42:07 -0400
commit25567a7b0fa98b390fd1ff0d4702b29c23a75bbb (patch)
tree0779a55cf5591267a124ef4ad920713fc2af1a17 /e2fsck/super.c
parentf37901a22d618916b53105e39ff91a8bb84d67bc (diff)
downloade2fsprogs-25567a7b0fa98b390fd1ff0d4702b29c23a75bbb.tar.gz
e2fsck, libext2fs: support for bigalloc file systems with a blocksize of 1024
Filesystems with a blocksize of 1024 have the superblock starting at block #1. However, the first data block in the superblock is 0 to simplify the cluster calculations. So we must compensate for this in a number of places, mostly in the ext2fs library, but also in e2fsck. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/super.c')
-rw-r--r--e2fsck/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/e2fsck/super.c b/e2fsck/super.c
index 40cfc4fb..2fffc534 100644
--- a/e2fsck/super.c
+++ b/e2fsck/super.c
@@ -400,6 +400,8 @@ void check_resize_inode(e2fsck_t ctx)
gdt_off = fs->desc_blocks;
pblk = fs->super->s_first_data_block + 1 + fs->desc_blocks;
+ if (fs->blocksize == 1024 && fs->super->s_first_data_block == 0)
+ pblk++; /* Deal with 1024 blocksize bigalloc fs */
for (i = 0; i < fs->super->s_reserved_gdt_blocks / 4;
i++, gdt_off++, pblk++) {
gdt_off %= fs->blocksize/4;
@@ -555,7 +557,8 @@ void check_super_block(e2fsck_t ctx)
}
}
- should_be = (sb->s_log_block_size == 0) ? 1 : 0;
+ should_be = (sb->s_log_block_size == 0 &&
+ EXT2FS_CLUSTER_RATIO(fs) == 1) ? 1 : 0;
if (sb->s_first_data_block != should_be) {
pctx.blk = sb->s_first_data_block;
pctx.blk2 = should_be;