In the Linux kernel, the following vulnerability has been resolved:
quota: flush quotareleasework upon quota writeback
One of the paths quota writeback is called from is:
freezesuper() syncfilesystem() ext4syncfs() dquotwritebackdquots()
Since we currently don't always flush the quotareleasework queue in this path, we can end up with the following race:
Kernel eventually tries to flush the workqueue while FS is frozen which hits a WARN_ON since transaction gets started during frozen state:
ext4journalcheckstart+0x28/0x110 [ext4] (unreliable) _ext4journalstartsb+0x64/0x1c0 [ext4] ext4releasedquot+0x90/0x1d0 [ext4] quotarelease_workfn+0x43c/0x4d0
Which is the following line:
WARNON(sb->swriters.frozen == SBFREEZECOMPLETE);
Which ultimately results in generic/390 failing due to dmesg noise. This was detected on powerpc machine 15 cores.
To avoid this, make sure to flush the workqueue during dquotwritebackdquots() so we dont have any pending workitems after freeze.