* [PATCH] e2fsck: check xattr 'system.data' before setting inline_data feature
@ 2018-10-30 6:15 Li Dongyang
2018-11-15 17:54 ` Theodore Y. Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Li Dongyang @ 2018-10-30 6:15 UTC (permalink / raw)
To: linux-ext4; +Cc: Andreas Dilger
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.
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
---
e2fsck/pass1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 8abf0c33..45534388 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -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);
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] e2fsck: check xattr 'system.data' before setting inline_data feature
2018-10-30 6:15 [PATCH] e2fsck: check xattr 'system.data' before setting inline_data feature Li Dongyang
@ 2018-11-15 17:54 ` Theodore Y. Ts'o
2018-11-15 17:57 ` Theodore Y. Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Y. Ts'o @ 2018-11-15 17:54 UTC (permalink / raw)
To: Li Dongyang; +Cc: linux-ext4, Andreas Dilger
On Tue, Oct 30, 2018 at 05:15:01PM +1100, Li Dongyang wrote:
> 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.
>
> Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] e2fsck: check xattr 'system.data' before setting inline_data feature
2018-11-15 17:54 ` Theodore Y. Ts'o
@ 2018-11-15 17:57 ` Theodore Y. Ts'o
0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2018-11-15 17:57 UTC (permalink / raw)
To: Li Dongyang; +Cc: linux-ext4, Andreas Dilger
On Thu, Nov 15, 2018 at 12:54:31PM -0500, Theodore Y. Ts'o wrote:
> On Tue, Oct 30, 2018 at 05:15:01PM +1100, Li Dongyang wrote:
> > 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.
> >
> > Signed-off-by: Li Dongyang <dongyangli@ddn.com>
>
> Thanks, applied.
Oops, I see there's a V2 version of this patch.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-16 4:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 6:15 [PATCH] e2fsck: check xattr 'system.data' before setting inline_data feature Li Dongyang
2018-11-15 17:54 ` Theodore Y. Ts'o
2018-11-15 17:57 ` Theodore Y. Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).