in a filesystem to be reserved for allocation by the root user.
* super.c (check_resize_inode): Use ext2fs_{read,write}_ind_block
so that byte swapping is handled on big-endian systems.
+ (check_super_block): Allow the number of reserved blocks
+ to be 50% of the number of blocks available, in order to
+ be consistent to what is allowed by tune2fs.
2004-12-24 Theodore Ts'o <tytso@mit.edu>
check_super_value(ctx, "inodes_per_group", sb->s_inodes_per_group,
MIN_CHECK | MAX_CHECK, inodes_per_block, ipg_max);
check_super_value(ctx, "r_blocks_count", sb->s_r_blocks_count,
- MAX_CHECK, 0, sb->s_blocks_count / 4);
+ MAX_CHECK, 0, sb->s_blocks_count / 2);
check_super_value(ctx, "reserved_gdt_blocks",
sb->s_reserved_gdt_blocks, MAX_CHECK, 0,
fs->blocksize/4);
+2005-01-06 Theodore Ts'o <tytso@mit.edu>
+
+ * tune2fs.c (main): When specifying the number of reservered
+ blocks that can only be allocated by root, enforce a 50%
+ limit so that the user can't accidentally make a
+ superblock which e2fsck will think is insane.
+
2005-01-05 Theodore Ts'o <tytso@mit.edu>
* fsck.c (PRS): Apply Fedora's e2fsprogs-1.35-progress.patch from
reserved_ratio, sb->s_r_blocks_count);
}
if (r_flag) {
- if (reserved_blocks >= sb->s_blocks_count) {
+ if (reserved_blocks >= sb->s_blocks_count/2) {
com_err (program_name, 0,
_("reserved blocks count is too big (%lu)"),
reserved_blocks);