mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-23 10:04:01 +08:00
e2fsck: check xattr 'system.data' before setting inline_data feature
ext2fs_inline_data_size will happy return 0 and set size to EXT4_MIN_INLINE_DATA_SIZE even when inode doesn't have xattr 'system.data', a corrupted i_flags could make e2fsck enable the inline_data on the superblock. We should only offer to enable inline_data when i_flags is set and xattr 'system.data' can be found. Also use correct prompt for PR_1_INLINE_DATA_FEATURE. Signed-off-by: Li Dongyang <dongyangli@ddn.com>
This commit is contained in:
parent
1dc6d6e33a
commit
4a11f49957
@ -1496,8 +1496,8 @@ void e2fsck_pass1(e2fsck_t ctx)
|
||||
(ino >= EXT2_FIRST_INODE(fs->super))) {
|
||||
size_t size = 0;
|
||||
|
||||
pctx.errcode = ext2fs_inline_data_size(fs, ino, &size);
|
||||
if (!pctx.errcode && size &&
|
||||
pctx.errcode = get_inline_data_ea_size(fs, ino, &size);
|
||||
if (!pctx.errcode &&
|
||||
fix_problem(ctx, PR_1_INLINE_DATA_FEATURE, &pctx)) {
|
||||
ext2fs_set_feature_inline_data(sb);
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
|
@ -1063,7 +1063,7 @@ static struct e2fsck_problem problem_table[] = {
|
||||
/* Inode has inline data, but superblock is missing INLINE_DATA feature */
|
||||
{ PR_1_INLINE_DATA_FEATURE,
|
||||
N_("@i %i has inline data, but @S is missing INLINE_DATA feature\n"),
|
||||
PROMPT_CLEAR, PR_PREEN_OK, 0, 0, 0 },
|
||||
PROMPT_FIX, PR_PREEN_OK, 0, 0, 0 },
|
||||
|
||||
/* inode has INLINE_DATA_FL flag on filesystem without inline data */
|
||||
{ PR_1_INLINE_DATA_SET,
|
||||
|
26
tests/f_inlinedata_flags/expect.1
Normal file
26
tests/f_inlinedata_flags/expect.1
Normal file
@ -0,0 +1,26 @@
|
||||
Pass 1: Checking inodes, blocks, and sizes
|
||||
Inode 12 has INLINE_DATA_FL flag on filesystem without inline data support.
|
||||
Clear? yes
|
||||
|
||||
Inode 13 has inline data, but superblock is missing INLINE_DATA feature
|
||||
Fix? yes
|
||||
|
||||
Pass 2: Checking directory structure
|
||||
Entry '1' in / (2) has deleted/unused inode 12. Clear? yes
|
||||
|
||||
Pass 3: Checking directory connectivity
|
||||
Pass 4: Checking reference counts
|
||||
Pass 5: Checking group summary information
|
||||
Inode bitmap differences: -12
|
||||
Fix? yes
|
||||
|
||||
Free inodes count wrong for group #0 (243, counted=244).
|
||||
Fix? yes
|
||||
|
||||
Free inodes count wrong (243, counted=244).
|
||||
Fix? yes
|
||||
|
||||
|
||||
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
|
||||
test_filesys: 12/256 files (0.0% non-contiguous), 1143/8192 blocks
|
||||
Exit status is 1
|
7
tests/f_inlinedata_flags/expect.2
Normal file
7
tests/f_inlinedata_flags/expect.2
Normal file
@ -0,0 +1,7 @@
|
||||
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: 12/256 files (0.0% non-contiguous), 1143/8192 blocks
|
||||
Exit status is 0
|
BIN
tests/f_inlinedata_flags/image.gz
Normal file
BIN
tests/f_inlinedata_flags/image.gz
Normal file
Binary file not shown.
1
tests/f_inlinedata_flags/name
Normal file
1
tests/f_inlinedata_flags/name
Normal file
@ -0,0 +1 @@
|
||||
check incorrect inline_data flags
|
Loading…
Reference in New Issue
Block a user