linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] only restart e2fsck once for inodes in uninit range
@ 2009-05-28  6:39 Andreas Dilger
  2009-05-28 11:57 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Dilger @ 2009-05-28  6:39 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4

Restart e2fsck only once in case of multiple inodes in uninit range.
Display correct inode number during BG_INO_UNINIT and INOREF_IN_USED errors.

Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Andreas Dilger <adilger@sun.com>

Index: e2fsprogs-1.41.4/e2fsck/pass2.c
===================================================================
--- e2fsprogs-1.41.4.orig/e2fsck/pass2.c	2008-12-09 08:02:37.000000000 +0530
+++ e2fsprogs-1.41.4/e2fsck/pass2.c	2009-04-12 11:25:00.000000000 +0530
@@ -153,6 +153,12 @@
 						&cd);
 	if (ctx->flags & E2F_FLAG_SIGNAL_MASK || ctx->flags & E2F_FLAG_RESTART)
 		return;
+
+	if (ctx->flags & E2F_FLAG_RESTART_LATER) {
+		ctx->flags |= E2F_FLAG_RESTART;
+		return;
+	}
+
 	if (cd.pctx.errcode) {
 		fix_problem(ctx, PR_2_DBLIST_ITERATE, &cd.pctx);
 		ctx->flags |= E2F_FLAG_ABORT;
@@ -988,23 +994,24 @@
 		 * newly visible inodes.
 		 */
 		if (fs->group_desc[group].bg_flags & EXT2_BG_INODE_UNINIT) {
+			pctx.num = dirent->inode;
 			if (fix_problem(ctx, PR_2_INOREF_BG_INO_UNINIT,
 					&cd->pctx)){
 				fs->group_desc[group].bg_flags &=
 					~EXT2_BG_INODE_UNINIT;
 				ext2fs_mark_super_dirty(fs);
-				ctx->flags |= E2F_FLAG_RESTART;
+				ctx->flags |= E2F_FLAG_RESTART_LATER;
 			} else {
 				ext2fs_unmark_valid(fs);
 				if (problem == PR_2_BAD_INO)
 					goto next;
 			}
 		} else if (dirent->inode >= first_unused_inode) {
+			pctx.num = dirent->inode;
 			if (fix_problem(ctx, PR_2_INOREF_IN_UNUSED, &cd->pctx)){
 				fs->group_desc[group].bg_itable_unused = 0;
 				ext2fs_mark_super_dirty(fs);
-				ctx->flags |= E2F_FLAG_RESTART;
-				goto restart_fsck;
+				ctx->flags |= E2F_FLAG_RESTART_LATER;
 			} else {
 				ext2fs_unmark_valid(fs);
 				if (problem == PR_2_BAD_INO)
@@ -1145,7 +1152,6 @@
 	return 0;
 abort_free_dict:
 	ctx->flags |= E2F_FLAG_ABORT;
-restart_fsck:
 	dict_free_nodes(&de_dict);
 	return DIRENT_ABORT;
 }
Index: e2fsprogs-1.41.4/e2fsck/e2fsck.h
===================================================================
--- e2fsprogs-1.41.4.orig/e2fsck/e2fsck.h	2009-04-12 11:07:44.000000000 +0530
+++ e2fsprogs-1.41.4/e2fsck/e2fsck.h	2009-04-12 11:20:53.000000000 +0530
@@ -163,6 +163,7 @@
 #define E2F_FLAG_CANCEL		0x0002 /* Cancel signaled */
 #define E2F_FLAG_SIGNAL_MASK	0x0003
 #define E2F_FLAG_RESTART	0x0004 /* Restart signaled */
+#define E2F_FLAG_RESTART_LATER	0x0008 /* Restart after all iterations done */
 
 #define E2F_FLAG_SETJMP_OK	0x0010 /* Setjmp valid for abort */
 
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] only restart e2fsck once for inodes in uninit range
  2009-05-28  6:39 [PATCH] only restart e2fsck once for inodes in uninit range Andreas Dilger
@ 2009-05-28 11:57 ` Theodore Tso
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2009-05-28 11:57 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-ext4

On Thu, May 28, 2009 at 12:39:49AM -0600, Andreas Dilger wrote:
> Restart e2fsck only once in case of multiple inodes in uninit range.
> Display correct inode number during BG_INO_UNINIT and INOREF_IN_USED errors.
> 
> Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
> Signed-off-by: Andreas Dilger <adilger@sun.com>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-28 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28  6:39 [PATCH] only restart e2fsck once for inodes in uninit range Andreas Dilger
2009-05-28 11:57 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).