vfs: fs freeze fix for 5.10-rc4
Hi Linus,
Please pull this branch containing a single vfs fix for 5.10-rc4. A very long time ago, a hack was added to the vfs fs freeze protection code to work around lockdep complaints about XFS, which would try to run a transaction (which requires intwrite protection) to finalize an xfs freeze (by which time the vfs had already taken intwrite).
Fast forward a few years, and XFS fixed the recursive intwrite problem on its own, and the hack became unnecessary. Fast forward almost a decade, and latent bugs in the code converting this hack from freeze flags to freeze locks combine with lockdep bugs to make this reproduce frequently enough to notice page faults racing with freeze.
Since the hack is unnecessary and causes thread race errors, just get rid of it completely. Pushing this kind of vfs change midway through a cycle makes me nervous, but a large enough number of the usual VFS/ext4/XFS/btrfs suspects have said this looks good and solves a real problem vector, so I'm sending this for your consideration instead of holding off until 5.11.
The branch merges cleanly with upstream as of a few minutes ago, so please let me know if anything strange happens.
--D
The following changes since commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec:
Linux 5.10-rc1 (2020-10-25 15:14:11 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/vfs-5.10-fixes-1
for you to fetch changes up to 22843291efc986ce7722610073fcf85a39b4cb13:
vfs: remove lockdep bogosity in __sb_start_write (2020-11-10 16:49:29 -0800)
----------------------------------------------------------------
VFS fixes for 5.10-rc4:
- Finally remove the "convert to trylock" weirdness in the fs freezer code. It was necessary 10 years ago to deal with nested transactions in XFS, but we've long since removed that; and now this is causing subtle race conditions when lockdep goes offline and sb_start_* aren't prepared to retry a trylock failure.
----------------------------------------------------------------
Darrick J. Wong (1):
vfs: remove lockdep bogosity in __sb_start_write
fs/super.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-)
Quoted 7 lines · Darrick J. Wong
Since the hack is unnecessary and causes thread race errors, just get rid of it completely. Pushing this kind of vfs change midway through a cycle makes me nervous, but a large enough number of the usual VFS/ext4/XFS/btrfs suspects have said this looks good and solves a real problem vector, so I'm sending this for your consideration instead of holding off until 5.11.
Not a fan of the timing, but you make a good argument, and I love seeing code removal. So I took it.
And once I took the real code change, the two cleanups looked like the least of the problem, so I took them too.
I ended up doing it all just as a single pull, since it seemed pointless to make history more complicated just to separate out the cleanups in a separate pull.
Now I really hope this won't cause any problems, but it certainly _looks_ harmless.
Linus
The pull request you sent on Fri, 13 Nov 2020 15:38:47 -0800:
The pull request you sent on Fri, 13 Nov 2020 15:38:47 -0800:
Quoted 1 line
git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.gittags/vfs-5.10-fixes-1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/8a3c84b649b033024d2349f96234b26cbd6083a6
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html
Quoted 11 lines · Linus Torvalds
Quoted 7 lines · Darrick J. Wong
Since the hack is unnecessary and causes thread race errors, just get rid of it completely. Pushing this kind of vfs change midway through a cycle makes me nervous, but a large enough number of the usual VFS/ext4/XFS/btrfs suspects have said this looks good and solves a real problem vector, so I'm sending this for your consideration instead of holding off until 5.11.
Not a fan of the timing, but you make a good argument, and I love seeing code removal. So I took it.
Thanks! Admittedly this is super late because it didn't occur to me until after -rc1 that the periodic hangs I saw in for-next were related to lockdep being broken and weren't some other weird vfs/xfs breakage; and then I wanted to spin this patch through my internal testing systems for a week to convince myself that changing the freeze locking code wasn't totally nuts. :)
--D
Quoted 12 lines
And once I took the real code change, the two cleanups looked like the least of the problem, so I took them too.
I ended up doing it all just as a single pull, since it seemed pointless to make history more complicated just to separate out the cleanups in a separate pull.
Now I really hope this won't cause any problems, but it certainly _looks_ harmless.
Linus