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:
parent
a7291500f1
commit
b2350565ba
@ -1770,12 +1770,14 @@ devfs_io(fs_volume *volume, fs_vnode *_vnode, void *_cookie,
|
||||
|| (!isWrite && !vnode->stream.u.dev.device->HasRead()))
|
||||
&& !vnode->stream.u.dev.device->HasIO())
|
||||
|| cookie == NULL) {
|
||||
request->SetStatusAndNotify(B_NOT_ALLOWED);
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
if (vnode->stream.u.dev.partition != NULL) {
|
||||
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;
|
||||
}
|
||||
translate_partition_access(vnode->stream.u.dev.partition, request);
|
||||
|
Loading…
Reference in New Issue
Block a user