From 902e0e27e0802c722957153ba3dda0b79b9ec94f Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Fri, 15 Jul 2011 14:11:34 +0000 Subject: [PATCH] Don't panic if owner has vanished before reply --- servers/vfs/select.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/servers/vfs/select.c b/servers/vfs/select.c index 705030785..6d84ff35e 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -777,18 +777,18 @@ int status; return; } - /* The filp must be busy waiting for a reply. */ - assert(f->filp_select_flags & FSF_BUSY); - assert(f->filp_count >= 1); /* There should be at least one owner */ - - /* Find vnode and check we got a reply from the device we expected */ - vp = f->filp_vno; - assert(vp != NULL); - assert((vp->v_mode & I_TYPE) == I_CHAR_SPECIAL); /* Must be char. special */ - if (vp->v_sdev != dev) { - printf("VFS (%s:%d): expected reply from dev %d not %d\n", - vp->v_sdev, dev); - return; + /* Is the filp still in use and busy waiting for a reply? The owner might + * have vanished before the driver was able to reply. */ + if (f->filp_count >= 1 && (f->filp_select_flags & FSF_BUSY)) { + /* Find vnode and check we got a reply from the device we expected */ + vp = f->filp_vno; + assert(vp != NULL); + assert((vp->v_mode & I_TYPE) == I_CHAR_SPECIAL); /* Must be char. special */ + if (vp->v_sdev != dev) { + printf("VFS (%s:%d): expected reply from dev %d not %d\n", + vp->v_sdev, dev); + return; + } } /* No longer waiting for a reply from this device */ -- 2.44.0