svn commit: r349382 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs
Alan Somers
asomers at FreeBSD.org
Tue Jun 25 18:36:12 UTC 2019
Author: asomers
Date: Tue Jun 25 18:36:11 2019
New Revision: 349382
URL: https://svnweb.freebsd.org/changeset/base/349382
Log:
fusefs: writes should update the file size, even when data_cache_mode=0
Writes that extend a file should update the file's size. r344185 restricted
that behavior for fusefs to only happen when the data cache was enabled.
That probably made sense at the time because the attribute cache wasn't
fully baked yet. Now that it is, we should always update the cached file
size during write.
Sponsored by: The FreeBSD Foundation
Modified:
projects/fuse2/sys/fs/fuse/fuse_io.c
projects/fuse2/tests/sys/fs/fusefs/write.cc
Modified: projects/fuse2/sys/fs/fuse/fuse_io.c
==============================================================================
--- projects/fuse2/sys/fs/fuse/fuse_io.c Tue Jun 25 18:35:23 2019 (r349381)
+++ projects/fuse2/sys/fs/fuse/fuse_io.c Tue Jun 25 18:36:11 2019 (r349382)
@@ -541,8 +541,7 @@ retry:
diff = fwi->size - fwo->size;
as_written_offset = uio->uio_offset - diff;
- if (as_written_offset - diff > filesize &&
- fuse_data_cache_mode != FUSE_CACHE_UC)
+ if (as_written_offset - diff > filesize)
fuse_vnode_setsize(vp, as_written_offset);
if (as_written_offset - diff >= filesize)
fvdat->flag &= ~FN_SIZECHANGE;
Modified: projects/fuse2/tests/sys/fs/fusefs/write.cc
==============================================================================
--- projects/fuse2/tests/sys/fs/fusefs/write.cc Tue Jun 25 18:35:23 2019 (r349381)
+++ projects/fuse2/tests/sys/fs/fusefs/write.cc Tue Jun 25 18:36:11 2019 (r349382)
@@ -1041,8 +1041,8 @@ TEST_F(WriteThrough, writethrough)
/* Deliberately leak fd. close(2) will be tested in release.cc */
}
-/* With writethrough caching, writes update the cached file size */
-TEST_F(WriteThrough, update_file_size)
+/* Writes that extend a file should update the cached file size */
+TEST_F(Write, update_file_size)
{
const char FULLPATH[] = "mountpoint/some_file.txt";
const char RELPATH[] = "some_file.txt";
More information about the svn-src-projects
mailing list