From: Darrick J. Wong Date: Sun, 10 Aug 2014 22:49:37 +0000 (-0400) Subject: e2fsck: be more careful in assuming inline_data inodes are directories X-Git-Tag: v1.43-WIP-2015-05-18~227 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4339c6d419a2209180487a1624ffbec0558cc0e4;p=tools%2Fe2fsprogs.git e2fsck: be more careful in assuming inline_data inodes are directories If a file is marked inline_data but its i_size isn't a multiple of four, it probably isn't an inline directory, because directory entries have sizes that are multiples of four. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 005e9e1..a473bd7 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -540,6 +540,12 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx, if (ext2fs_inline_data_size(ctx->fs, pctx->ino, &size)) return; + /* + * If the size isn't a multiple of 4, it's probably not a + * directory?? + */ + if (size & 3) + return; /* device files never have a "system.data" entry */ goto isdir; } else if (extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) {