EXT4_FEATURE_INCOMPAT_INLINE_DATA);
if (inlinedata_fs && (inode->i_flags & EXT4_INLINE_DATA_FL)) {
size_t size;
+ __u32 dotdot;
+ unsigned int rec_len;
+ struct ext2_dir_entry de;
if (ext2fs_inline_data_size(ctx->fs, pctx->ino, &size))
return;
*/
if (size & 3)
return;
+ /*
+ * If the first 10 bytes don't look like a directory entry,
+ * it's probably not a directory.
+ */
+ memcpy(&dotdot, inode->i_block, sizeof(dotdot));
+ memcpy(&de, ((char *)inode->i_block) + EXT4_INLINE_DATA_DOTDOT_SIZE,
+ EXT2_DIR_REC_LEN(0));
+ dotdot = ext2fs_le32_to_cpu(dotdot);
+ de.inode = ext2fs_le32_to_cpu(de.inode);
+ de.rec_len = ext2fs_le16_to_cpu(de.rec_len);
+ ext2fs_get_rec_len(ctx->fs, &de, &rec_len);
+ if (dotdot >= ctx->fs->super->s_inodes_count ||
+ (dotdot < EXT2_FIRST_INO(ctx->fs->super) &&
+ dotdot != EXT2_ROOT_INO) ||
+ de.inode >= ctx->fs->super->s_inodes_count ||
+ (de.inode < EXT2_FIRST_INO(ctx->fs->super) &&
+ de.inode != 0) ||
+ rec_len > EXT4_MIN_INLINE_DATA_SIZE -
+ EXT4_INLINE_DATA_DOTDOT_SIZE)
+ return;
/* device files never have a "system.data" entry */
goto isdir;
} else if (extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) {
Inode 28 is a unknown file type with mode 00 but it looks like it is really a directory.
Fix? yes
-Inode 36 is a unknown file type with mode 00 but it looks like it is really a directory.
-Fix? yes
-
-Inode 36, i_size is 5, should be 60. Fix? yes
-
Pass 2: Checking directory structure
Directory inode 20, block #0, offset 4: directory corrupted
Salvage? yes
Directory inode 32, block #0, offset 4: directory corrupted
Salvage? yes
-Entry '..' in ??? (36) has invalid inode #: 1633774699.
-Clear? yes
-
-Directory inode 36, block #0, offset 4: directory corrupted
-Salvage? yes
-
Symlink /3 (inode #14) is invalid.
Clear? yes
Inode 38 (/B) has invalid mode (00).
Clear? yes
-Entry 'A' in / (2) has an incorrect filetype (was 1, should be 2).
-Fix? yes
+Inode 36 (/A) has invalid mode (00).
+Clear? yes
Pass 3: Checking directory connectivity
-'..' in /A (36) is ??? (1633774699), should be / (2).
-Fix? yes
-
-Error while adjusting inode count on inode 0
Pass 4: Checking reference counts
Unattached zero-length inode 22. Clear? yes
Unattached zero-length inode 35. Clear? yes
-Inode 36 ref count is 1, should be 2. Fix? yes
-
Pass 5: Checking group summary information
-Directories count wrong for group #0 (7, counted=8).
-Fix? yes
-
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
-test_filesys: 28/128 files (0.0% non-contiguous), 18/512 blocks
+test_filesys: 27/128 files (0.0% non-contiguous), 18/512 blocks
Exit status is 1
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
-test_filesys: 28/128 files (0.0% non-contiguous), 18/512 blocks
+test_filesys: 27/128 files (0.0% non-contiguous), 18/512 blocks
Exit status is 0
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Special (device/socket/fifo) file (inode 12) has extents
+or inline-data flag set. Clear? yes
+
+Special (device/socket/fifo) inode 12 has non-zero size. Fix? yes
+
+Inode 13 is a named pipe but it looks like it is really a directory.
+Fix? yes
+
+Pass 2: Checking directory structure
+Entry 'moo' in / (2) has an incorrect filetype (was 1, should be 5).
+Fix? yes
+
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 13/128 files (0.0% non-contiguous), 17/512 blocks
+Exit status is 1
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 13/128 files (0.0% non-contiguous), 17/512 blocks
+Exit status is 0
--- /dev/null
+detect inline dirs correctly