Skip to content

xfs: fix a couple xfs_buf_log_item shutdown problems

Brian Foster linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xfs: release bli from transaction properly on fs shutdownfs/xfs/xfs_trans_buf.c+14 -72 replies
2/2xfs: remove bli from AIL before release on transaction abortfs/xfs/xfs_buf_item.c+12 -92 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristoph HellwigCarlos MaiolinoDarrick J. Wong
SeriesR-b
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] xfs: fix a couple xfs_buf_log_item shutdown problems

Hi all,

This series fixes a couple filesystem shutdown corner cases related to dealing with the xfs_buf_log_item reference count. Patch 1 fixes a reference count leak that leads to an unmount hang due to a held buffer. Patch 2 fixes a premature free of the bli that leads to a panic due to use after free. Both of the above problems can be reproduced by running generic/388 in a loop (though it may require 100-200 iterations).

I was originally considering reworking the bli reference counting, but I don't have a clear idea on whether a cleaner solution is available atm. These isolated fixes are lower risk and resolve the associated problems, so should probably be considered independently regardless.

With these patches applied, generic/388 survives several thousand iterations and otherwise no regressions are observed in my tests. Thoughts, reviews, flames appreciated.

Brian

Brian Foster (2):
xfs: release bli from transaction properly on fs shutdown
xfs: remove bli from AIL before release on transaction abort

 fs/xfs/xfs_buf_item.c  | 21 ++++++++++++---------
 fs/xfs/xfs_trans_buf.c | 21 ++++++++++++++-------
 2 files changed, 26 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.5