diff options
author | Theodore Ts'o <tytso@mit.edu> | 2007-03-31 19:18:24 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-03-31 19:18:24 -0400 |
commit | 56c8c592ac48c0fc9772153bb7bdf621b1de0ab9 (patch) | |
tree | 7776c3119ddfd1f46ab327aef0afb386e6c313dc /e2fsck/pass3.c | |
parent | 441ab1e02096e3c968cae6ddfde73140fcad8199 (diff) | |
download | e2fsprogs-56c8c592ac48c0fc9772153bb7bdf621b1de0ab9.tar.gz |
Fix e2fsck to set the filetype of '..' when connecting a dir, to lost+found
If there is an orphaned inode whose '..' entry is pointing at a special
file, the filetype of the '..' entry will set to the type of the special
file. When the orphaned directory is reconnected to /lost+found, the
filetype of the '..' field is not reset to EXT2_FT_DIR, so a second
e2fsck is required to repair the filesystem.
We address this situation by setting the filetype of '..' when we
reconnect the inode to /lost+found.
Addresses Lustre Bug: #11645
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r-- | e2fsck/pass3.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index 26c0a036..72c4ec46 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -645,6 +645,12 @@ static int fix_dotdot_proc(struct ext2_dir_entry *dirent, fix_problem(fp->ctx, PR_3_ADJUST_INODE, &pctx); } dirent->inode = fp->parent; + if (fp->ctx->fs->super->s_feature_incompat & + EXT2_FEATURE_INCOMPAT_FILETYPE) + dirent->name_len = (dirent->name_len & 0xFF) | + (EXT2_FT_DIR << 8); + else + dirent->name_len = dirent->name_len & 0xFF; fp->done++; return DIRENT_ABORT | DIRENT_CHANGED; |