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]
Message-id: <20090515185158.GQ3209@webber.adilger.int>
Date:	Fri, 15 May 2009 12:51:58 -0600
From:	Andreas Dilger <adilger@....com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org
Subject: [PATCH] initialize error handling before journal replay

One of our customers hit a temporary IO error during an e2fsck run during
the read from the journal.  It seems that the read error resulted in
e2fsck automatically discarding the journals and recreating them on several
filesystems on this node without any prompting from the user.

end_request: I/O error, dev sdg, sector 484832
Buffer I/O error on device sdg, logical block 60604
fsck-sdg[8276]: ls2-OST024c: Superblock has an invalid ext3 journal (inode 8).
fsck-sdg[8276]: CLEARED.
fsck-sdg[8276]: *** ext3 journal has been deleted - filesystem is now ext2
only ***
fsck-sdg[8276]: ls2-OST024c was not cleanly unmounted, check forced.
fsck-sdg[8276]: ls2-OST024c: Journal inode is not in use, but contains data.
CLEARED.
fsck-sdg[8276]: ls2-OST024c: Recreate journal to make the filesystem ext3
again?
fsck-sdg[8276]: FIXED.
fsck-sdg[8276]: Creating journal (32768 blocks):  Done.
fsck-sdg[8276]:
fsck-sdg[8276]: *** journal has been re-created - filesystem is now ext3 again
***
fsck-sdg[8276]: ls2-OST024c: 39818/20183248 files (8.2% non-contiguous), 222122257/779902976 blocks
fsck-sdg[8276]: exit code 1 (file system errors corrected)

-----------------------------------------------------------------------

The following patch moves the e2fsck error handler initialization earlier
in the e2fsck startup code before the journal is processed, so that the
user will be prompted for an action.  This is the first IO that is not
part of ext2fs_open() where fs->io is first initialized.

It doesn't seem possible to initialize the error handlers for the initial
filesystem open without changing the prototype for ext2fs_open2().  If we
are getting a new ext2fs_open3() prototype for 64-bit it might make sense
to add at least "read_error" as a parameter ("write_error" is not strictly
necessary for the open and could be set afterward).

Signed-off-by: Andreas Dilger <adilger@....com>
Signed-off-by: Jim Garlick <garlick@...l.gov>

Index: e2fsprogs+chaos4/e2fsck/unix.c
===================================================================
--- e2fsprogs+chaos4.orig/e2fsck/unix.c
+++ e2fsprogs+chaos4/e2fsck/unix.c
@@ -1395,6 +1395,8 @@ restart:
 		if (isspace(*cp) || *cp == ':')
 			*cp = '_';
 
+	ehandler_init(fs->io);
+
 	/*
 	 * Make sure the ext3 superblock fields are consistent.
 	 */
@@ -1506,8 +1508,6 @@ print_unsupp_features:
 	if (ctx->blocks_per_page == 0)
 		ctx->blocks_per_page = 1;
 
-	ehandler_init(fs->io);
-
	if (ctx->superblock)
		set_latch_flags(PR_LATCH_RELOC, PRL_LATCHED, 0);
	ext2fs_mark_valid(fs);


PS - message.c::abbrevs[] has "i", "I", and "j" out of alphabetical order,
     but I didn't want to stick this into this patch.  It would also be
     convenient to add e.g. an "/* @i */" comment before every line so
     it is easier to find.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ