You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vfs: shrinking truncate of an uncached file is silently undone on close (--vfs-cache-mode writes/full) #10047
I have searched the forum and the existing issues for this problem.
I have tested with the latest beta or stable release and can still reproduce the problem.
This is a reproducible bug, not a usage question (questions belong on the forum).
Associated forum post URL
No response
What is the problem you are having with rclone?
Truncating an existing file to a smaller non-zero size through a mount returns
success, and the mount briefly shows the new size, but on close the VFS cache
re-downloads the whole object over the truncated cache file and uploads it at
the original size. No error is reported. Truncate-then-write leaves a mixture
of old and new bytes.
rclone version
rclone v1.75.1 (official .deb, go1.26.8) and v1.76.0-beta.10454.3b9f0a05b
Debian 13.6, kernel 6.12.101, fuse3 3.17.2. Local backend on ext4; also
reproduced against a serve webdav remote.
Operating system
Linux
Which cloud storage system are you using?
local, webdav
Output of rclone config redacted
empty
**see below**
The command you were trying to run
**Steps to reproduce**
mkdir back mnt cache && touch empty.conf
printf'line1\nline2\nline3\n'> back/f # 18 bytes
rclone mount back mnt --vfs-cache-mode writes --config empty.conf \
--cache-dir cache --log-file mount.log -vv --daemon
truncate -s 5 mnt/f;echo$?# 0
stat -c %s mnt/f # 5
sleep 10
stat -c %s back/f mnt/f # 18 and 18**Expected:** back/f is 5 bytes. **Actual:** 18 bytes, original MD5.
I'd like to take this one if nobody else is working on it.
My plan is to find why close re-fetches the object over the truncated cache file for an uncached item, make the shrinking truncate stick in --vfs-cache-mode writes and full, and add a VFS test that truncates an uncached file to a smaller non-zero size and checks the size after close and upload. Happy to go a different direction if you'd prefer.
AI disclosure: I may use AI coding assistants while working on this. In line with CONTRIBUTING, I'll point them at AGENTS.md, and I'll personally review and test anything I submit and take responsibility for it.
Activity
hippi345 commentedon Oct 6, 2026
I'd like to take this one if nobody else is working on it.
My plan is to find why close re-fetches the object over the truncated cache file for an uncached item, make the shrinking truncate stick in
--vfs-cache-mode writesandfull, and add a VFS test that truncates an uncached file to a smaller non-zero size and checks the size after close and upload. Happy to go a different direction if you'd prefer.AI disclosure: I may use AI coding assistants while working on this. In line with CONTRIBUTING, I'll point them at AGENTS.md, and I'll personally review and test anything I submit and take responsibility for it.
ncw commentedon Oct 15, 2026
I've merged @flcrom fix for this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.76
vfs: preserve shrinking truncate on uncached files
vfs: preserve shrinking truncate on uncached files