diff options
Diffstat (limited to 'sysutils/e2fsprogs/files/patch-zzz-e9a5c6e3607d17641543aa5e801af22563fb1410')
-rw-r--r-- | sysutils/e2fsprogs/files/patch-zzz-e9a5c6e3607d17641543aa5e801af22563fb1410 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sysutils/e2fsprogs/files/patch-zzz-e9a5c6e3607d17641543aa5e801af22563fb1410 b/sysutils/e2fsprogs/files/patch-zzz-e9a5c6e3607d17641543aa5e801af22563fb1410 new file mode 100644 index 000000000000..57c1881c774d --- /dev/null +++ b/sysutils/e2fsprogs/files/patch-zzz-e9a5c6e3607d17641543aa5e801af22563fb1410 @@ -0,0 +1,45 @@ +From e9a5c6e3607d17641543aa5e801af22563fb1410 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o <tytso@mit.edu> +Date: Thu, 11 Sep 2014 12:24:07 -0400 +Subject: 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> + +diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c +index dbaf471..4a9019b 100644 +--- ./e2fsck/dirinfo.c ++++ ./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; + } +diff --git a/e2fsck/dx_dirinfo.c b/e2fsck/dx_dirinfo.c +index 7838a40..be53fff 100644 +--- ./e2fsck/dx_dirinfo.c ++++ ./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; + } +-- +cgit v0.10.2 + |