summaryrefslogtreecommitdiff
tag namefix-bmap-intent-recovery-5.10_2020-10-05 (cd315de32631f96f79ae9dcbe058903d02b8864b)
tag date2020-10-05 11:15:11 -0700
tagged byDarrick J. Wong <darrick.wong@oracle.com>
tagged objectcommit 6ac30f50ed...
xfs: fix inode use-after-free during log recovery
In this second series, I try to fix a use-after-free that I discovered during development of the dfops freezer, where BUI recovery releases the inode even if it requeues itself. If the inode gets reclaimed, the fs corrupts memory and explodes. The fix is to make the dfops capture struct take over ownership of the inodes if there's any more work to be done. This is a bit clunky, but it's a simpler mechanism than saving inode pointers and inode numbers and introducing tagged structures so that we can distinguish one from the other. v2: rebase atop the new defer capture code v3: only capture one inode, move as much of the defer capture code to xfs_defer.c as we can v4: make defer capture ihold the inode, and the caller still gets to iunlock and irele it