mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
Kernel: Use u64 instead of size_t in the STORAGE_DEVICE_GET_SIZE ioctl
This ensures the device size doesn't get truncated on i686.
This commit is contained in:
parent
d1ed554dc8
commit
971ab3b919
Notes:
sideshowbarker
2024-07-17 20:14:01 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/971ab3b919a Pull-request: https://github.com/SerenityOS/serenity/pull/12132 Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/tomuta ✅
|
@ -189,8 +189,8 @@ ErrorOr<void> StorageDevice::ioctl(OpenFileDescription&, unsigned request, Users
|
|||
{
|
||||
switch (request) {
|
||||
case STORAGE_DEVICE_GET_SIZE: {
|
||||
size_t disk_size = m_max_addressable_block * block_size();
|
||||
return copy_to_user(static_ptr_cast<size_t*>(arg), &disk_size);
|
||||
u64 disk_size = m_max_addressable_block * block_size();
|
||||
return copy_to_user(static_ptr_cast<u64*>(arg), &disk_size);
|
||||
break;
|
||||
}
|
||||
case STORAGE_DEVICE_GET_BLOCK_SIZE: {
|
||||
|
|
|
@ -10,11 +10,10 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void fetch_ioctl(int fd, int request)
|
||||
{
|
||||
size_t value;
|
||||
u64 value;
|
||||
if (ioctl(fd, request, &value) < 0) {
|
||||
perror("ioctl");
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in a new issue