+2007-06-18 Theodore Tso <tytso@mit.edu>
+
+ * journal.c (e2fsck_run_ext3_journal), unix.c (main): Explicitly
+ add the EXT2_FLAG_MASTER_SB_ONLY flag to make sure we
+ won't write out the backup superblocks until we're sure
+ that we want write them out.
+
2007-06-04 Theodore Tso <tytso@mit.edu>
* super.c (check_super_block, e2fsck_get_device_size),
}
ctx->fs->priv_data = ctx;
ctx->fs->now = ctx->now;
+ ctx->fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
/* Set the superblock flags */
e2fsck_clear_recover(ctx, recover_retval);
fix_problem(ctx, PR_0_SB_CORRUPT, &pctx);
fatal_error(ctx, 0);
}
+ /*
+ * We only update the master superblock because (a) paranoia;
+ * we don't want to corrupt the backup superblocks, and (b) we
+ * don't need to update the mount count and last checked
+ * fields in the backup superblock (the kernel doesn't update
+ * the backup superblocks anyway). With newer versions of the
+ * library this flag is set by ext2fs_open2(), but we set this
+ * here just to be sure. (No, we don't support e2fsck running
+ * with some other libext2fs than the one that it was shipped
+ * with, but just in case....)
+ */
+ fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
if (!(ctx->flags & E2F_FLAG_GOT_DEVSIZE)) {
__u32 blocksize = EXT2_BLOCK_SIZE(fs->super);
!(ctx->options & E2F_OPT_READONLY))
ext2fs_mark_super_dirty(fs);
- /*
- * We only update the master superblock because (a) paranoia;
- * we don't want to corrupt the backup superblocks, and (b) we
- * don't need to update the mount count and last checked
- * fields in the backup superblock (the kernel doesn't
- * update the backup superblocks anyway).
- */
- fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
-
ehandler_init(fs->io);
if (ctx->superblock)
+2007-06-12 Theodore Tso <tytso@mit.edu>
+
+ * openfs.c (ext2fs_open2): We now set EXT2_FLAG_MASTER_SB_ONLY
+ when we open a filesystem. Applications that want to
+ write changes to the backup superblocks need to explicitly
+ clear this flag.
+
2007-05-31 Theodore Tso <tytso@mit.edu>
* tst_super_size.c (main): Add sanity check to make sure the
memset(fs, 0, sizeof(struct struct_ext2_filsys));
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags;
+ /* don't overwrite sb backups unless flag is explicitly cleared */
+ fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
fs->umask = 022;
retval = ext2fs_get_mem(strlen(name)+1, &fs->device_name);
if (retval)
+2007-06-12 Theodore Tso <tytso@mit.edu>
+
+ * tune2fs.c (main): Clear the EXT2_FLAG_MASTER_SB_ONLY flag
+ because we want tune2fs changes to get written to the
+ backup blocks.
+
2007-06-04 Theodore Tso <tytso@mit.edu>
* badblocks.c (main): Fix error checking of the last-block and
exit(1);
}
sb = fs->super;
+ fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
if (print_label) {
/* For e2label emulation */
printf("%.*s\n", (int) sizeof(sb->s_volume_name),
+2007-06-12 Theodore Tso <tytso@mit.edu>
+
+ * resize2fs.c (resize_fs): Clear the EXT2_FLAG_MASTER_SB_ONLY flag
+ to make sure the superblock changes are written out to the
+ backup superblocks.
+
2007-05-22 Theodore Tso <tytso@mit.edu>
* sim_progress.c (ext2fs_progress_init): Fix type-punning warning.
if (retval)
goto errout;
+ rfs->new_fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
retval = ext2fs_close(rfs->new_fs);
if (retval)
goto errout;