VFS: set w_drv_sendrec only when needed
As with w_task, this ensures that the field remains cleared if it is not used. Without this, worker_stop could mistakenly identify a thread as talking to a device driver rather than a (crashed) file server. Change-Id: I7d3ebed3efc3cd4f5c891f61c67a6463109b6376
This commit is contained in:
parent
7d02ecdbb4
commit
a75c47e5ac
1 changed files with 8 additions and 2 deletions
|
@ -559,8 +559,12 @@ int gen_opcl(
|
|||
if (op == DEV_OPEN && dp->dmap_style == STYLE_DEVA) {
|
||||
fp->fp_task = dp->dmap_driver;
|
||||
self->w_task = dp->dmap_driver;
|
||||
self->w_drv_sendrec = &dev_mess;
|
||||
|
||||
worker_wait();
|
||||
|
||||
self->w_task = NONE;
|
||||
self->w_drv_sendrec = NULL;
|
||||
}
|
||||
|
||||
if (is_bdev)
|
||||
|
@ -770,7 +774,6 @@ int asyn_io(endpoint_t drv_e, message *mess_ptr)
|
|||
int r;
|
||||
|
||||
assert(!IS_BDEV_RQ(mess_ptr->m_type));
|
||||
self->w_drv_sendrec = mess_ptr; /* Remember where result should be stored */
|
||||
|
||||
r = asynsend3(drv_e, mess_ptr, AMF_NOREPLY);
|
||||
|
||||
|
@ -894,8 +897,12 @@ int clone_opcl(
|
|||
/* Wait for reply when driver is asynchronous */
|
||||
fp->fp_task = dp->dmap_driver;
|
||||
self->w_task = dp->dmap_driver;
|
||||
self->w_drv_sendrec = &dev_mess;
|
||||
|
||||
worker_wait();
|
||||
|
||||
self->w_task = NONE;
|
||||
self->w_drv_sendrec = NULL;
|
||||
}
|
||||
|
||||
if (op == DEV_OPEN && dev_mess.REP_STATUS >= 0) {
|
||||
|
@ -1071,7 +1078,6 @@ void open_reply(void)
|
|||
return;
|
||||
}
|
||||
*wp->w_drv_sendrec = job_m_in;
|
||||
wp->w_drv_sendrec = NULL;
|
||||
worker_signal(wp); /* Continue open */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue