+1998-06-30 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * closefs.c (ext2fs_flush): Update the s_block_group_nr field as
+ appropriate for all of the block group copies, so that
+ it's clear where the beginning of the filesystem is on the
+ disk. (For when the partition table gets scrod.)
+
+ * ext2fs.h: Change the name of the feature from
+ EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE to
+ EXT2_FEATURE_INCOMPAT_FILESIZE (to match with the kernel).
+
1998-06-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
* inode.c (get_next_blockgroup): Fix bug where if
errcode_t ext2fs_flush(ext2_filsys fs)
{
- dgrp_t i,j,maxgroup;
+ dgrp_t i,j,maxgroup,sgrp;
blk_t group_block;
errcode_t retval;
char *group_ptr;
struct ext2_super_block *super_shadow = 0;
struct ext2_group_desc *group_shadow = 0;
struct ext2_group_desc *s, *t;
+ struct ext2fs_sb *sb, *sb_shadow;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
fs_state = fs->super->s_state;
fs->super->s_wtime = time(NULL);
+ sb = (struct ext2fs_sb *) fs->super;
+ sb->s_block_group_nr = 0;
if (fs->flags & EXT2_FLAG_SWAP_BYTES) {
retval = EXT2_ET_NO_MEMORY;
retval = ext2fs_get_mem(SUPERBLOCK_SIZE,
/* swap the superblock */
*super_shadow = *fs->super;
ext2fs_swap_super(super_shadow);
+ sb_shadow = (struct ext2fs_sb *) super_shadow;
/* swap the group descriptors */
for (j=0, s=fs->group_desc, t=group_shadow;
}
} else {
super_shadow = fs->super;
+ sb_shadow = (struct ext2fs_sb *) fs->super;
group_shadow = fs->group_desc;
}
if (!ext2fs_bg_has_super(fs, i))
goto next_group;
+ sgrp = i;
+ if (sgrp > ((1 << 16) - 1))
+ sgrp = (1 << 16) - 1;
+ if (fs->flags & EXT2_FLAG_SWAP_BYTES)
+ sb_shadow->s_block_group_nr = ext2fs_swab16(sgrp);
+ else
+ sb->s_block_group_nr = sgrp;
+
if (i !=0 ) {
retval = io_channel_write_blk(fs->io, group_block,
-SUPERBLOCK_SIZE,
next_group:
group_block += EXT2_BLOCKS_PER_GROUP(fs->super);
}
+ sb->s_block_group_nr = 0;
/*
* If the write_bitmaps() function is present, call it to