Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175166822
D46296.id170960.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46296.id170960.diff
View Options
diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c
--- a/sys/fs/fuse/fuse_internal.c
+++ b/sys/fs/fuse/fuse_internal.c
@@ -257,6 +257,7 @@
struct fuse_vnode_data *fvdat;
struct fuse_data *data;
struct vattr *vp_cache_at;
+ off_t size;
mp = vnode_mount(vp);
fvdat = VTOFUD(vp);
@@ -264,6 +265,8 @@
ASSERT_VOP_ELOCKED(vp, "fuse_internal_cache_attrs");
+ size = attr->size;
+
fuse_validity_2_bintime(attr_valid, attr_valid_nsec,
&fvdat->attr_cache_timeout);
@@ -313,11 +316,16 @@
}
/* Fix our buffers if the filesize changed without us knowing */
- if (vnode_isreg(vp) && attr->size != fvdat->cached_attrs.va_size) {
+ if (vnode_isreg(vp) && attr->size != fvdat->cached_attrs.va_size &&
+ !(fvdat->flag & FN_SIZECHANGE)) {
(void)fuse_vnode_setsize(vp, attr->size, from_server);
fvdat->cached_attrs.va_size = attr->size;
}
+ /* If we have a local dirty copy of the size, use it. */
+ if (fvdat->flag & FN_SIZECHANGE && fvdat->cached_attrs.va_size != VNOVAL)
+ size = fvdat->cached_attrs.va_size;
+
if (attr_valid > 0 || attr_valid_nsec > 0)
vp_cache_at = &(fvdat->cached_attrs);
else if (vap != NULL)
@@ -332,7 +340,7 @@
vp_cache_at->va_uid = attr->uid;
vp_cache_at->va_gid = attr->gid;
vp_cache_at->va_rdev = attr->rdev;
- vp_cache_at->va_size = attr->size;
+ vp_cache_at->va_size = size;
/* XXX on i386, seconds are truncated to 32 bits */
vp_cache_at->va_atime.tv_sec = attr->atime;
vp_cache_at->va_atime.tv_nsec = attr->atimensec;
@@ -891,7 +899,7 @@
ltype = VOP_ISLOCKED(vp);
if (ltype == LK_EXCLUSIVE)
- return 0;
+ return (0);
vn_lock(vp, LK_UPGRADE | LK_RETRY);
*must_downgrade = true;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 9, 7:40 PM (1 m, 13 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40500605
Default Alt Text
D46296.id170960.diff (1 KB)
Attached To
Mode
D46296: add virtiofs kernel module
Attached
Detach File
Event Timeline
Log In to Comment