* will offer to reconnect it to /lost+found. While it is chasing
* parent pointers up the filesystem tree, if pass3 sees a directory
* twice, then it has detected a filesystem loop, and it will again
- * offer to reconnect the directory to /lost+found in to break the
+ * offer to reconnect the directory to /lost+found in order to break the
* filesystem loop.
*
* Pass 3 also contains the subroutine, e2fsck_reconnect_file() to
* If it was marked done already, then we've reached a
* parent we've already checked.
*/
- if (ext2fs_mark_inode_bitmap2(inode_done_map, ino))
+ if (ext2fs_mark_inode_bitmap2(inode_done_map, ino))
break;
if (e2fsck_dir_info_get_parent(ctx, ino, &parent)) {
*/
if (!parent ||
(loop_pass &&
- (ext2fs_test_inode_bitmap2(inode_loop_detect,
- parent)))) {
+ ext2fs_test_inode_bitmap2(inode_loop_detect, parent))) {
pctx->ino = ino;
- if (fix_problem(ctx, PR_3_UNCONNECTED_DIR, pctx)) {
- if (e2fsck_reconnect_file(ctx, pctx->ino))
+ if (parent)
+ pctx->dir = parent;
+ else
+ ext2fs_lookup(fs, ino, "..", 2, NULL,
+ &pctx->dir);
+ if (fix_problem(ctx, !parent ? PR_3_UNCONNECTED_DIR :
+ PR_3_LOOPED_DIR, pctx)) {
+ if (e2fsck_reconnect_file(ctx, pctx->ino)) {
ext2fs_unmark_valid(fs);
- else {
+ } else {
fix_dotdot(ctx, pctx->ino,
ctx->lost_and_found);
parent = ctx->lost_and_found;
/* Unconnected directory inode */
{ PR_3_UNCONNECTED_DIR,
/* xgettext:no-c-format */
- N_("Unconnected @d @i %i (%p)\n"),
+ N_("Unconnected @d @i %i (was in %q)\n"),
PROMPT_CONNECT, 0, 0, 0, 0 },
/* /lost+found not found */
N_("/@l is encrypted\n"),
PROMPT_CLEAR, 0, 0, 0, 0 },
+ /* Recursively looped directory inode */
+ { PR_3_LOOPED_DIR,
+ /* xgettext:no-c-format */
+ N_("Recursively looped @d @i %i (%p)\n"),
+ PROMPT_CONNECT, 0, 0, 0, 0 },
+
/* Pass 3A Directory Optimization */
/* Pass 3A: Optimizing directories */
/* Lost+found is encrypted */
#define PR_3_LPF_ENCRYPTED 0x03001B
+/* Recursively looped directory inode */
+#define PR_3_LOOPED_DIR 0x03001D
+
/*
* Pass 3a --- rehashing directories
*/
Clear? yes
Pass 3: Checking directory connectivity
-Unconnected directory inode 18 (/edir/???)
+Unconnected directory inode 18 (was in /edir)
Connect to /lost+found? yes
-Unconnected directory inode 24 (/edir/???)
+Unconnected directory inode 24 (was in /edir)
Connect to /lost+found? yes
-Unconnected directory inode 27 (/edir/???)
+Unconnected directory inode 27 (was in /edir)
Connect to /lost+found? yes
Pass 4: Checking reference counts
Pass 3: Checking directory connectivity
Root inode not allocated. Allocate? yes
-Unconnected directory inode 11 (...)
+Unconnected directory inode 11 (was in /)
Connect to /lost+found? yes
/lost+found not found. Create? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
-Unconnected directory inode 12 (/???)
+Unconnected directory inode 12 (was in /)
Connect to /lost+found? yes
/lost+found is encrypted
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
-Unconnected directory inode 11 (/???)
+Unconnected directory inode 11 (was in /)
Connect to /lost+found? yes
Pass 3A: Optimizing directories
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
-Unconnected directory inode 12 (/???)
+Unconnected directory inode 12 (was in /)
Connect to /lost+found? yes
/lost+found not found. Create? yes
-Unconnected directory inode 13 (/???)
+Unconnected directory inode 13 (was in /)
Connect to /lost+found? yes
Pass 4: Checking reference counts
Pass 3: Checking directory connectivity
Root inode not allocated. Allocate? yes
-Unconnected directory inode 11 (...)
+Unconnected directory inode 11 (was in /)
Connect to /lost+found? yes
/lost+found not found. Create? yes
-Unconnected directory inode 12 (...)
+Unconnected directory inode 12 (was in /lost+found)
Connect to /lost+found? yes
Pass 4: Checking reference counts
Fix? yes
Pass 3: Checking directory connectivity
-Unconnected directory inode 13 (<12>/<13>)
+Unconnected directory inode 13 (was in <12>)
Connect to /lost+found? yes
-Unconnected directory inode 14 (<12>/<14>)
+Unconnected directory inode 14 (was in <12>)
Connect to /lost+found? yes
-Unconnected directory inode 15 (<12>/<15>)
+Unconnected directory inode 15 (was in <12>)
Connect to /lost+found? yes
Pass 4: Checking reference counts
'..' in / (2) is <The NULL inode> (0), should be / (2).
Fix? yes
-Unconnected directory inode 11 (/???)
+Unconnected directory inode 11 (was in /)
Connect to /lost+found? yes
/lost+found not found. Create? yes
Clear? yes
Pass 3: Checking directory connectivity
-Unconnected directory inode 13 (/test/???)
+Unconnected directory inode 13 (was in /test)
Connect to /lost+found? yes
Pass 4: Checking reference counts
'..' in / (2) is <The NULL inode> (0), should be / (2).
Fix? yes
-Unconnected directory inode 11 (/???)
+Unconnected directory inode 11 (was in /)
Connect to /lost+found? yes
/lost+found not found. Create? yes