[PATCH v2 0/2] gfs2: fix quota init duplicate scan on PREEMPT_RT

Jie Wang <[email protected]> Tue, 21 Apr 2026 16:32:05 +0000
Newsgroups dev.linux.lists.gfs2,dev.linux.lists.linux-rt-devel
Message-ID <[email protected]>
This series addresses the PREEMPT_RT issue reported by syzbot in
gfs2_quota_init() duplicate-id handling.

On PREEMPT_RT, taking a lockref reference under the quota hash bucket
bitlock may sleep and trigger "sleeping function called from invalid
context".

Patch 1 fixes that path by using a no-ref lookup, and implements
gfs2_qd_search_bucket() on top of the no-ref helper.

Patch 2 keeps duplicate-slot zeroing correctness adjustment separate,
and expresses it by moving qc++ to the for-loop third expression.

Changes in v2:
- Split v1 into two patches as requested.
- Implement gfs2_qd_search_bucket() on top of
  gfs2_qd_search_bucket_noref().
- Move qc++ into the for-loop third expression.

The qd_hash_table -> rhashtable conversion is a larger refactor and is
kept out of this bugfix series.

Jie Wang (2):
  gfs2: fix quota init duplicate scan
  gfs2: move quota_init qc iterator increment

 fs/gfs2/quota.c | 39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)

-- 
2.34.1