Handle a race between device_pager and devsw in a more graceful manner:

return an error code rather than panic the kernel.

Sponsored by:	Sandvine Incorporated
Reviewed by:	kib
Tested by:	pho
MFC after:	2 weeks
This commit is contained in:
Attilio Rao 2011-07-06 15:09:52 +00:00
parent acfc07098c
commit 91a1929f07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223823

View File

@ -217,8 +217,10 @@ dev_pager_getpages(object, m, count, reqpage)
memattr = object->memattr;
VM_OBJECT_UNLOCK(object);
csw = dev_refthread(dev, &ref);
if (csw == NULL)
panic("dev_pager_getpage: no cdevsw");
if (csw == NULL) {
VM_OBJECT_LOCK(object);
return (VM_PAGER_FAIL);
}
td = curthread;
fpop = td->td_fpop;
td->td_fpop = NULL;