Open-CAS / open-cas-linux

Open CAS Linux
https://open-cas.com
BSD 3-Clause "New" or "Revised" License
219 stars 82 forks source link

Close block devices in a synchronous manner #1481

Closed mmichal10 closed 3 months ago

mmichal10 commented 3 months ago

fput() doesn't wait for all references on the disk to be unclaimed but instead it only schedules a worker that is supposed to cleanup resources once the device is released.

During cache initialization we open device at least twice - to check its properties and then to actually use it as cache. But since we use the async fput() after the probe, the device might still be in use once we try to open it for the second time (the second open returns -EBUSY).

Using synchronous __fput_sync() to close the device fixes the issue