mbox series

[0/3] xfs: fix perag iteration raciness

Message ID 20211007125053.1096868-1-bfoster@redhat.com (mailing list archive)
Headers show
Series xfs: fix perag iteration raciness | expand

Message

Brian Foster Oct. 7, 2021, 12:50 p.m. UTC
Hi all,

This adds an iteration function to the perag iteration macros to tweak
the logic and avoid some raciness with growfs when relying on the
presence of xfs_perag structures. This manifests as a couple assert
failures reproduced by xfs/104 (which only seem to reproduce on ppc64le
at the moment; I haven't really dug into why).

This probably could use a couple more patches tacked on: one to fix up
the tag based lookup macro and another to audit the existing callers and
remove any spurious xfs_perag_put() calls. I don't think the former is
currently an issue an practice, but we should probably eliminate the
flaw regardless. I'm just sending the initial fixup on its own as a
first pass..

Brian

Brian Foster (3):
  xfs: fold perag loop iteration logic into helper function
  xfs: rename the next_agno perag iteration variable
  xfs: terminate perag iteration reliably on end agno

 fs/xfs/libxfs/xfs_ag.h | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)