spa_config_tryenter incorrectly handles the multiple-lock case

Review Request #264 - Created Oct. 20, 2015 and submitted

Information
Saso Kiselkov
illumos-gate
Reviewers
openzfs
csiden

If spa_config_tryenter fails to acquire a particular lock, all locks that have been acquired in the mean time should be released. Unfortunately, the existing arithmetic in that case doesn't do that, so some locks can be left acquired.
Fix from Nexenta, originally reviewed internally by Alek Pinchuk and Josef 'Jeff' Sipek.

This is required for ZFS TRIM/UNMAP support, otherwise the code panicks when a "zpool trim <poolname>" command is issued before the last on-demand TRIM has finished.

Prashanth Sreenivasa
Saso Kiselkov
Saso Kiselkov
Saso Kiselkov
Matthew Ahrens
Dan McDonald
Saso Kiselkov
Review request changed

Status: Closed (submitted)

Steven Hartland
Ship It!
Loading...