In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: only change active zone counter on successful (de)activation btrfs_zone_activate() unconditionally decrements the reserved_active_zones counter regardless if btrfs_dev_set_active_zone() fails to set the zone active, i.e. because it raced with another call that already set the bit in the bitmask, or not. This can lead to a double decrement of the counter in case the bit has already been set. Only decrement the counter *iff* btrfs_dev_set_active_zone() successfully marked the zone in the bitmap. Mirror this behaviour when clearing the bit again.
https://git.kernel.org/stable/c/aba46638426ee1739e86db61e4cc94559b5fb312
https://git.kernel.org/stable/c/a5639ba463867ad47bfab44e36c74cff0510d024
https://git.kernel.org/stable/c/5e79f39fbeea78703ac389c67a810406fa09bc94
https://git.kernel.org/stable/c/46a94be3ce1600b7dca4be4eee32aaa0d8ea17e3