HomeFreeBSD

Revert "Handle partial reads in zfs_read"

Description

Revert "Handle partial reads in zfs_read"

This reverts commit 59eab1093a361ca76849ca76b2ec079c8736e8e3.

The change suppressed EFAULT originating from uiomove(). The deadlock
avoidance mechanism implemented by vn_io_fault1() in the VFS handles
such errors by wiring the user pages and retrying, but this change
caused read() to return early instead. This can result in short I/O,
causing misbehaviour in some applications, and possibly other
consequences.

Until this is resolved somehow, revert the commit.

Approved by: mm

Details

Provenance
markjAuthored on Oct 22 2021, 6:55 PM
Parents
rG6aae3517ed25: Retire synchronous PPP kernel driver sppp(4).
Branches
Unknown
Tags
Unknown
Reverts
rG59eab1093a36: Handle partial reads in zfs_read

Event Timeline

Forgive me if there's an obvious link on Phabricator I'm overlooking, but is there a testcase or bug report that demonstrates how this is broken? I'd like to figure out where this behavior is and isn't wrong, and hopefully revise the patch...

Forgive me if there's an obvious link on Phabricator I'm overlooking, but is there a testcase or bug report that demonstrates how this is broken? I'd like to figure out where this behavior is and isn't wrong, and hopefully revise the patch...

You're not overlooking anything. I don't have a reduced test case yet. I just saw some toolchain program crashes resulting from mishandling of short reads, and a couple of reports of similar problems on the mailing lists. I'll try and narrow it down this weekend so I can submit a proper bug report.

Forgive me if there's an obvious link on Phabricator I'm overlooking, but is there a testcase or bug report that demonstrates how this is broken? I'd like to figure out where this behavior is and isn't wrong, and hopefully revise the patch...

You're not overlooking anything. I don't have a reduced test case yet. I just saw some toolchain program crashes resulting from mishandling of short reads, and a couple of reports of similar problems on the mailing lists. I'll try and narrow it down this weekend so I can submit a proper bug report.

Done now: https://github.com/openzfs/zfs/issues/12694