]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
FreeBSD: fix panic due to tqid overflow
authorMateusz Guzik <mjg@FreeBSD.org>
Tue, 13 Oct 2020 20:40:09 +0000 (20:40 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Tue, 13 Oct 2020 20:40:09 +0000 (20:40 +0000)
commitc3f8f86efd5fdbf5701d41c47a7fc4cd3ccdc802
treee419830d0db71d4892cde272905183f223613834
parent3f8d55c6172770300afe904ed1f954975dd710c5
FreeBSD: fix panic due to tqid overflow

The 32-bit counter eventually wraps to 0 which is a sentinel for invalid
id.

Make it 64-bit on LP64 platforms and 0-check otherwise.

Note: Linux counterpart uses id stored per queue instead of a global.
I did not check going that way is feasible with the goal being the
minimal fix doing the job.

Reported by: YAMAMOTO Shigeru <shigeru@os-hackers.jp>
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D26759
sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c