freebsd-nq/sys
Alan Somers 12292a99ac fusefs: correctly handle short writes
If a FUSE daemon returns FOPEN_DIRECT_IO when a file is opened, then it's
allowed to write less data than was requested during a FUSE_WRITE operation
on that file handle.  fusefs should simply return a short write to userland.

The old code attempted to resend the unsent data.  Not only was that
incorrect behavior, but it did it in an ineffective way, by attempting to
"rewind" the uio and uiomove the unsent data again.

This commit correctly handles short writes by returning directly to
userland if FOPEN_DIRECT_IO was set.  If it wasn't set (making the short
write technically a protocol violation), then we resend the unsent data.
But instead of rewinding the uio, just resend the data that's already in the
kernel.

That necessitated a few changes to fuse_ipc.c to reduce the amount of bzero
activity.  fusefs may be marginally faster as a result.

PR:		236381
Sponsored by:	The FreeBSD Foundation
2019-04-04 16:51:34 +00:00
..
amd64 x86: Use XSAVEOPT for fpusave(), when available 2019-03-26 22:45:41 +00:00
arm Use named field's initializer when constructing <foo>_platform structure. 2019-03-19 14:32:54 +00:00
arm64 Sort printing of the ID registers on arm64 to be identical to the 2019-03-25 18:02:04 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam Do not map small IOCTL buffers to KVA, but copy. 2019-03-28 20:41:02 +00:00
cddl Revert r345410, VOP_FSYNC change in ZFS vdev_file 2019-03-22 17:44:47 +00:00
compat Whitespace cleanup (annoying). 2019-03-24 15:08:30 +00:00
conf Stop using -fdebug-prefix-map to map the object directory. 2019-03-27 19:34:19 +00:00
contrib [ath_hal_ar9300] Add some comments around the AR9300 ANI code. 2019-03-19 00:07:12 +00:00
crypto Embedded chacha: Add 0-bit iv + 128-bit counter mode 2019-03-01 23:30:23 +00:00
ddb ddb: Print the thread's pcb in 'show thread' 2019-02-09 21:08:19 +00:00
dev cxgbe(4): Count and clear interrupts generated at the software's request. 2019-03-28 21:22:28 +00:00
dts Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with 2019-02-06 06:03:44 +00:00
fs fusefs: correctly handle short writes 2019-04-04 16:51:34 +00:00
gdb
geom Support device-independent labels for geom_flashmap slices. 2019-03-24 19:11:45 +00:00
gnu Correct my previous correction to the license. It now matches the text 2019-03-07 22:34:45 +00:00
i386 x86: Use XSAVEOPT for fpusave(), when available 2019-03-26 22:45:41 +00:00
isa
kern Factor out retrieving the interpreter path from the main ELF 2019-03-28 21:43:01 +00:00
kgssapi * Handle SIGPIPE in gssd 2019-02-21 01:30:37 +00:00
libkern Add non-sleepable strdup variant strdup_flags 2019-02-20 20:48:10 +00:00
mips The Atheros AR7241 has 20 GPIO pins 2019-03-25 07:48:52 +00:00
modules Fix make in sys/modules 2019-03-28 08:59:11 +00:00
net Use a dedicated malloc type for lagg(4)'s structures. 2019-03-28 21:00:54 +00:00
net80211 net80211: correct check for SMPS node flags updates 2019-03-18 02:40:22 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet Add CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition. 2019-03-26 22:14:50 +00:00
netinet6 Reapply r345274 with build fixes for 32-bit architectures. 2019-03-19 10:57:03 +00:00
netipsec Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
netpfil pf: use UID_ROOT and GID_WHEEL named constants in make_dev 2019-03-26 21:20:42 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
opencrypto Fix another bug introduced during the review process of r344140: 2019-02-25 19:14:16 +00:00
powerpc powerpc64: Use medium code model in asm files for TOC references 2019-03-29 02:38:30 +00:00
riscv Grab timer frequency from FDT. 2019-03-27 16:26:03 +00:00
rpc Bump the default kern.rpc.gss.client_max from 128 to 1024. 2019-02-19 11:07:02 +00:00
security Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
sparc64 amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
sys Revert change accidentally committed along with r345625 2019-03-28 10:56:27 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools make_dtb.sh: Use $CPP instead of assuming that cpp is in $PATH 2018-12-14 23:53:28 +00:00
ufs This is an additional and hopefully final fix for bug report 230962. 2019-03-20 23:11:05 +00:00
vm Improve error reporting when the swap pager runs out of memory. 2019-03-26 19:11:15 +00:00
x86 Use the BUS_DMA_NOWRITE flag to expose and create the read-only VT-d 2019-03-27 20:15:51 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile