Page MenuHomeFreeBSD

D55047.diff
No OneTemporary

D55047.diff

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

Mime Type
text/plain
Expires
Thu, May 14, 8:27 PM (16 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33023048
Default Alt Text
D55047.diff (1 KB)

Event Timeline