+Fri Feb 27 00:01:39 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * e2fsck.c (e2fsck_run): Since E2F_FLAG_SIGNAL_MASK doesn't
+ include EXT2_FLAG_RESTART anymore, we need to adjust this
+ routine so that it *does* return in the case of it seeing
+ EXT2_FLAG_RESTART.
+
+ * pass1.c (e2fsck_pass1): ext2_get_next_inode() may call the group
+ done callback function, which may set context abort
+ flags. So we need to test the context abort flags after
+ we call ext2_get_next_inode().
+ (process_inodes): If we abort due out of process_inodes,
+ do a clean exit by breaking out of the for loop instead of
+ just returning.
+
+ * e2fsck.h (E2F_FLAG_SIGNAL_MASK): EXT2_FLAG_RESTART shouldn't be
+ considered a SIGNAL mask (i.e., requiring an immediate
+ abort of processing to restart). FLAG_RESTART just means
+ that we want to restart once pass 1 is complete.
+
Tue Feb 24 15:19:40 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Change the progress function to return an integer; if returns 1,
e2fsck_pass1, e2fsck_pass2, e2fsck_pass3, e2fsck_pass4,
e2fsck_pass5, 0 };
+#define E2F_FLAG_RUN_RETURN (E2F_FLAG_SIGNAL_MASK|E2F_FLAG_RESTART)
+
int e2fsck_run(e2fsck_t ctx)
{
int i;
#ifdef HAVE_SETJMP_H
if (setjmp(ctx->abort_loc))
- return (ctx->flags & E2F_FLAG_SIGNAL_MASK);
+ return (ctx->flags & E2F_FLAG_RUN_RETURN);
ctx->flags |= E2F_FLAG_SETJMP_OK;
#endif
for (i=0; (e2fsck_pass = e2fsck_passes[i]); i++) {
- if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
+ if (ctx->flags & E2F_FLAG_RUN_RETURN)
break;
e2fsck_pass(ctx);
}
ctx->flags &= ~E2F_FLAG_SETJMP_OK;
- if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- return (ctx->flags & E2F_FLAG_SIGNAL_MASK);
+ if (ctx->flags & E2F_FLAG_RUN_RETURN)
+ return (ctx->flags & E2F_FLAG_RUN_RETURN);
return 0;
}
*/
#define E2F_FLAG_ABORT 0x0001 /* Abort signaled */
#define E2F_FLAG_CANCEL 0x0002 /* Cancel signaled */
+#define E2F_FLAG_SIGNAL_MASK 0x0003
#define E2F_FLAG_RESTART 0x0004 /* Restart signaled */
-#define E2F_FLAG_SIGNAL_MASK 0x000F
#define E2F_FLAG_SETJMP_OK 0x0010 /* Setjmp valid for abort */
}
next:
pctx.errcode = ext2fs_get_next_inode(scan, &ino, &inode);
+ if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
+ return;
if (pctx.errcode == EXT2_ET_BAD_BLOCK_IN_INODE_TABLE) {
if (!ctx->inode_bb_map)
alloc_bb_map(ctx);
sprintf(buf, "reading indirect blocks of inode %lu", pctx.ino);
ehandler_operation(buf);
check_blocks(ctx, &pctx, block_buf);
-
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- return;
+ break;
}
ctx->stashed_inode = old_stashed_inode;
ctx->stashed_ino = old_stashed_ino;