Bail as soon as the first write request has failed, there is no point

in trying the second write if the first one went nowhere.
This commit is contained in:
Poul-Henning Kamp 2003-04-26 21:40:26 +00:00
parent 54d2011343
commit c08c56e02a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114088

View File

@ -597,8 +597,17 @@ g_bde_worker(void *arg)
mtx_unlock(&sc->worklist_mutex);
g_bde_crypt_write(wp);
mtx_lock(&sc->worklist_mutex);
g_bde_start_write(wp->sp);
g_bde_start_write(wp->ksp);
error = g_bde_start_write(wp->sp);
if (error) {
g_bde_contribute(wp->bp, wp->length, error);
g_bde_release_keysector(wp);
g_bde_delete_sector(sc, wp->sp);
g_bde_delete_work(wp);
break;
}
error = g_bde_start_write(wp->ksp);
if (wp->error == 0)
wp->error = error;
break;
case BIO_DELETE:
wp->state = FINISH;