Skip to content

Commit

Permalink
tune2fs: only set the superblock as dirty if the default group is mod…
Browse files Browse the repository at this point in the history
…ified

Similar to commit 2eb3b20, it speeds up `tunefs -g` command when
the group argument is identical.

Signed-off-by: Theodore Ts'o <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
gwendalcr authored and tytso committed Oct 25, 2024
1 parent 9448aed commit 2c1e554
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions misc/tune2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3381,9 +3381,13 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
printf(_("Setting error behavior to %d\n"), errors);
}
if (g_flag) {
sb->s_def_resgid = resgid;
ext2fs_mark_super_dirty(fs);
printf(_("Setting reserved blocks gid to %lu\n"), resgid);
if (sb->s_def_resgid != resgid) {
sb->s_def_resgid = resgid;
ext2fs_mark_super_dirty(fs);
printf(_("Setting reserved blocks gid to %lu\n"), resgid);
} else {
printf(_("Reserved blocks gid already set to %lu\n"), resgid);
}
}
if (i_flag) {
if ((unsigned long long)interval >= (1ULL << 32)) {
Expand Down

0 comments on commit 2c1e554

Please sign in to comment.