HomeFreeBSD

nfscl: Fix handling of a copyout() error reply

Description

nfscl: Fix handling of a copyout() error reply

If vfs.nfs.nfs_directio_enable is set non-zero (the default is
zero) and a file on an NFS mount is read after being opened
with O_DIRECT | O_ RDONLY, a call to nfsm_mbufuio() calls
copyout() without checking for an error return.
If copyout() returns EFAULT, this would not work correctly.

Only the call path
VOP_READ()->ncl_readrpc()->nfsrpc_read()->nfsrpc_readrpc()
will do this and the error return for EFAULT will
be returned back to VOP_READ().

This patch adds the error check to nfsm_mbufuio().

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43160

Details

Provenance
rmacklemAuthored on Dec 22 2023, 8:11 PM
Reviewer
markj
Differential Revision
D43160: Fix a call to copyout() so that it checks for an error return
Parents
rG671a00491d7a: vm_iommu_map()/unmap(): stop transiently wiring already wired pages
Branches
Unknown
Tags
Unknown