kernel - Fix TRIM bugs in UFS
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 2 Jan 2017 01:52:23 +0000 (17:52 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 2 Jan 2017 01:52:23 +0000 (17:52 -0800)
commit53005b098da18ed02da4c57627c0c2a29a957f37
tree264cb3b6c0d857dc2c789a5d1620412bc58faeb8
parentda2da42072639bd7158bf0dcea4ba34bdcfebd67
kernel - Fix TRIM bugs in UFS

* Fix serious bug in devfs's implementation of VOP_FREEBLKS.  devfs was
  running this operation asynchronously, but callers (aka UFS) expect it
  to run synchronously.

* Fix minor bug in CAM related to TRIM failures.

* Enforce block count limitations in NVMe for WRITEZ.

* Mostly applicable to NVMe, which will implement FREEBLKS using the WRITEZ
  command (at least for now).  Trim is disabled on SATA SSDs by default in
  the driver.

  Fixes UEFI booting issues with NVMe when using a UFS /boot.  Writing or
  updating the UFS /boot mounted via NVMe resulted in a corrupt partition due
  to the asynchronous VOP_FREEBLKS that we fixed above.

Reported-by: mneumann.
sys/bus/cam/scsi/scsi_da.c
sys/dev/disk/nvme/nvme_disk.c
sys/vfs/devfs/devfs_vnops.c