]> granicus.if.org Git - zfs/commitdiff
Reschedule processes on -ERESTARTSYS
authorArkadiusz Bubała <arkadiusz.bubala@open-e.com>
Thu, 6 Jul 2017 15:38:24 +0000 (17:38 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 6 Jul 2017 15:38:24 +0000 (08:38 -0700)
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

module/zfs/zvol.c

index 3e9f004ef3d78cd21a5f8b1debfa6ea26c60f329..4f1601ec63051c39848c1a519528560f677633c3 100644 (file)
@@ -1358,6 +1358,8 @@ out_mutex:
        mutex_exit(&zv->zv_state_lock);
        if (drop_suspend)
                rw_exit(&zv->zv_suspend_lock);
+       if (error == -ERESTARTSYS)
+               schedule();
 
        return (SET_ERROR(error));
 }