summaryrefslogtreecommitdiff
path: root/e2fsck/pass3.c
Commit message (Collapse)AuthorAgeFilesLines
* e2fsck: mark that we don't care about the return value of e2fsck_lookup()Theodore Ts'o2022-08-111-2/+2
| | | | | | | | | We only print the parent directory to help provide context to the user, but it's possible that a corrupted directory doesn't have a '..' link. Addresses-Coverity-Bug: 1507762 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: no parent lookup in disconnected dirAndreas Dilger2022-05-021-7/+12
| | | | | | | | | | | | | | | | | | | | | | Don't call into ext2fs_get_pathname() to do a name lookup for a disconnected directory, since the directory block traversal in pass1 has already scanned all of the leaf blocks and never finds the entry, always printing "???". If the name entry had been found earlier, the directory would not be disconnected in pass3. Instead, lookup ".." and print the parent name in the prompt, and then do not search for the current directory name at all. This avoids a useless full directory scan for each disconnected entry, which can potentially be slow if the parent directory is large. Separate the recursively looped directory case to a new error code, since it is a different problem that should use its own descriptive text, and a proper pathname can be shown in this case. Lustre-bug-Id: https://jira.whamcloud.com/browse/LU-15330 Change-Id: If17a92689f24f365ca1fbe5c837e7d5f383ebbe5 Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: update the quota records when the root directory is recreatedTheodore Ts'o2019-09-021-3/+9
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix typos in code comments and developer docsSebastian Rasmussen2017-10-151-1/+1
| | | | | | Signed-off-by: Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
* e2fsck: fix quota accounting to use cluster unitsEric Whitney2017-04-131-2/+3
| | | | | | | | | | | | | | | | | | | | The quota accounting code in e2fsck's pass 1 and pass 3 uses block units rather than cluster units when recording the allocated space consumed by files and directories. In pass 1, this causes a large undercount of actual quota results and test failures for xfstests generic/383, /384, /385, and /386 on bigalloc file systems. In pass 3, this results in quota accounting errors when the lost+found directory is either extended or recreated on a bigalloc file system. Use clusters rather than blocks when accounting for allocated space, and correct a related header comment in the quota code. Note that pass 1b also contains call sites for quota_data_sub() that also need to be addressed. However, it appears that more than just unit conversion may be needed, so that will be left to a future patch. Signed-off-by: Eric Whitney <enwlinux@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix project quota supportTheodore Ts'o2016-05-211-9/+12
| | | | | | | | Use a large_inode so that when e2fsck is fixing a file system with project quota enabled, the correct project id's quota is adjusted when a corrupted inode is deleted. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: clean up feature test macros with predicate functionsDarrick J. Wong2015-10-241-2/+1
| | | | | | | | | Create separate predicate functions to test/set/clear feature flags, thereby replacing the wordy old macros. Furthermore, clean out the places where we open-coded feature tests. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: check for an encrypted lost+found directoryTheodore Ts'o2015-07-161-1/+17
| | | | | | | | The /lost+found directory must not be encrypted, since e2fsck won't have any keys. If we find an encrypted lost+found directory, we should delete the directory and recreate it. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: don't complain about root dir csum failures when getting lnfDarrick J. Wong2014-12-131-0/+9
| | | | | | | | | | Don't complain about checksum failures on the root dir when we're trying to find l+f if the root dir is going to be rehashed anyway. The test case for this is t_enable_mcsum in the next patch. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* libext2fs/e2fsck: refactor everyone who writes zero blocks to diskDarrick J. Wong2014-10-131-10/+3
| | | | | | | | | | Convert all call sites that write zero blocks to disk to use ext2fs_zero_blocks2() since it can use Linux's zero out feature to do the writes more quickly. Reclaim the zero buffer at freefs time and make the write-zeroes fallback use a larger buffer. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: expand root dir if linking l+f failsDarrick J. Wong2014-09-111-0/+8
| | | | | | | | If there isn't space in the root directory to add the lost+found entry, try expanding the root directory before failing the fsck. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: fix gcc warningsDarrick J. Wong2014-08-241-1/+1
| | | | | Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: convert 'delete files' warning to a proper fix_problem errorDarrick J. Wong2014-08-101-2/+2
| | | | | | | | | In pass 3, convert the "delete files and re-run e2fsck" message to a proper error code for more consistent error reporting and to make translation easier. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: correctly preserve fs flags when modifying ignore-csum-error flagDarrick J. Wong2014-08-021-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we need to modify the "ignore checksum error" behavior flag to get us past a library call, it's possible that the library call can result in other flag bits being changed. Therefore, it is not correct to restore unconditionally the previous flags value, since this will have unintended side effects on the other fs->flags; nor is it correct to assume that we can unconditionally set (or clear) the "ignore csum error" flag bit. Therefore, we must merge the previous value of the "ignore csum error" flag with the value of flags after the call. Note that we want to leave checksum verification on as much as possible because doing so exposes e2fsck bugs where two metadata blocks are "sharing" the same disk block, and attempting to fix one before relocating the other causes major filesystem damage. The damage is much more obvious when a previously checked piece of metadata suddenly fails in a subsequent pass. The modifications to the pass 2, 3, and 3A code are justified as follows: When e2fsck encounters a block of directory entries and cannot find the placeholder entry at the end that contains the checksum, it will try to insert the placeholder. If that fails, it will schedule the directory for a pass 3A reconstruction. Until that happens, we don't want directory block writing (pass 2), block iteration (pass 3), or block reading (pass 3A) to fail due to checksum errors, because failing to find the placeholder is itself a checksum verification error, which causes e2fsck to abort without fixing anything. The e2fsck call to ext2fs_read_bitmaps must never fail due to a checksum error because e2fsck subsequently (a) verifies the bitmaps itself; or (b) decides that they don't match what has been observed, and rewrites them. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: use root dir for lost+found when really desperateDarrick J. Wong2014-08-021-0/+12
| | | | | | | | | | | | If we're totally unable to allocate a lost+found directory, ask the user if he would like to dump orphaned files in the root directory. Hopefully this enables the user to delete enough files so that a subsequent run of e2fsck will make more progress. Better to cram lost files in the rootdir than the current behavior, which is to fail at linking them in, thereby leaving them as lost files. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: write dir blocks after new inode when reconstructing root/lost+foundDarrick J. Wong2014-07-261-40/+45
| | | | | | | | | | | | | | | | | | | If we trash the root directory block, e2fsck will find inode 11 (the old lost+found) and try to attach it to l+f. The lost+found checker also fails to find l+f and tries to add one to the root dir. The root dir is not found but is recreated with incorrect checksums, so linking in the l+f dir fails and the l+f '..' entry isn't set. Since both dirs now fail checksum verification, they're both referred to rehash to have that fixed, but because l+f doesn't have a '..' entry, rehash crashes because l+f has < 2 entries. On a checksumming filesystem, the routines in e2fsck that recreate /lost+found and / must write the new directory block *after* the inode has been written to disk because the checksum depends on i_generation. Add a regression test while we're at it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Merge branch 'maint' into nextTheodore Ts'o2014-07-261-2/+26
|\ | | | | | | | | | | Conflicts: debugfs/debugfs.c e2fsck/pass1.c
| * e2fsck: reserve blocks for root/lost+found directory repairDarrick J. Wong2014-07-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we think we're going to need to repair either the root directory or the lost+found directory, reserve a block at the end of pass 1 to reduce the likelihood of an e2fsck abort while reconstructing root/lost+found during pass 3. If / and/or /lost+found are corrupt and duplicate processing in pass 1b allocates all the free blocks in the FS, fsck aborts with an unusable FS since pass 3 can't recreate / or /lost+found. If either of those directories are missing, an admin can't easily mount the FS and access the directory tree to move files off the injured FS and free up space; this in turn prevents subsequent runs of e2fsck from being able to continue repairs of the FS. (One could migrate files manually with debugfs without the help of path names, but it seems easier if users can simply mount the FS and use regular FS management tools.) [ Fixed up an obvious C trap: const char * and const char [] are not the same thing when you are taking the size of the parameter. People, run your regression tests! Like spinach, it's good for you. :-) -- tytso ] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| * libext2fs: provide a function to set inode sizeDarrick J. Wong2014-07-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an API to set i_size in an inode and take care of all required feature flag modifications. Refactor the code to use this new function. [ Moved the function to lib/ext2fs/blk_num.c, which is the rest of these sorts of functions live, and renamed it to be ext2fs_inode_size_set() instead of ext2fs_inode_set_size() to be consistent with the other functions in in blk_num.c -- tytso ] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2014-07-251-37/+0
|\ \ | |/ | | | | | | Conflicts: e2fsck/pass1.c
| * e2fsck: force all block allocations to use block_found_mapDarrick J. Wong2014-07-241-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the later passes of efsck, we sometimes need to allocate and map blocks into a file. This can happen either by fsck directly calling new_block() or indirectly by the library calling new_block because it needs to allocate a block for lower level metadata (bmap2() with BMAP_SET; block_iterate3() with BLOCK_CHANGED). We need to force new_block to allocate blocks from the found block map, because the FS block map could be inaccurate for various reasons: the map is wrong, there are missing blocks, the checksum failed, etc. Therefore, any time fsck does something that could to allocate blocks, we need to intercept allocation requests so that they're sourced from the found block map. Remove the previous code that swapped bitmap pointers as this is now unneeded. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | e2fsck: check inline_data in pass3Zheng Liu2014-03-041-0/+12
| | | | | | | | | | | | | | | | | | In e2fsck_expand_directory() we don't handle a dir with inline data because when this function is called the directory inode shouldn't contains inline data. Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2013-12-261-1/+1
|\ \ | |/ | | | | | | Conflicts: lib/ext2fs/csum.c
| * e2fsck: read only parameter incorrectly comparedJohan Erlandsson2013-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't check for lost+found in read only mode. [Note: this patch was originally made against 1.41.14 version of e2fsprogs found as part of the AOSP (Android Open Source Program) tree. My Signed-off-by relies on the fact that the original patch author would have had to have filed a contribution agreement with Open Handset Alliance before this commit before this commit was allowed into the AOSP tree. -- tytso] Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2013-12-161-7/+16
|\ \ | |/ | | | | | | Conflicts: debugfs/debugfs.8.in
| * e2fsck: try implied cluster allocation when expanding a dirDarrick J. Wong2013-12-151-7/+16
| | | | | | | | | | | | | | | | | | | | When we're expanding a directory, check to see if we're doing an implied cluster allocation; if so, we don't need to allocate a new block, and we certainly don't need to update the summary counts. Reported-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2013-12-121-3/+41
|\ \ | |/ | | | | | | Conflicts: lib/ext2fs/newdir.c
| * e2fsck: in rehash, mark newly allocated extent blocks as foundDarrick J. Wong2013-12-121-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we're rehashing directories, it's possible that an extent block (or a map block) could be (silently) allocated by the underlying libext2fs when expanding the directory. This silent allocation is not captured in block_found_map, which is disastrous if later the rehash process expands another directory and uses that same block from before without realizing that it's now in use. Therefore, if we notice that the free block count has dropped by more than what e2fsck allocated itself during the expansion, we iterate the directory's blocks a second time to ensure that these silent allocations are marked in the found blocks bitmap. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
| * e2fsck: fix memory leaks (on error path)Darrick J. Wong2013-12-121-2/+3
| | | | | | | | | | Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2013-12-031-1/+1
|\ \ | |/ | | | | | | | | Conflicts: e2fsck/pass2.c e2fsck/pass3.c
| * e2fsck: use ext2fs_write_dir_block3() instead of ext2fs_write_dir_block()Kit Westneat2013-12-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of ext2fs_write_dir_block() meant that attempts to fix deleted/unused inodes in a directory would not be fixed for file systems with 64-bit block numbers. (And some random block with the high 32-bits cleared would get corrupted.) Fix a similar problem when expanding directories and when creating the lost+found dirctory. Signed-off-by: Kit Westneat <kwestneat@ddn.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
* | Merge branch 'maint' into nextTheodore Ts'o2013-10-121-1/+4
|\ \ | |/ | | | | | | | | | | Conflicts: e2fsck/problem.c e2fsck/rehash.c e2fsck/super.c
| * e2fsprogs: fix blk_t <- blk64_t assignment mismatchesDarrick J. Wong2013-10-071-1/+4
| | | | | | | | | | | | | | | | | | Fix all the places where we should be using a blk64_t instead of a blk_t. These fixes are more severe because 64bit values could be truncated silently. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | libext2fs: provide functions to safely access name_len and file_typeJan Kara2013-06-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accessing name_len (and file_type) in ext4_dir_entry structure is somewhat problematic because on big endian architecture we need to now whether we are really dealing with ext4_dir_entry (which has u16 name_len which needs byte swapping) or ext4_dir_entry_2 (which has u8 name_len which must not be byte swapped). Currently the code is somewhat surprising and name_len is always treated as u16 and byte swapped (flag EXT2_DIRBLOCK_V2_STRUCT isn't ever used) and then masking of name_len is used to access real name_len or file_type. Doing things this way in applications using libext2fs is unexpected to say the least (more natural is to type struct ext4_dir_entry * to struct ext4_dir_entry_2 * but that gives wrong results on big endian architectures. So provide helper functions that give endian-safe access to these fields. Also convert users in e2fsprogs to use these functions. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | ext4: fix rehashing of the lost+found directoryTheodore Ts'o2012-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 07307114dea didn't correctly handle the lost+found directory when it added support for metadata checksums. First of all, e2fsck_get_lost_and_found() assumed that the inode_dir_map bitmap was initialized, and it wasn't when it was called earlier by a change in that commit. Secondly, it's important that lost+found dirctory is processed in case its directory checksums are incorrect, but should preserve any empty dirctory blocks so there space available for e2fsck to reconnect any orphan inodes. Fix these problems, to fix test failures: f_holedir2 and f_rehash_dir Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | e2fsck: check directory leaf block checksumsDarrick J. Wong2012-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | Checks that directory leaf blocks have the necessary fake dir_entry at the end of the block to hold a checksum and that the checksum is valid. It will resize the block and/or rebuild the directory if necessary. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | libext2fs: add checksums to the end of directory leaf nodesDarrick J. Wong2012-08-021-3/+7
|/ | | | | | | | | Introduce small structures for recording directory tree checksums, and some API changes to support writing out directory blocks with checksums. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: use different bitmap types as appropriateTheodore Ts'o2011-12-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have multiple backend implementations of the bitmap code, this commit teaches e2fsck to use either the most appropriate backend for each use case. Since we don't know for sure if we will get it all right, the default choices can be overridden via e2fsck.conf. The various definitions are shown here, with the current defaults (which may change as we add more bitmap implementations and as learn what works better). ; EXT2FS_BAMP64_BITARRAY is 1 ; EXT2FS_BMAP64_RBTREE is 2 ; EXT2FS_BMAP64_AUTODIR is 3 [bitmaps] inode_used_map = 2 ; pass1 inode_dir_map = 3 ; pass1 inode_reg_map = 2 ; pass1 block_found_map = 2 ; pass1 inode_bad_map = 2 ; pass1 inode_imagic_map = 2 ; pass1 block_dup_map = 2 ; pass1 block_ea_map = 2 ; pass1 inode_link_info = 2 ; pass1 inode_dup_map = 2 ; pass1b inode_done_map = 3 ; pass3 inode_loop_detect = 3 ; pass3 fs_bitmaps = 2 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Shorten compile commands run by the build systemTheodore Ts'o2011-09-181-0/+1
| | | | | | | | | | | | | | | The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and this was starting to cause some tools heartburn. It also made "make V=1" almost useless, since trying to following the individual commands run by make was lost in the noise of all of the defines. So fix this by putting the configure-generated defines in lib/config.h and the directory pathnames to lib/dirpaths.h. In addition, clean up some vestigal defines in configure.in and in the Makefiles to further shorten the cc command lines. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: add support for checking the built-in quota filesAditya Kali2011-08-311-0/+3
| | | | | | | | | | This patch adds support for doing quota accounting during full e2fsck scan if the 'quota' feature was set on the superblock. If user-visible quota inodes are in use, they will be hidden and converted to the reserved quota inodes. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: Fix up to be 64-bit block number safeValerie Aurora Henson2010-06-131-8/+8
| | | | | | Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: Nick Dokos <nicholas.dokos@hp.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Convert ext2fs_block_alloc_stats() calls to block_alloc_stats2()Valerie Aurora Henson2009-10-251-2/+2
| | | | | Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Convert to use io_channel_read_blk64() and io_channel_write_blk64()Valerie Aurora Henson2009-09-071-1/+1
| | | | | Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: Convert e2fsck to new bitmap interfaceValerie Aurora Henson2009-08-221-23/+23
| | | | | Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Add empty function for init_resource_track() and print_resource_track()Ken Chen2009-05-281-16/+2
| | | | | | | | in the case of ! defined RESOURCE_TRACK, so that we can clean up #ifdef throughout e2fsck source. Signed-off-by: Ken Chen <kenchen@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Remove trailing whitespace for the entire source treeTheodore Ts'o2008-08-271-31/+31
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Add support for the HUGE_FILE featureTheodore Ts'o2008-04-171-3/+3
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Add I/O statistics to e2fsckTheodore Ts'o2007-08-031-3/+4
| | | | | | | | This patch instruments the libext2fs unix I/O manager and adds bytes read/written and data rate to e2fsck -tt pass/overall timing output. Signed-off-by: Jim Garlick <garlick@llnl.gov> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Rework e2fsck's dirinfo abstraction to be more friendly for databasesTheodore Ts'o2007-04-041-47/+42
| | | | | | | | | | Change the iterator abstraction and replace e2fsck_get_dir_info() with e2fsck_dir_info_{set,get}_{parent,dotdot} so that we can support an on-disk dirinfo implementation. This allows e2fsck to check very large filesystems on systems with smaller amounts of memory and/or address space. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Fix e2fsck to set the filetype of '..' when connecting a dir, to lost+foundTheodore Ts'o2007-03-311-0/+6
| | | | | | | | | | | | | | | 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>