--- sys/fs/fuse/fuse_vnops.c.orig 2018-08-10 09:34:24.492125000 +0200 +++ sys/fs/fuse/fuse_vnops.c 2018-08-10 09:38:38.890095000 +0200 @@ -823,6 +823,7 @@ struct fuse_entry_out *feo = NULL; struct fuse_attr *fattr = NULL; + struct fuse_vnode_data *fvdat = NULL; if (op == FUSE_GETATTR) { fattr = &((struct fuse_attr_out *)fdi.answ)->attr; @@ -971,6 +972,24 @@ cache_attrs(*vpp, (struct fuse_entry_out *)fdi.answ); } + fvdat = VTOFUD(*vpp); + + if (vnode_isreg(*vpp) && (fvdat->flag & FN_SIZECHANGE) == 0) { + /* + * This is for those cases when the file size changed without us + * knowing, and we want to catch up. + */ + off_t new_filesize; + if (op == FUSE_GETATTR) { + new_filesize = ((struct fuse_attr_out *)fdi.answ)->attr.size; + } else { + new_filesize = ((struct fuse_entry_out *)fdi.answ)->attr.size; + } + + if (fvdat->filesize != new_filesize) { + fuse_vnode_setsize(*vpp, cred, new_filesize); + } + } /* Insert name into cache if appropriate. */ /*