mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-17 01:03:00 +00:00
Revert "work around copy_to_user failure on reads"
Not necessary as of https://github.com/neondatabase-labs/neon-pagecache-kmod/commit/271b19bd3e2de7777770ac6b8b1b1c94bb33830b
Reason why that commit fixes the issues is
https://neondb.slack.com/archives/C08SXUSNFBP/p1747837985950309
> implemented a fix in the kernel module, no need for userspace to
> pre-fault mmapped pages in; the reason for the EFAULT was that we were
> holding a spinlock during copy_to_user, which disables preemption, which
> in turn makes the page fault handler give up and cause copy_to_user to
> fail; commit to be used is 271b19bd3e2de7777770ac6b8b1b1c94bb33830b
> (edited)
This reverts commit 7b818f8d64.
This commit is contained in:
@@ -1451,15 +1451,11 @@ pread_with_ioctl(void *buffer, uint64 blkno)
|
||||
|
||||
errno = 0;
|
||||
|
||||
elog(DEBUG1, "calling ioctl read for blk %lu with buffer=%p (shared_buffers is at %p-%p)",
|
||||
elog(LOG, "calling ioctl read for blk %lu with buffer=%p (shared_buffers is at %p-%p)",
|
||||
blkno,
|
||||
buffer,
|
||||
BufferBlocks,
|
||||
BufferBlocks + BLCKSZ * NBuffers);
|
||||
/* FIXME: touch the pages, so that copy_to_user doesn't fail in the kernel module */
|
||||
((char *) buffer)[0] = 'x';
|
||||
((char *) buffer)[4096] = 'x';
|
||||
|
||||
rc = ioctl(lfc_desc, NEON_IOCTL_READ, &args);
|
||||
if (rc >= 0)
|
||||
lfc_ctl->kernel_module_read_hits++;
|
||||
@@ -1484,7 +1480,7 @@ pwrite_with_ioctl(const void *buffer, uint64 blkno)
|
||||
};
|
||||
int rc;
|
||||
|
||||
elog(DEBUG1, "calling ioctl write for blk %lu with buffer=%p (shared_buffers is at %p-%p)",
|
||||
elog(LOG, "calling ioctl write for blk %lu with buffer=%p (shared_buffers is at %p-%p)",
|
||||
blkno,
|
||||
buffer,
|
||||
BufferBlocks,
|
||||
|
||||
Reference in New Issue
Block a user