kernel - Refuse to swapoff under certain conditions
commit46b71cbec8385411cb5105d75a02b8336c76b13e
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 6 Oct 2017 05:59:40 +0000 (5 22:59 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 6 Oct 2017 06:25:06 +0000 (5 23:25 -0700)
tree29b26e72aaee64e0e966058a6e6abbd508c819f4
parent24bdeb698d15c8ef4c3f92e348a0e7348ac89aeb
kernel - Refuse to swapoff under certain conditions

* Both tmpfs and vn can't handle swapoff's method of bringing pages
  back in from the swap partition being decomissioned.

* Fixing this properly is fairly involved. The normal swapoff procedure
  is to page swap into the related VM object, but tmpfs and vn use their
  VM objects ONLY to track swap blocks and not for vm_page manipulation,
  so that just won't work.  In addition, the swap code may associate
  a swap block with a VM object before issuing the write I/O to page
  out the data, and the swapoff code's asynchronous pagein might cause
  problems.

  For now, just make sure that swapoff refuses to remove the partition
  under these conditions, so it doesn't blow up tmpfs or vn.
sys/dev/disk/vn/vn.c
sys/vfs/tmpfs/tmpfs_subr.c
sys/vm/swap_pager.c
sys/vm/vm_object.h