diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-09-11 12:24:07 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-09-11 12:24:07 -0400 |
commit | e9a5c6e3607d17641543aa5e801af22563fb1410 (patch) | |
tree | 0b1abfaeb10f963ab00fc6aebd4c9b4e83ba9e46 /e2fsck/dirinfo.c | |
parent | 8a546777119c9c02f37fd1d8b0f2df8a142a2245 (diff) | |
download | e2fsprogs-e9a5c6e3607d17641543aa5e801af22563fb1410.tar.gz |
e2fsck: notice when the realloc of dir_info fails
If the reallocation of dir_info fails, we will eventually cause e2fsck
to fail with an internal error. So if the realloc fails, print a
message and bail out with a fatal error early when at the time of the
reallocation failure.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/dirinfo.c')
-rw-r--r-- | e2fsck/dirinfo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c index dbaf4712..4a9019b5 100644 --- a/e2fsck/dirinfo.c +++ b/e2fsck/dirinfo.c @@ -140,6 +140,10 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent) sizeof(struct dir_info), &ctx->dir_info->array); if (retval) { + fprintf(stderr, "Couldn't reallocate dir_info " + "structure to %d entries\n", + ctx->dir_info->size); + fatal_error(ctx, 0); ctx->dir_info->size -= 10; return; } |