1. 30 Nov, 2021 1 commit
    • Warner Losh's avatar
      Make device_busy/unbusy work w/o Giant held · 08e78191
      Warner Losh authored
      The vast majority of the busy/unbusy users in the tree don't acquire Giant
      before calling device_busy/unbusy. However, if multiple threads are opening a
      file, say, that causes the device to busy/unbusy, then we can race to the root
      marking things busy. Create a new device_busy_locked and device_unbusy_locked
      that are the current implemntations of device_busy and device_unbusy. Make
      device_busy and unbusy acquire Giant before calling the _locked versrions. Since
      we never sleep in the busy/unbusy path, Giant's single threaded semantics
      suffice to keep this safe.
      
      Sponsored by:		Netflix
      Reviewed by:		hselasky, jhb
      Differential Revision:	https://reviews.freebsd.org/D26284
      08e78191
  2. 01 Dec, 2021 1 commit
    • Chuck Tuffli's avatar
      bhyve blockif: fix blockif_candelete with Capsicum · d8c1d7b6
      Chuck Tuffli authored
      NVMe conformance tests for the Format command failed if the
      backing-storage for the bhyve device was a file instead of a Zvol. The
      tests (and the specification) expect a Format to destroy all previously
      written data. The bhyve NVMe emulation implements this by trimming /
      deallocating all data from the backing-storage.
      
      The blockif_candelete() function indicated the file did not support
      deallocation (i.e. fpathconf(..., _PC_DEALLOC_PRESENT) returned FALSE)
      even though the kernel supported file hole punching. This occurs on
      builds with Capsicum enabled because blockif did not allow the
      fpathconf(2) right.
      
      Fix is to add CAP_FPATHCONF to the cap_rights_init(3) call.
      
      PR:		260081
      Reviewed by:	allanjude, markj, jhb
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D33203
      d8c1d7b6
  3. 30 Nov, 2021 38 commits