linux/fs/fuse
Miklos Szeredi 59bda8ecee fuse: flush extending writes
Callers of fuse_writeback_range() assume that the file is ready for
modification by the server in the supplied byte range after the call
returns.

If there's a write that extends the file beyond the end of the supplied
range, then the file needs to be extended to at least the end of the range,
but currently that's not done.

There are at least two cases where this can cause problems:

 - copy_file_range() will return short count if the file is not extended
   up to end of the source range.

 - FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE will not extend the file,
   hence the region may not be fully allocated.

Fix by flushing writes from the start of the range up to the end of the
file.  This could be optimized if the writes are non-extending, etc, but
it's probably not worth the trouble.

Fixes: a2bc923629 ("fuse: fix copy_file_range() in the writeback case")
Fixes: 6b1bdb56b1 ("fuse: allow fallocate(FALLOC_FL_ZERO_RANGE)")
Cc: <stable@vger.kernel.org>  # v5.2
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2021-08-31 14:18:08 +02:00
..
acl.c fuse: add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID 2021-04-14 10:40:57 +02:00
control.c fuse: name fs_context consistently 2021-08-04 13:22:58 +02:00
cuse.c cuse: simplify refcount 2021-04-14 10:40:58 +02:00
dax.c fuse update for 5.14 2021-07-06 11:17:41 -07:00
dev.c fuse: fix use after free in fuse_read_interrupt() 2021-08-04 13:22:58 +02:00
dir.c fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
file.c fuse: flush extending writes 2021-08-31 14:18:08 +02:00
fuse_i.h fuse: move fget() to fuse_get_tree() 2021-08-05 05:57:27 +02:00
inode.c fuse: allow sharing existing sb 2021-08-05 05:57:27 +02:00
ioctl.c fuse: convert to fileattr 2021-04-12 15:04:30 +02:00
Kconfig virtiofs: implement dax read/write operations 2020-09-10 11:39:23 +02:00
Makefile fuse: move ioctl to separate source file 2021-04-12 15:04:30 +02:00
readdir.c fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
virtio_fs.c fuse: name fs_context consistently 2021-08-04 13:22:58 +02:00
xattr.c fuse: extend FUSE_SETXATTR request 2021-04-14 10:40:57 +02:00