]> git.ipfire.org Git - thirdparty/linux.git/commit
gfs2: fix quota init duplicate scan
authorJie Wang <jie.wang@intel.com>
Thu, 23 Apr 2026 13:39:34 +0000 (13:39 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 23 Apr 2026 07:18:08 +0000 (09:18 +0200)
commitb99a1f0f18ee50445907f55069e88bcfd8947383
treed0289641f1d36b721c953d8d0d8390f4d3af189c
parent4da0dd95be3b0321bf9687fb1a3c2fed3319c032
gfs2: fix quota init duplicate scan

gfs2_quota_init() checks for duplicate quota_change IDs while holding
qd_lock and the quota hash bucket bitlock. That path used
gfs2_qd_search_bucket(), which takes a lockref reference via
lockref_get_not_dead().

On PREEMPT_RT this may sleep, which is not allowed under the bucket
bitlock, triggering "sleeping function called from invalid context".

Use a no-ref bucket lookup in this path, then continue duplicate
handling without taking a lockref there.

Refactor gfs2_qd_search_bucket() to build on top of the no-ref helper
so lookup traversal stays in one place.

This patch fixes a bug reported by syzbot.

Reported-by: syzbot+642d0561f78362d67d3f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=642d0561f78362d67d3f
Tested-by: syzbot+642d0561f78362d67d3f@syzkaller.appspotmail.com
Signed-off-by: Jie Wang <jie.wang@intel.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/quota.c