Quantcast
Viewing all articles
Browse latest Browse all 40

kernel - Fix races in disk iteration and diskctx handling

kernel - Fix races in disk iteration and diskctx handling

* Add disk->d_refs to prevent a disk structure from being destroyed out
  from under an iteration.

* Redo the disk_enumeration() API to use markers and d_refs.

* Make adjustments to the dsched API.  In particular, do not return
  unreferenced tdio pointers in situations where they aren't used by
  the caller.

* Properly implement the ref count on the tdio's, one for each of the two
  lists the tdio belongs to, and ensure that dsched_thread_io_alloc()
  keeps an extra ref on the tdio after releasing the diskctx lock to prevent
  it from being ripped out while the code is pondering whether to place
  the tdio on the tdctx list.

* When deleting the tdio's for a tdctx try to destroy the diskctx.  That is,
  simply dereferencing it from the thread is not sufficient.

* When deleting the tdio's for a diskctx try to destroy the tdctx.  That is,
  simply dereferencing it from the diskctx is not sufficient.

* Handle destroy/ref races.
  • [DBH] sys/kern/dsched/bfq/bfq_helper_thread.c
  • [DBH] sys/kern/dsched/fq/fq_core.c
  • [DBH] sys/kern/kern_dsched.c
  • [DBH] sys/kern/subr_disk.c
  • [DBH] sys/sys/disk.h
  • [DBH] sys/sys/dsched.h

Viewing all articles
Browse latest Browse all 40

Trending Articles