Skip to contentSkip to conversation

resize2fs: relax requirements for -P output a bit

PATCH In review Eric Sandeen 2 participants 2 messages Jul 12, 2010 – Jul 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 resize2fs: relax requirements for -P output a bit

Requiring an immediate pre-fsck before printing a minimum resize size seems a bit draconian; if the fs isn't clean or marked with error, then certainly, but for an informational minimum size, I don't think we need to require a fsck since last mount.

I had simply copied the checks from the actual resize path, previously.

Installers use this option (-P) to gather minimum resize info, and requiring an actual fsck before use just seems to go too far.

---

resize/main.c +1 -2
index 7c4f4dd..7d8b287 100644
@@ -345,8 +345,7 @@ int main (int argc, char ** argv)
 	min_size = calculate_minimum_resize_size(fs);
 
 	if (print_min_size) {
-		if (!force && ((fs->super->s_lastcheck < fs->super->s_mtime) ||
-			       (fs->super->s_state & EXT2_ERROR_FS) ||
+		if (!force && ((fs->super->s_state & EXT2_ERROR_FS) ||
 			       ((fs->super->s_state & EXT2_VALID_FS) == 0))) {
 			fprintf(stderr,
 				_("Please run 'e2fsck -f %s' first.\n\n"),
#1 lore raw
Quoted 5 lines · Eric Sandeen

Requiring an immediate pre-fsck before printing a minimum resize size seems a bit draconian; if the fs isn't clean or marked with error, then certainly, but for an informational minimum size, I don't think we need to require a fsck since last mount.

Quoted 7 lines

I had simply copied the checks from the actual resize path, previously.

Installers use this option (-P) to gather minimum resize info, and requiring an actual fsck before use just seems to go too far.

Makes sense. I've added it to the e2fsprogs maint branch.

- Ted