Fix two problems in devfs_io:

* An off by one error prevented the very last block of a device to be accessed
  through IO.
* In case of error the request wasn't notified causing anyone (the page writer
  for example) to wait forever for the request to complete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32913 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-09-03 05:36:23 +00:00
parent a7291500f1
commit b2350565ba
1 changed files with 3 additions and 1 deletions

View File

@ -1770,12 +1770,14 @@ devfs_io(fs_volume *volume, fs_vnode *_vnode, void *_cookie,
|| (!isWrite && !vnode->stream.u.dev.device->HasRead())) || (!isWrite && !vnode->stream.u.dev.device->HasRead()))
&& !vnode->stream.u.dev.device->HasIO()) && !vnode->stream.u.dev.device->HasIO())
|| cookie == NULL) { || cookie == NULL) {
request->SetStatusAndNotify(B_NOT_ALLOWED);
return B_NOT_ALLOWED; return B_NOT_ALLOWED;
} }
if (vnode->stream.u.dev.partition != NULL) { if (vnode->stream.u.dev.partition != NULL) {
if (request->Offset() + request->Length() if (request->Offset() + request->Length()
>= vnode->stream.u.dev.partition->info.size) { > vnode->stream.u.dev.partition->info.size) {
request->SetStatusAndNotify(B_BAD_VALUE);
return B_BAD_VALUE; return B_BAD_VALUE;
} }
translate_partition_access(vnode->stream.u.dev.partition, request); translate_partition_access(vnode->stream.u.dev.partition, request);