tags 509529 +pending
thanks

On Tue, Dec 23, 2008 at 12:06:19AM +0000, Matt Zimmerman wrote:
> Package: e2fsprogs
> Version: 1.41.3-1
> Severity: minor
> 
> On an armel system with 32M of RAM and no swap, attempting e2fsck on a certain
> filesystem (details below) resulted in:
> 
> m...@stuff:~$ sudo e2fsck /dev/sdc1
> e2fsck 1.41.3 (12-Oct-2008)
> e2fsck: Group descriptors look bad... trying backup blocks...
> Media was not cleanly unmounted, check forced.
> Pass 1: Checking inodes, blocks, and sizes
> Error allocating block bitmap (1): Memory allocation failed
> e2fsck: aborted
> 
> Note the "Group descriptors look bad... trying backup blocks..." error.
> It's failing later due to an allocation failure, so it wouldn't succeed in
> any case.  This seemed worth reporting as the earlier error hints that there
> may be an earlier allocation failure which is not recognized as such.

Thanks for reporting this bug.  The following fix will be in a future
version of e2fsprogs.

                                               - Ted

commit 82b59ca1ed0c2d6311f2e4b6e315d7ef82b62833
Author: Theodore Ts'o <ty...@mit.edu>
Date:   Tue Sep 1 20:01:38 2009 -0400

    e2fsck: Avoid scary failure messages on low-memory systems
    
    On a very low-memory system, where ext2fs_check_desc() fails because
    it can't allocate a block bitmap, catch this error and report it
    immediate.  This avoids something like this, which could scare and
    mislead the user:
    
       e2fsck: Group descriptors look bad... trying backup blocks...
       Media was not cleanly unmounted, check forced.
       Pass 1: Checking inodes, blocks, and sizes
       Error allocating block bitmap (1): Memory allocation failed
       e2fsck: aborted
    
    Addresses-Debian-Bug: #509529
    
    Signed-off-by: "Theodore Ts'o" <ty...@mit.edu>

diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index e118e9a..6248958 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -926,7 +926,7 @@ static const char *my_ver_date = E2FSPROGS_DATE;
 
 int main (int argc, char *argv[])
 {
-       errcode_t       retval = 0, orig_retval = 0;
+       errcode_t       retval = 0, retval2 = 0, orig_retval = 0;
        int             exit_value = FSCK_OK;
        ext2_filsys     fs = 0;
        io_manager      io_ptr;
@@ -1012,7 +1012,11 @@ restart:
            !(ctx->flags & E2F_FLAG_SB_SPECIFIED) &&
            ((retval == EXT2_ET_BAD_MAGIC) ||
             (retval == EXT2_ET_CORRUPT_SUPERBLOCK) ||
-            ((retval == 0) && ext2fs_check_desc(fs)))) {
+            ((retval == 0) && (retval2 = ext2fs_check_desc(fs))))) {
+               if (retval2 == ENOMEM) {
+                       retval = retval2;
+                       goto failure;
+               }
                if (fs->flags & EXT2_FLAG_NOFREE_ON_ERROR) {
                        ext2fs_free(fs);
                        fs = NULL;
@@ -1051,6 +1055,7 @@ restart:
                if (features[0] || features[1] || features[2])
                        goto print_unsupp_features;
        }
+failure:
        if (retval) {
                if (orig_retval)
                        retval = orig_retval;



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to