diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2014-03-03 01:02:52 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-03-04 08:46:15 -0500 |
commit | 9676f3a94f4cece2458e5a13332c978832bb0ce7 (patch) | |
tree | 3d1705dd4f06ee740085ec17c032ac28bd632bd1 /e2fsck/pass3.c | |
parent | 6582dbe91b368ba01eb685d1314dd830fa00bde4 (diff) | |
download | e2fsprogs-9676f3a94f4cece2458e5a13332c978832bb0ce7.tar.gz |
e2fsck: check inline_data in pass3
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>
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r-- | e2fsck/pass3.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index aaf177cb..6f7f8559 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -376,6 +376,17 @@ ext2_ino_t e2fsck_get_lost_and_found(e2fsck_t ctx, int fix) if (retval && !fix) return 0; if (!retval) { + /* Lost+found shouldn't have inline data */ + retval = ext2fs_read_inode(fs, ino, &inode); + if (fix && retval) + return 0; + + if (fix && (inode.i_flags & EXT4_INLINE_DATA_FL)) { + if (!fix_problem(ctx, PR_3_LPF_INLINE_DATA, &pctx)) + return 0; + goto unlink; + } + if (ext2fs_check_directory(fs, ino) == 0) { ctx->lost_and_found = ino; return ino; @@ -388,6 +399,7 @@ ext2_ino_t e2fsck_get_lost_and_found(e2fsck_t ctx, int fix) if (!fix_problem(ctx, PR_3_LPF_NOTDIR, &pctx)) return 0; +unlink: /* OK, unlink the old /lost+found file. */ pctx.errcode = ext2fs_unlink(fs, EXT2_ROOT_INO, name, ino, 0); if (pctx.errcode) { |