mirror of https://github.com/vitalif/e2fsprogs
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>test-maint
parent
8a54677711
commit
e9a5c6e360
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue