From: David van Moolenbroek Date: Sat, 24 Aug 2013 10:29:39 +0000 (+0200) Subject: VFS: set w_drv_sendrec only when needed X-Git-Tag: v3.3.0~615 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/migration-4to9?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F943%2F2;p=minix.git 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 --- diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 2e285a6f9..4d0ce596d 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -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 */ }