summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-04-14 09:29:02 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-04-14 09:29:02 -0400
commite94bc631648299dca43a6015520b18f6232d50df (patch)
treeb7d4d7f068ae8d87ea210df9a0f6c0797d94cbeb /e2fsck
parentc7c1209efde0a2ec283a21f83262e25118abcf32 (diff)
downloade2fsprogs-e94bc631648299dca43a6015520b18f6232d50df.tar.gz
Improve I/O error messages in e2fsck
Add better ehandler_operation() markers so it is clearer what e2fsck was doing when an I/O error is reported. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/ChangeLog6
-rw-r--r--e2fsck/pass1.c18
-rw-r--r--e2fsck/pass2.c3
-rw-r--r--e2fsck/util.c14
4 files changed, 30 insertions, 11 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index 3200d41f..2795e464 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-14 Theodore Tso <tytso@mit.edu>
+
+ * pass1.c, pass2.c, util.c: Add better ehandler_operation()
+ markers so it is clearer what e2fsck was doing when an I/O
+ error is reported.
+
2007-04-10 Jim Garlick <garlick@llnl.gov>
* pass1b.c (search_dirent_proc): if a file has multiple hard
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 4a888118..62815738 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -384,9 +384,11 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,
char *buf)
{
struct ext2_inode *inode = pctx->inode;
- int i, not_device = 0;
- blk_t blk;
struct ext2_dir_entry *dirent;
+ const char *old_op;
+ errcode_t retval;
+ blk_t blk;
+ int i, not_device = 0;
if (LINUX_S_ISDIR(inode->i_mode) || LINUX_S_ISREG(inode->i_mode) ||
inode->i_block[0] == 0)
@@ -412,7 +414,10 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,
if (LINUX_S_ISLNK(inode->i_mode) && inode->i_links_count == 1)
return;
- if (ext2fs_read_dir_block(ctx->fs, inode->i_block[0], buf))
+ old_op = ehandler_operation(_("reading directory block"));
+ retval = ext2fs_read_dir_block(ctx->fs, inode->i_block[0], buf);
+ ehandler_operation(0);
+ if (retval)
return;
dirent = (struct ext2_dir_entry *) buf;
@@ -486,6 +491,7 @@ void e2fsck_pass1(e2fsck_t ctx)
struct problem_context pctx;
struct scan_callback_struct scan_struct;
struct ext2_super_block *sb = ctx->fs->super;
+ const char *old_op;
int imagic_fs;
int busted_fs_time = 0;
int inode_size;
@@ -602,9 +608,10 @@ void e2fsck_pass1(e2fsck_t ctx)
block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 3,
"block interate buffer");
e2fsck_use_inode_shortcuts(ctx, 1);
- ehandler_operation(_("doing inode scan"));
+ old_op = ehandler_operation(_("opening inode scan"));
pctx.errcode = ext2fs_open_inode_scan(fs, ctx->inode_buffer_blocks,
&scan);
+ ehandler_operation(old_op);
if (pctx.errcode) {
fix_problem(ctx, PR_1_ISCAN_ERROR, &pctx);
ctx->flags |= E2F_FLAG_ABORT;
@@ -625,8 +632,10 @@ void e2fsck_pass1(e2fsck_t ctx)
busted_fs_time = 1;
while (1) {
+ old_op = ehandler_operation(_("getting next inode from scan"));
pctx.errcode = ext2fs_get_next_inode_full(scan, &ino,
inode, inode_size);
+ ehandler_operation(old_op);
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
return;
if (pctx.errcode == EXT2_ET_BAD_BLOCK_IN_INODE_TABLE) {
@@ -938,7 +947,6 @@ void e2fsck_pass1(e2fsck_t ctx)
}
process_inodes(ctx, block_buf);
ext2fs_close_inode_scan(scan);
- ehandler_operation(0);
/*
* If any extended attribute blocks' reference counts need to
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 715919d6..1fb4f5a6 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -712,6 +712,7 @@ static int check_dir_block(ext2_filsys fs,
struct ext2_dir_entry *dirent, *prev;
ext2_dirhash_t hash;
unsigned int offset = 0;
+ const char * old_op;
int dir_modified = 0;
int dot_state;
blk_t block_nr = db->blk;
@@ -773,7 +774,9 @@ static int check_dir_block(ext2_filsys fs,
db->blockcnt, ino);
#endif
+ old_op = ehandler_operation(_("reading directory block"));
cd->pctx.errcode = ext2fs_read_dir_block(fs, block_nr, buf);
+ ehandler_operation(0);
if (cd->pctx.errcode == EXT2_ET_DIR_CORRUPTED)
cd->pctx.errcode = 0; /* We'll handle this ourselves */
if (cd->pctx.errcode) {
diff --git a/e2fsck/util.c b/e2fsck/util.c
index dddc084d..2ff3c6f6 100644
--- a/e2fsck/util.c
+++ b/e2fsck/util.c
@@ -207,6 +207,7 @@ void e2fsck_read_bitmaps(e2fsck_t ctx)
{
ext2_filsys fs = ctx->fs;
errcode_t retval;
+ const char *old_op;
if (ctx->invalid_bitmaps) {
com_err(ctx->program_name, 0,
@@ -215,9 +216,9 @@ void e2fsck_read_bitmaps(e2fsck_t ctx)
fatal_error(ctx, 0);
}
- ehandler_operation(_("reading inode and block bitmaps"));
+ old_op = ehandler_operation(_("reading inode and block bitmaps"));
retval = ext2fs_read_bitmaps(fs);
- ehandler_operation(0);
+ ehandler_operation(old_op);
if (retval) {
com_err(ctx->program_name, retval,
_("while retrying to read bitmaps for %s"),
@@ -230,11 +231,12 @@ void e2fsck_write_bitmaps(e2fsck_t ctx)
{
ext2_filsys fs = ctx->fs;
errcode_t retval;
+ const char *old_op;
if (ext2fs_test_bb_dirty(fs)) {
- ehandler_operation(_("writing block bitmaps"));
+ old_op = ehandler_operation(_("writing block bitmaps"));
retval = ext2fs_write_block_bitmap(fs);
- ehandler_operation(0);
+ ehandler_operation(old_op);
if (retval) {
com_err(ctx->program_name, retval,
_("while retrying to write block bitmaps for %s"),
@@ -244,9 +246,9 @@ void e2fsck_write_bitmaps(e2fsck_t ctx)
}
if (ext2fs_test_ib_dirty(fs)) {
- ehandler_operation(_("writing inode bitmaps"));
+ old_op = ehandler_operation(_("writing inode bitmaps"));
retval = ext2fs_write_inode_bitmap(fs);
- ehandler_operation(0);
+ ehandler_operation(old_op);
if (retval) {
com_err(ctx->program_name, retval,
_("while retrying to write inode bitmaps for %s"),