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:
Christian Schwarz
2025-05-23 12:11:01 +02:00
parent e086568e21
commit 7b5e3d6d40
+2 -6
View File
@@ -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,