From b2350565baa9c7b422c4a9bc1ac558ba636dd33c Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 3 Sep 2009 05:36:23 +0000 Subject: [PATCH] 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 --- src/system/kernel/device_manager/devfs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/device_manager/devfs.cpp b/src/system/kernel/device_manager/devfs.cpp index d7891f726e..e4ef7109eb 100644 --- a/src/system/kernel/device_manager/devfs.cpp +++ b/src/system/kernel/device_manager/devfs.cpp @@ -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);