]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: Don't skip an extent after deleting an invalid extent
authorTheodore Ts'o <tytso@mit.edu>
Wed, 28 May 2008 08:54:44 +0000 (04:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 May 2008 08:54:44 +0000 (04:54 -0400)
ext2fs_delete_extent() deletes the current extent and moves to the
next extent (if present).  So we need to skip moving to the next
extent and get the (new) current extent and check it before moving on.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c

index c729ea3b0a74eff6e593791f2ec5adc7b473ad9f..5ca2d83b7d296ed7d846bdfe50645715bf72e4d9 100644 (file)
@@ -1654,6 +1654,14 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
                                        ctx->flags |= E2F_FLAG_ABORT;
                                        return;
                                }
+                               pctx->errcode = ext2fs_extent_get(ehandle,
+                                                                 EXT2_EXTENT_CURRENT,
+                                                                 &extent);
+                               if (pctx->errcode == EXT2_ET_NO_CURRENT_NODE) {
+                                       pctx->errcode = 0;
+                                       break;
+                               }
+                               continue;
                        }
                        goto next;
                }