freebsd-nq/sys/fs
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
..
autofs Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
cd9660 Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
cuse Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
deadfs sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
devfs Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
ext2fs Remove unneeded mount point unlock function calls. 2019-03-15 11:49:46 +00:00
fdescfs Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
fifofs Rework pathconf handling for FIFOs. 2017-12-19 22:39:05 +00:00
fuse fusefs: correctly handle short writes 2019-04-04 16:51:34 +00:00
msdosfs Fix clobbering of the fatchain cache for clustered i/o's when full 2018-12-21 21:17:45 +00:00
nandfs Add _PC_ACL_* to vop_stdpathconf 2019-03-11 20:40:56 +00:00
nfs Drop unused 'p' argument to nfsv4_strtogid(). 2019-03-12 15:07:47 +00:00
nfsclient Drop unused 'p' argument to nfsv4_strtogid(). 2019-03-12 15:07:47 +00:00
nfsserver Drop unused 'p' argument to nfsv4_strtogid(). 2019-03-12 15:07:47 +00:00
nullfs nullfs: fix unmounts when filesystem is active. 2019-03-21 13:30:48 +00:00
procfs Plug memory disclosures via ptrace(2). 2018-12-03 20:54:17 +00:00
pseudofs PFS: Bump NAMELEN and don't require clients to be sleepable 2019-02-20 20:55:02 +00:00
smbfs [smbfs] Allow semicolon in mounts that support long names 2019-01-20 05:52:16 +00:00
tmpfs Refine r345425: get rid of superfluous helper macro that I have added. 2019-03-26 01:28:10 +00:00
udf Ensure that directory entry padding bytes are zeroed. 2018-11-23 22:24:59 +00:00
unionfs sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00