Reschedule processes on -ERESTARTSYS

On the single core machine the system may hang when the
spa_namespare_lock acquisition fails in the zvol_first_open
function. It returns -ERESTARTSYS error what causes the
endless loop in __blkdev_get function.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Arkadiusz Bubała <arkadiusz.bubala@open-e.com>
Closes #6283 
Closes #6312
This commit is contained in:
Arkadiusz Bubała 2017-07-06 17:38:24 +02:00 committed by Brian Behlendorf
parent 9c3dcab5e2
commit 94b25662c5
1 changed files with 2 additions and 0 deletions

View File

@ -1358,6 +1358,8 @@ out_mutex:
mutex_exit(&zv->zv_state_lock); mutex_exit(&zv->zv_state_lock);
if (drop_suspend) if (drop_suspend)
rw_exit(&zv->zv_suspend_lock); rw_exit(&zv->zv_suspend_lock);
if (error == -ERESTARTSYS)
schedule();
return (SET_ERROR(error)); return (SET_ERROR(error));
} }