]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: Check for fast symlinks that have EXTENTS_FL set
authorTheodore Ts'o <tytso@mit.edu>
Fri, 14 Mar 2008 03:13:18 +0000 (23:13 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Mar 2008 03:13:18 +0000 (23:13 -0400)
These shouldn't show up in the wild, but if they do, e2fsck will offer
to clear them.

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

index 86389898cdf2945ddd62ce52384333c7a1c7d8a7..50e38e1f8102a564d1c71ada8e74b3e7c542fe4c 100644 (file)
@@ -713,6 +713,14 @@ void e2fsck_pass1(e2fsck_t ctx)
                        }
                }
 
+               if (extent_fs && (inode->i_flags & EXT4_EXTENTS_FL) &&
+                   LINUX_S_ISLNK(inode->i_mode) &&
+                   !ext2fs_inode_has_valid_blocks(inode) &&
+                   fix_problem(ctx, PR_1_FAST_SYMLINK_EXTENT_FL, &pctx)) {
+                       inode->i_flags &= ~EXT4_EXTENTS_FL;
+                       e2fsck_write_inode(ctx, ino, inode, "pass1");
+               }
+
                if (ino == EXT2_BAD_INO) {
                        struct process_block_struct pb;
                        
index afed4fed264fb7b9648674d6ce8a4d0edeebd776..d3e2fd7bc032d469a5a6c6d4278ada7608b09721 100644 (file)
@@ -819,6 +819,11 @@ static struct e2fsck_problem problem_table[] = {
          N_("@i %i missing EXTENT_FL, but is in extents format\n"),
          PROMPT_FIX, PR_PREEN_OK },
 
+       /* Fast symlink has EXTENTS_FL set */
+       { PR_1_FAST_SYMLINK_EXTENT_FL,
+         N_("Fast symlink %i has EXTENT_FL set.  "),
+         PROMPT_CLEAR, 0 },
+
        /* Pass 1b errors */
 
        /* Pass 1B: Rescan for duplicate/bad blocks */
index d5d1a78350ebdcf2a363eca903b388d472cb4eeb..48a4a2b617725def3ae7287cc08bee2eb6a398b4 100644 (file)
@@ -476,6 +476,9 @@ struct problem_context {
 /* inode missing EXTENTS_FL, but is an extent inode */
 #define PR_1_UNSET_EXTENT_FL           0x01005C
 
+/* Fast symlink has EXTENTS_FL set */
+#define PR_1_FAST_SYMLINK_EXTENT_FL    0x01005D
+
 /*
  * Pass 1b errors
  */