sd: flush cache when closing writable FD
authorsf <sf@openbsd.org>
Mon, 29 May 2017 14:08:49 +0000 (14:08 +0000)
committersf <sf@openbsd.org>
Mon, 29 May 2017 14:08:49 +0000 (14:08 +0000)
commit3c102e39dd4a727213d3cd2193bdec3bebab0fa3
tree049acac2af63bff4bca52a268ecb3109e1f8a36b
parenta34a8c9c6a452cfd716b8f8bd96df8edb08fa1fe
sd: flush cache when closing writable FD

Don't skip the cache flush until the last opening of the device is
closed. Otherwise, when umounting a writable partition while a different
partition is still mounted read-only, the necessary disk flush may be
delayed for a very long time.

ok krw@ deraadt@
sys/scsi/sd.c