2022-03-25 20:16:41

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH v2] ext4: truncate during setxattr leads to kernel panic

On Sat, 12 Mar 2022 18:18:30 -0500, Artem Blagodarenko wrote:
> From: Andrew Perepechko <[email protected]>
>
> When changing a large xattr value to a different large xattr value,
> the old xattr inode is freed. Truncate during the final iput causes
> current transaction restart. Eventually, parent inode bh is marked
> dirty and kernel panic happens when jbd2 figures out that this bh
> belongs to the committed transaction.
>
> [...]

Applied, thanks!

[1/1] ext4: truncate during setxattr leads to kernel panic
commit: c7cded845fc192cc35a1ca37c0cd957ee35abdf8

Best regards,
--
Theodore Ts'o <[email protected]>


2022-03-31 18:35:06

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH v2] ext4: truncate during setxattr leads to kernel panic

On Fri, Mar 25, 2022 at 02:49:50PM -0400, Theodore Ts'o wrote:
> On Sat, 12 Mar 2022 18:18:30 -0500, Artem Blagodarenko wrote:
> > From: Andrew Perepechko <[email protected]>
> >
> > When changing a large xattr value to a different large xattr value,
> > the old xattr inode is freed. Truncate during the final iput causes
> > current transaction restart. Eventually, parent inode bh is marked
> > dirty and kernel panic happens when jbd2 figures out that this bh
> > belongs to the committed transaction.
> >
> > [...]
>
> Applied, thanks!
>
> [1/1] ext4: truncate during setxattr leads to kernel panic
> commit: c7cded845fc192cc35a1ca37c0cd957ee35abdf8

I'm going to drop this patch from the dev branch for now, due to the
issue pointed out here[1]. The solution, as suggested in [2], is we
need to use our own subsystem workqueue. Perhaps we can reuse
rsv_conversion_wq for that purpose (after renaming it, of course).

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/T/#u

- Ted