Commit 70f51f0e authored by Mark Johnston's avatar Mark Johnston
Browse files

Revert "Handle partial reads in zfs_read"

This reverts commit 59eab109.

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
parent 6aae3517
......@@ -254,7 +254,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
}
ASSERT(zfs_uio_offset(uio) < zp->z_size);
ssize_t start_offset = zfs_uio_offset(uio);
ssize_t n = MIN(zfs_uio_resid(uio), zp->z_size - zfs_uio_offset(uio));
ssize_t start_resid = n;
......@@ -277,13 +276,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
/* convert checksum errors into IO errors */
if (error == ECKSUM)
error = SET_ERROR(EIO);
/*
* if we actually read some bytes, bubbling EFAULT
* up to become EAGAIN isn't what we want here.
*/
if (error == EFAULT &&
(zfs_uio_offset(uio) - start_offset) != 0)
error = 0;
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment