make callbacks return early when canceling

even after driver->cancel() the store may complete commands successfully.
return early in this case, so we don't attempt to continue syncing.
This commit is contained in:
Oswald Buddenhagen 2012-07-29 23:15:12 +02:00
parent ea951a697f
commit 424e0e7221

View File

@ -246,6 +246,11 @@ msg_fetched( int sts, void *aux )
switch (sts) {
case DRV_OK:
INIT_SVARS(vars->aux);
if (check_cancel( svars )) {
free( vars->data.data );
vars->cb( SYNC_CANCELED, 0, vars );
return;
}
vars->msg->flags = vars->data.flags;
@ -482,16 +487,15 @@ check_ret( int sts, void *aux )
{
DECL_SVARS;
switch (sts) {
case DRV_CANCELED:
if (sts == DRV_CANCELED)
return 1;
case DRV_BOX_BAD:
INIT_SVARS(aux);
INIT_SVARS(aux);
if (sts == DRV_BOX_BAD) {
svars->ret |= SYNC_FAIL;
cancel_sync( svars );
return 1;
}
return 0;
return check_cancel( svars );
}
#define SVARS_CHECK_RET \