lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Jul 2009 14:07:47 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	Theodore Ts'o <tytso@....edu>
Subject: [PATCH] resize2fs: If resize2fs fails, tell the user to run e2fsck

If the resize operation fails in the middle of the operation, mark the
filesystem as needing to be checked, and tell the user that they
should run e2fsck -fy on the device.

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 resize/main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/resize/main.c b/resize/main.c
index 2dae161..990a967 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -455,7 +455,12 @@ int main (int argc, char ** argv)
 	if (retval) {
 		com_err(program_name, retval, _("while trying to resize %s"),
 			device_name);
-		ext2fs_close (fs);
+		fprintf(stderr,
+			_("Please run 'e2fsck -fy %s' to fix the filesystem\n"
+			  "after the aborted resize operation"), device_name);
+		fs->super->s_state |= EXT2_ERROR_FS;
+		ext2fs_mark_super_dirty(fs);
+		ext2fs_close(fs);
 		exit(1);
 	}
 	printf(_("The filesystem on %s is now %u blocks long.\n\n"),
-- 
1.6.3.2.1.gb9f7d.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists