mbox series

[v2,0/3] xfs: fix two problem when recovery intents fails

Message ID 20230715063647.2094989-1-leo.lilong@huawei.com (mailing list archive)
Headers show
Series xfs: fix two problem when recovery intents fails | expand

Message

Long Li July 15, 2023, 6:36 a.m. UTC
This patch set fix two problem when recovery intents fails.

Patches 1-2 fix the possible problem that intent items not released.
When recovery intents, new intents items may be created during recovery
intents. if recovery fails, new intents items may be left in AIL or
leaks.

Patch 3 fix a uaf problem, when recovery intents fails, intent items
may be freed before done item commited.

v2:
 - change xfs_defer_pending_abort to static in patch 1
 - rewrite commit message in patch 2-3
 - rename xfs_defer_ops_capture_free to xfs_defer_ops_capture_abort, and
 add xfs_defer_pending_abort to the start of xfs_defer_ops_capture_abort

Long Li (3):
  xfs: factor out xfs_defer_pending_abort
  xfs: abort intent items when recovery intents fail
  xfs: make sure done item committed before cancel intents

 fs/xfs/libxfs/xfs_defer.c | 28 ++++++++++++++++++----------
 fs/xfs/libxfs/xfs_defer.h |  2 +-
 fs/xfs/xfs_log_recover.c  | 16 ++++++++--------
 3 files changed, 27 insertions(+), 19 deletions(-)