Skip to contentSkip to conversation

e2fsck: check xattr 'system.data' before setting inline_data feature

PATCH Applied Li Dongyang 2 participants 3 messages Oct 30, 2018 – Nov 16, 2018

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 e2fsck/pass1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
e2fsck/pass1.c +2 -2
index 8abf0c33..45534388 100644
@@ -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);
Signature · 1 line
2.19.1
#1 lore raw
Quoted 9 lines · Li Dongyang

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.

Thanks, applied.

- Ted

#2 lore raw
Quoted 6 lines · Theodore Y. Ts'o
Quoted 5 lines · Li Dongyang

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.

Quoted 6 lines
Quoted 4 lines

We should only offer to enable inline_data when i_flags is set and xattr 'system.data' can be found.

Thanks, applied.

Oops, I see there's a V2 version of this patch.

- Ted