All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] xfs: restore nofs context unconditionally in xfs_trans_roll
@ 2026-07-19  9:57 Yun Zhou
  2026-07-19  9:57 ` [PATCH v2 1/2] mm: introduce memalloc_flags_move() for transferring allocation scopes Yun Zhou
  2026-07-19  9:57 ` [PATCH v2 2/2] xfs: restore nofs context unconditionally in xfs_trans_roll Yun Zhou
  0 siblings, 2 replies; 6+ messages in thread
From: Yun Zhou @ 2026-07-19  9:57 UTC (permalink / raw)
  To: cem, djwong; +Cc: hch, willy, akpm, hwenwur, linux-xfs, linux-kernel, yun.zhou

xfs_trans_roll() loses the NOFS allocation context on the error path,
causing a circular lock dependency between xfs_nondir_ilock_class and
fs_reclaim reported by syzbot.  Fix this by transferring the nofs
context from the old transaction to the new one in xfs_trans_dup(),
so it remains active regardless of commit success or failure.

v2:
  - Instead of moving xfs_trans_set_context() before the error check,
    transfer the nofs context in xfs_trans_dup() via a new
    memalloc_flags_move() helper, as suggested by Darrick.
  - Change t_pflags from unsigned long to unsigned int to match mm API.

v1: https://lore.kernel.org/all/20260713035505.1635191-1-yun.zhou@windriver.com/T/

Yun Zhou (2):
  mm: introduce memalloc_flags_move() for transferring allocation scopes
  xfs: restore nofs context unconditionally in xfs_trans_roll

 fs/xfs/xfs_trans.c       |  9 +++------
 fs/xfs/xfs_trans.h       |  2 +-
 include/linux/sched/mm.h | 17 +++++++++++++++++
 3 files changed, 21 insertions(+), 7 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-20  8:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-19  9:57 [PATCH v2 0/2] xfs: restore nofs context unconditionally in xfs_trans_roll Yun Zhou
2026-07-19  9:57 ` [PATCH v2 1/2] mm: introduce memalloc_flags_move() for transferring allocation scopes Yun Zhou
2026-07-19 20:57   ` Andrew Morton
2026-07-20  4:43     ` Zhou, Yun
2026-07-19  9:57 ` [PATCH v2 2/2] xfs: restore nofs context unconditionally in xfs_trans_roll Yun Zhou
2026-07-20  8:39   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.