DragonFlyBSD/src 1991e94sys/dev/disk/vn vn.c, sys/dev/misc/snp snp.c

kernel - Fix devfs bitmap races for pty and other devices

* Use an internal lock to protect the integrity of bitmap
  operations for devfs_clone_bitmap_*() functions, allowing
  devices to use the functions without having to lock themselves.

* Devices which use devfs_clone_bitmap_chk() + devfs_clone_bitmap_set()
  sequences have to be more careful, either having their own covering
  lock or checking the return code from devfs_clone_bitmap_set() and
  looping.

* This fixes serious /dev/ptmx pty allocation races which become obvious
  when pty's are allocated concurrently at a high rate, such as by the
  dsynth code.
DeltaFile
+52-13sys/vfs/devfs/devfs_helper.c
+13-5sys/dev/disk/vn/vn.c
+7-3sys/dev/misc/snp/snp.c
+5-2sys/net/bpf.c
+1-1sys/sys/devfs.h
+78-245 files

UnifiedSplitRaw