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/dx_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/dx_dirinfo.c')
-rw-r--r-- | e2fsck/dx_dirinfo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/e2fsck/dx_dirinfo.c b/e2fsck/dx_dirinfo.c index 7838a406..be53fff0 100644 --- a/e2fsck/dx_dirinfo.c +++ b/e2fsck/dx_dirinfo.c @@ -40,6 +40,10 @@ void e2fsck_add_dx_dir(e2fsck_t ctx, ext2_ino_t ino, int num_blocks) sizeof(struct dx_dir_info), &ctx->dx_dir_info); if (retval) { + fprintf(stderr, "Couldn't reallocate dx_dir_info " + "structure to %d entries\n", + ctx->dx_dir_info_size); + fatal_error(ctx, 0); ctx->dx_dir_info_size -= 10; return; } |