BRKH Blog

Office Documents Corrupted on an rclone Mount: A Case Report on fallocate, 128 KiB Padding, and a Mount-Layer Fix

Silent data corruption is among the most difficult failure modes to detect: the affected file retains a plausible name and size, yet no application can open it. This report describes such a failure in Microsoft Office documents saved directly to a folder backed by an rclone mount. The save operation completed without error and the file appeared on the drive, but both the desktop application on the same machine and Office on the web subsequently refused to open it.

The initial hypothesis commonly attributes this symptom to the Office version or to an incompatibility between file formats. The evidence presented here does not support that hypothesis. The file that reached the cloud service was already damaged, and every client therefore rejects it for the same reason. The cause lies not in the document format but in a single system call that the mount layer does not answer, which results in 128 KiB of padding that displaces the ZIP central directory from the end of the file.

The report follows a journal case-report structure (structured abstract, technical background, methodology, results and discussion, limitations, declarations, and appendices containing the complete patch and the reproduction commands) so that each figure and claim can be traced to its source.

ComponentDetail
Article typeCase report (incident diagnosis and remediation)
AuthorYasril A. Hitho
AffiliationIndependent author, BRKH Blog
Correspondencegh+blog@brkh.work
Published11 November 2026
Manuscript statusPublished online on a blog; not a peer-reviewed article
Version1.0

Note on format

The journal format is adopted for structural clarity and does not imply that this article has undergone peer review. All figures are derived from the reproduction described in Section 3. Readers who intend to cite any figure should repeat the verification in Appendix B in their own environment.

Abstract

Background. Microsoft Office documents saved directly to a folder backed by an rclone FUSE mount may become unreadable in both the desktop application and Office on the web, with no error reported at save time. The symptom is readily misattributed to differences in Office versions or file formats.

Objective. This report identifies the layer at which the file is damaged, explains the underlying mechanism, proposes a minimal and verifiable correction, and describes a recovery procedure for files that have already been damaged.

Methods. A case report with a controlled comparison was conducted. The same document was saved to two destinations on the same share (an ext4 folder and the rclone mount), and the resulting sizes and integrity were compared. The stored remote object was inspected directly, and the allocation request was probed with fallocate at both destinations. The FUSE interface and the Windows allocation API were traced to primary sources.

Results. The file was not damaged during upload, and the Office version was not responsible. On the rclone mount, fallocate(2) returns ENOTSUP because the mount's file handle does not implement the HandleFAllocater interface. The Windows code path then extends the file to the requested allocation size (131,072 bytes for a 12,015-byte document) and does not restore the original size. Because a DOCX file is a ZIP archive whose central directory is located at the end of the file, the zero padding displaces that directory beyond the scan window, and the document is reported as corrupt. A 16-line patch that adds an FAllocate method reporting success eliminates this behaviour. Files that are already damaged are recoverable because only their tail is affected.

Conclusion. A failed allocation hint is not necessarily a benign failure. On a filesystem re-exported to Windows, an ENOTSUP response to fallocate can result in silent corruption of ZIP-based formats. An FAllocate implementation that reports success is semantically appropriate and sufficient to prevent the damaging fallback path.

Keywords: rclone; FUSE; fallocate; OOXML; data integrity; file recovery; case report

Key points

  • Document corruption results from the mount returning ENOTSUP in response to the allocation request, not from the Office version.
  • A DOCX file is a ZIP archive; 128 KiB of padding displaces the central directory beyond the scan window.
  • A 16-line patch that reports success is sufficient to prevent the damage.
  • Neither --vfs-cache-mode full nor the mount2 backend resolves the problem, because the defect resides in the FUSE layer.
  • Files that are already damaged can be recovered because only their tail is affected.

1. Introduction

1.1 Background

Modern Office documents are stored as ZIP archives containing XML and other assets. Applications read and write them through the same file-system interface as any other file, so document integrity depends on the behaviour of the underlying filesystem. When that filesystem is a network mount or a FUSE mount rather than a local disk, certain guarantees that are normally assumed become the responsibility of an intermediary layer.

The case reported here arose in a common topology: an rclone FUSE mount on a Linux host, with the mounted folder shared to a Windows machine via SMB, NFS, or a virtual-machine shared folder. Office on Windows saved documents directly to the mounted drive. The configuration is unremarkable, which facilitates the identification of the fault as a layer-level problem rather than an application-level problem.

The reported symptoms were consistent: the file appeared to have been saved and no error was raised, yet it could not be opened in the desktop application or in Office on the web. The initial suspicion typically falls on the Office version or on file-format differences. This report demonstrates that this suspicion is unfounded and that the cause can be isolated to a single system call.

1.2 Problem Statement

The decisive question is not why Office rejects the file, but at which layer the stored bytes are altered. The path from application to storage comprises Office, the share layer, the Linux host, the FUSE mount, and the cloud service. Without a controlled comparison, each layer remains a plausible suspect, and a correction chosen heuristically risks suppressing the symptom without removing its cause.

A second, practical problem follows: files that are already damaged must be recoverable without overwriting the original, and users who cannot yet patch rclone require interim measures to contain further damage.

1.3 Investigation Questions

This report addresses four investigation questions:

  • IQ1. At which layer is the file damaged: the object stored on the remote, the local cache, the write path of the share, or the mount?
  • IQ2. Which operation extends a 12,015-byte document to exactly 131,072 bytes, and why does the application not report a failure?
  • IQ3. Can the behaviour be corrected without modifying rclone's transfer path, and what constitutes a minimal, verifiable correction?
  • IQ4. How can already-damaged files be recovered, and which interim measures prevent recurrence?

1.4 Contributions

This report makes four contributions: (i) a controlled reproduction that isolates the responsible layer; (ii) an explanation of the mechanism linking the Windows FileAllocationInfo class, fallocate(2), the ENOTSUP response of the FUSE library, and the resulting ZIP read failure; (iii) a 16-line patch verified on a live mount; and (iv) a recovery procedure together with interim guidance.

1.5 Organization of the Paper

Section 2 presents the technical background and Section 3 describes the methodology. Section 4 reports the results and discussion, organised by investigation question. Section 5 considers implications and generalisability, Section 6 addresses limitations, and Section 7 presents the conclusion. Declarations, references, and two appendices complete the report.

2. Technical Background

2.1 The DOCX Format as a ZIP Archive

Modern Office formats (.docx, .xlsx, and .pptx) are ZIP archives containing XML and other assets [6]. The validity of such a file is determined not by its contents but by the central directory, the index stored at the end of the archive. ZIP readers locate this index by scanning backwards from the end of the file; in practice, most inspect only approximately the final 64 KiB.

When hundreds of kilobytes of zeros are appended to an otherwise valid file, the central directory falls outside the scan window. The reader consequently concludes that the file is not a valid ZIP archive, and the application reports a corrupt document, even though all XML content at the beginning of the file remains intact. Damage of this kind is therefore reversible, provided that the data preceding the padding is unaltered.

One diagnostic caveat applies: unzip -l may still list the archive contents, depending on the extent of the padding. Such a result does not demonstrate that the file is healthy; file size and an explicit integrity test are more reliable indicators.

2.2 fallocate and the FUSE Interface

The fallocate(2) system call requests that the kernel reserve space for a file, typically prior to a large write, so that block allocation does not occur incrementally. On a FUSE filesystem, the request is forwarded to a userspace process as an FAllocateRequest. The FUSE library used by rclone, bazil, defines a HandleFAllocater interface; if the file handle does not implement it, bazil responds with ENOTSUP [1][2].

case *fuse.FAllocateRequest:
 shandle := c.getHandle(r.Handle)
 if shandle == nil {
  return syscall.ESTALE
 }
 h, ok := shandle.handle.(HandleFAllocater)
 if !ok {
  return syscall.ENOTSUP
 }

The rclone Linux mount implements only Read, Write, Flush, and Release on its file handle [3]. Every allocation request on an rclone mount therefore terminates in ENOTSUP. The Operation not supported message observed when fallocate is executed on the mount is the same response that the Windows client receives.

2.3 File Allocation on Windows

Word does not write a document directly to its final file. It first prepares a temporary save file, requests space allocation for it through SetFileInformationByHandle with the FileAllocationInfo class, and then writes the contents. The Windows API defines allocation as the number of bytes reserved for a file and specifies that the end-of-file position must not exceed the allocation size [4][5].

When the allocation request fails, the Windows code path does not necessarily abort the save. In the present case, it degraded the request into a file extension: the end-of-file position was raised to a multiple of 128 KiB, the contents were written at the beginning, and the size was never reduced. The application registered a successful save because its own data writes succeeded; only the allocation hint failed, and this failure was never propagated to the user interface.

2.4 VFS Cache Modes and Mount Backends

The option --vfs-cache-mode full retains file contents on local disk before upload [7]. This mode is frequently assumed to protect against corruption because writes do not immediately reach the remote. However, the allocation request is answered at the FUSE layer, before the VFS cache takes any decision, and the same file handle still lacks an FAllocate method.

An alternative mount backend does not provide a remedy either. The mount2 implementation in rclone, which uses go-fuse, does not currently provide FAllocate [8]. As long as the mount layer does not answer the allocation request, applications will follow the same code path irrespective of cache size or backend.

3. Methodology

3.1 Study Design

This study is a single case report with a controlled comparison. The only variable altered was the destination: the same document, produced by the same application, was saved to an ext4 folder and to the rclone mount on the same share. The difference between the two outcomes identifies the responsible layer without requiring assumptions about the internal behaviour of the application.

Each hypothesis was evaluated with a test capable of falsifying it, rather than by a merely plausible explanation. The tests were ordered from least to most costly: inspection of the remote object, comparison of the write path, comparison of two filesystems, and finally inspection of the FUSE interface.

3.2 Environment and Topology

The test topology is generic and does not depend on specific hardware:

Office (Windows)
   │  SetFileInformationByHandle(FileAllocationInfo)
   ▼
Share (SMB / NFS / VM folder)
   │
   ▼
Linux host
   │  fallocate(2)
   ▼
rclone FUSE mount (bazil)
   └─ no HandleFAllocate → ENOTSUP

Office ran on Windows and saved to a drive provided by the share. The Linux host ran the rclone mount in full cache mode. An ext4 folder on the same share served as the comparator, so that the share layer and the application remained constant and only the destination filesystem varied.

3.3 Reproduction Procedure

The reproduction comprised four steps:

  1. The same document was saved from Word to the ext4 folder and to the rclone mount, and the size and the unzip -t result were recorded for each.
  2. The stored object was copied directly from the remote with rclone copyto, in order to distinguish damage to the object from damage to the cache.
  3. fallocate -l 131072 -n was executed on a test file at both destinations, and the exit code and final size were recorded.
  4. It was determined whether the file handle of the mount implements HandleFAllocater, and how the FUSE library responds to an unimplemented request.

The complete commands are provided in Appendix B.

3.4 Hypothesis Elimination

Five hypotheses were formulated prior to testing: damage during upload, a partial write in the share layer, an incompatible Office version, a defect in the rclone mount, and file preallocation as the trigger. Each was tested with a comparison capable of rejecting it. The results are presented in Section 4.2.

3.5 Criteria for a Successful Correction

A correction was deemed successful only if it satisfied four criteria on a live mount: (i) fallocate -l 131072 -n exits with code 0; (ii) allocating 131,072 bytes followed by a 12,015-byte write leaves the size at 12,015 bytes; (iii) a small document saved from Word has a plausible size rather than exactly 131,072 bytes; and (iv) that document passes unzip -t and opens in Office on the web.

4. Results and Discussion

4.1 Symptoms and Signs of Damage

The reported symptoms were consistent, and each progressively narrowed the set of possible causes.

Table 1. Symptoms, findings, and implications.

SymptomFindingImplication
Only files saved on the mount are damagedThe same file, saved to an ext4 folder, is validThe problem lies in the destination filesystem, not the application
No error when savingWord closes the document as if the save had succeededThe damage is silent and manifests only when the file is opened
A small file acquires a conspicuously round sizeA 12,015-byte document reaches exactly 131,072 bytesSome operation sets the size to a multiple of 128 KiB
Failure on the desktop and in Office on the webBoth clients reject the same fileThe stored bytes are damaged; the problem is not application-specific

The final row is decisive. If a file were defective on the desktop but intact on the web, the fault would lie in the application or the upload. Rejection of the same file by two independent clients indicates that the data itself is damaged, which no Office version can remedy.

4.2 Layer Isolation

Five hypotheses were tested sequentially. Table 2 summarises the tests and their results.

Table 2. Elimination of causal hypotheses.

HypothesisTestResult
The file was damaged during upload, but the cached copy is intactrclone copyto directly from the remote to a local folderIdentical result: zeros at the tail. The stored object is damaged.
The share performs partial writesA large file was written to an ordinary folder over the same shareIntact. The write path of the share is unaffected.
The Office version is incompatibleThe same file was opened in Office on the webAlso rejected. The bytes themselves are damaged.
The rclone mount is at faultThe same document was saved to an ext4 folder and to the mountext4: 12,015 bytes, valid. Mount: 131,072 bytes, corrupt.
Preallocation is the triggerfallocate -n was run at both locationsext4: succeeds. Mount: Operation not supported.

The final row identifies the cause. Office requests space before writing, which is normal Windows behaviour, and this request is translated into fallocate(2) on the host. On ext4 the request is fulfilled. On the rclone mount it is refused, and this refusal leads to the change in file size.

4.3 Failure Mechanism

The causal chain comprises four steps. First, Word requests an allocation for its save file. Second, the request reaches the mount as an FAllocateRequest; because the handle does not implement HandleFAllocater, bazil responds with ENOTSUP. Third, the Windows code path degrades the request into a file extension: the end-of-file position is raised to a multiple of 128 KiB, the contents are written at the beginning, and the size is not subsequently reduced. Fourth, rclone uploads the file as it stands, valid at the front and zero-filled at the back.

The failure is therefore not a transfer error. Modifying the chunk size, the number of transfers, or the cache mode does not alter the outcome, because the erroneous decision is taken before rclone transmits any byte. Nor is the damage observable at save time: the application observes only that its data writes succeeded, whereas the failed allocation hint is never surfaced as an error.

4.4 Ineffectiveness of Cache Mode

Full cache mode relocates file contents to local disk but does not alter which component answers the FAllocateRequest. The request is still answered at the FUSE layer, and the response remains ENOTSUP as long as the handle lacks an FAllocate method. The same holds for mount2: replacing the FUSE library does not supply the missing implementation.

This has implications for diagnosis. If the symptom is evaluated solely in terms of transfer settings, the case appears to be a configuration problem that cannot be conclusively resolved. The symptom becomes interpretable only when the mount layer is examined as a component in its own right.

4.5 The Correction: Implementing HandleFAllocater

Because the defect is an unimplemented interface, the correction is correspondingly short: an FAllocate method is added to the file handle of the mount and returns success.

// Check interface satisfied
var _ fusefs.HandleFAllocater = (*FileHandle)(nil)

// FAllocate reserves space for the file.
func (fh *FileHandle) FAllocate(ctx context.Context, req *fuse.FAllocateRequest) (err error) {
 defer log.Trace(fh, "mode=%v, offset=%d, length=%d", req.Mode, req.Offset, req.Length)("err=%v", &err)
 return nil
}

The method deliberately performs no operation. Allocation is a hint rather than a guarantee: the remote has no physical blocks to reserve, and the VFS cache file is sparse. The client requires only a successful response in order to avoid the file-extension path. Responding truthfully with ENOTSUP is precisely what leads to document corruption. The complete diff is provided in Appendix A.

To apply the correction, rclone is cloned at the release tag in use, the patch is applied, the binary is built, and the binary executed by the mount is replaced.

git clone --branch v1.76.0 --depth 1 https://github.com/rclone/rclone.git
cd rclone
git apply /path/to/rclone-fallocate.patch

go build -trimpath -buildmode=pie \
  -ldflags "-s -w -X github.com/rclone/rclone/fs.Version=v1.76.0-fallocate" \
  -o rclone-patched .

./rclone-patched version

The fs.Version value above serves only to label the binary so that rclone version distinguishes it from an official release. After the binary is replaced, the running mount must be stopped and restarted, because a process that is already running continues to use the previous binary until it exits.

4.6 Verification of the Correction

A patch is not complete until its behaviour has been demonstrated on a live mount. Table 3 compares the results before and after application of the patch.

Table 3. Behaviour before and after the patch.

Checkrclone without the patchrclone with the patch
fallocate -l 131072 -nFails, Operation not supportedExit code 0, size remains 0
Allocate 131,072 bytes, then write 12,015 bytesSize becomes 131,072 bytesSize remains 12,015 bytes
Save a small document from WordExactly 131,072 bytes, cannot be openedA few kilobytes, opens in Office on the web

The first two checks can be executed directly from a shell:

# 1. The allocation request is now answered
touch ~/mount/.probe
fallocate -l 131072 -n ~/mount/.probe
echo $?                        # 0
stat -c '%s' ~/mount/.probe    # 0

# 2. Allocation no longer changes the final file size
fallocate -l 131072 ~/mount/.probe
dd if=/dev/zero of=~/mount/.probe bs=12015 count=1 status=none
stat -c '%s' ~/mount/.probe    # 12015, not 131072

The third check is the decisive one: a small document is saved from Word to the mounted drive, and its size is inspected. A document of a few pages should occupy a few tens of kilobytes rather than exactly 131,072 bytes. The document should then be opened in Office on the web, and unzip -t should be run on a copy.

unzip -t document.docx
# No errors detected in compressed data of document.docx.

Prior to the patch, the first check failed with Operation not supported, and a 12,015-byte file reached exactly 131,072 bytes. After the patch, the size written equals the size stored.

4.7 Recovery of Damaged Files

Because only padding was appended, the content of the document is usually intact and can be recovered. The recommended sequence is as follows:

  1. Preserve the original. The file is copied first and all work is performed on the copy. Where available, the version history of the storage service is the most straightforward recovery route.
  2. Extract the contents. 7z x reads the data preceding the padding and typically succeeds even when the ZIP directory is no longer readable.
  3. Repack the extracted contents into a new ZIP archive and assign the .docx extension.
  4. Test the result with unzip -t and by opening it in the application.
mkdir repaired
7z x broken-document.docx -orepaired

cd repaired
7z a -tzip ../new-document.docx .

cd ..
unzip -t new-document.docx

The trailing dot in the 7z a command is significant: the contents of the directory are archived, not the directory itself. The OOXML structure requires [Content_Types].xml at the root of the archive, and archiving the enclosing folder yields a valid ZIP file that is not a valid document.

Where version history is available, restoring from it is faster and safer: the last intact version is downloaded and saved as a new file. Opening a damaged file in Office on the web does not repair it, because the server stores the same bytes.

4.8 Interim Measures

The patch requires a locally built rclone binary. Where this is not yet feasible, several measures can contain the damage.

Table 4. Interim measures and their limitations.

MeasureRisk mitigatedLimitation
Save to local disk, then copy with rclone copyApplications no longer write directly to the mountAdds a manual step to each save
Enable version history in the storage serviceLoss of the last intact versionDoes not prevent new damage
Verify file size after savingDamaged files are detected earlierReactive rather than preventive
Do not use the mount for Office editingAvoids the damaging path entirelyRequires a change in workflow

In the longer term, the more robust practice is to separate editing from synchronisation: documents are edited on local disk and synchronised with rclone sync or the vendor client, and applications are not permitted to write directly to a filesystem that does not support the semantics on which they rely.

5. Discussion

5.1 Why a Failed Allocation Results in Corruption

A failed fallocate is generally regarded as harmless because many tools treat it as a hint: if allocation fails, the tool proceeds with ordinary writes. In the present case, the fallback path instead modified the file size, and the application had no reason to re-verify a size that it had itself just set.

The invisibility of the damage arises from the separation between "the write succeeded" and "the file is valid". These two properties are verified by different layers: the former by the application at save time, the latter by a ZIP reader when the file is opened. Because the ZIP directory resides at the end of the file, the damage becomes apparent only well after the save, in another application, on another machine, or in the web service.

5.2 Generalisable Pattern

The case is not specific to OneDrive or to any single cloud vendor. The underlying pattern is an intermediary filesystem that answers an optional operation with ENOTSUP, followed by a client that takes a fallback path based on an incorrect assumption. The same pattern may arise on other FUSE mounts, on re-exported shares, and in any application that requests an allocation before writing.

ZIP-based formats, including OOXML and ODF, are the most exposed because their validity depends on a structure located at the end of the file. Applications that handle ENOTSUP correctly, such as copy tools that fall back to ordinary writes without altering the file size, are unaffected. The risk is concentrated in applications that assume the allocation has succeeded and do not verify the final size.

5.3 Operational Implications

Three practical implications follow from this case. First, an ENOTSUP response to fallocate on a mount should be treated as a warning signal rather than a nuisance, since it indicates that applications requesting allocation will follow the fallback path. Second, a file size that is conspicuously round warrants suspicion, particularly for small documents that should occupy only a few kilobytes. Third, verifying file integrity after saving is less costly than recovering a document that has already been damaged.

5.4 Upstream Status

As of November 2026, cmd/mount/handle.go on the master branch of rclone does not implement FAllocate [3], and no upstream report specifically addressing this symptom was identified. The patch therefore remains relevant and must be re-verified for each rclone release: as long as the method is absent upstream, the patch must be applied to each new tag.

The patch is small and self-contained, consisting of one method and no new imports. Once upstream adds FAllocate, the patch can be discarded without further modification.

6. Limitations and Threats to Validity

This report is based on a single case involving one rclone version, one share topology, and one Office version tested directly. Other versions of the same components may behave differently, and the findings should not be interpreted as a survey of all possible combinations.

The mechanism underlying the 131,072-byte size is inferred from the observed file sizes and from the documented behaviour of the allocation API, not from the Office source code. The explanation is coherent and consistent with all observations; however, the internal rationale of the application cannot be verified externally.

The proposed patch is a no-op: it reports success without actually reserving space. For a mount whose remote has no physical blocks, this is the appropriate semantics, but it does not provide the allocation guarantee that some tools may expect. Readers who require such a guarantee must determine whether their local cache layer can provide a genuine allocation.

Finally, this report does not claim that every Office version follows the same code path. It demonstrates that the path exists, that it can be reproduced, and that it can be corrected at the mount layer.

7. Conclusion

Office documents saved to an rclone mount can be damaged because the allocation request is answered with ENOTSUP, and the Windows fallback extends the file to the allocation size without subsequently reducing it. Because a DOCX file is a ZIP archive whose central directory is located at the end of the file, the zero padding renders the document unreadable in every client, not in a single application only.

The correction consists of an FAllocate implementation that reports success on the file handle of the mount. The 16-line patch satisfies all verification criteria: the allocation request is answered, the final file size is stable, and a document saved from Word opens in Office on the web. Files that are already damaged can be recovered because only their tail is affected.

The broader lesson is that the failure of an optional operation is not invariably safe. On an intermediary filesystem, an ENOTSUP response can trigger a damaging fallback path, and file validity must be verified at the same layer at which the file is written.

Declarations

Use of generative AI in preparation. This manuscript was drafted with the assistance of a generative AI system, which was used to summarise the diagnostic trail, draft text, and prepare the translation. The author is responsible for verifying all technical claims, figures, and references against primary sources prior to publication.

Conflict of interest. The author declares no conflict of interest.

Funding. No external funding was received.

Data availability. No new datasets were generated. The reproduction figures, code excerpts, and the complete patch are contained in the article and in Appendices A and B. No personal data is included.

Ethics statement. Not applicable; this report did not involve human participants.

How to cite this article

Hitho, Y. A. (2026). Office documents corrupted on an rclone mount: A case report on fallocate, 128 KiB padding, and a mount-layer fix. BRKH Blog. https://blog.brkh.work/en/posts/dokumen-office-rusak-fallocate-rclone

References

[1] bazil.org. (n.d.). fuse/fs: HandleFAllocater [Package documentation]. https://pkg.go.dev/bazil.org/fuse/fs#HandleFAllocater

[2] bazil.org. (n.d.). fuse/fs/serve.go [Source code]. GitHub. https://github.com/bazil/fuse/blob/master/fs/serve.go

[3] rclone. (2026). cmd/mount/handle.go [Source code]. GitHub. https://github.com/rclone/rclone/blob/master/cmd/mount/handle.go

[4] Microsoft. (2018). FILE_ALLOCATION_INFO structure (winbase.h). Microsoft Learn. https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_allocation_info

[5] Microsoft. (2018). SetFileInformationByHandle function (fileapi.h). Microsoft Learn. https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileinformationbyhandle

[6] PKWARE. (2022). APPNOTE.TXT: ZIP file format specification (Version 6.3.10). https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

[7] rclone. (2026). rclone mount. https://rclone.org/commands/rclone_mount/

[8] rclone. (2026). cmd/mount2 [Source code]. GitHub. https://github.com/rclone/rclone/tree/master/cmd/mount2

Appendix A. Complete Patch

The following diff adds one method to cmd/mount/handle.go and applies to rclone v1.76.0.

diff --git a/cmd/mount/handle.go b/cmd/mount/handle.go
index 94f8214..9fd4c67 100644
--- a/cmd/mount/handle.go
+++ b/cmd/mount/handle.go
@@ -70,6 +70,22 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) (err er
  return translateError(fh.Handle.Flush())
 }

+// Check interface satisfied
+var _ fusefs.HandleFAllocater = (*FileHandle)(nil)
+
+// FAllocate reserves space for the file.
+//
+// The remote has no blocks to reserve and the VFS cache file is
+// sparse, so this is a no-op that reports success. Reporting ENOTSUP
+// makes some clients fall back to extending the file to the requested
+// allocation size without ever shrinking it again; the zero padding
+// then pushes an OOXML ZIP central directory away from the end of the
+// file and the document becomes unreadable.
+func (fh *FileHandle) FAllocate(ctx context.Context, req *fuse.FAllocateRequest) (err error) {
+ defer log.Trace(fh, "mode=%v, offset=%d, length=%d", req.Mode, req.Offset, req.Length)("err=%v", &err)
+ return nil
+}
+
 var _ fusefs.HandleReleaser = (*FileHandle)(nil)

 // Release is called when we are finished with the file handle

Appendix B. Reproduction and Verification Commands

All commands are executed on the Linux host that owns the rclone mount. ~/mount should be replaced with the mount point in use.

# Size and integrity of the suspect file
stat -c '%s' document.docx
tail -c 64 document.docx | xxd
unzip -t document.docx

# Compare the remote object with the cached copy
rclone copyto remote:document.docx /tmp/document-remote.docx
stat -c '%s' /tmp/document-remote.docx

# Ask the mount whether it supports allocation
touch ~/mount/.probe
fallocate -l 131072 -n ~/mount/.probe
echo $?
stat -c '%s' ~/mount/.probe

# Test size stability after allocation
fallocate -l 131072 ~/mount/.probe
dd if=/dev/zero of=~/mount/.probe bs=12015 count=1 status=none
stat -c '%s' ~/mount/.probe

# Recover a damaged document
mkdir repaired
7z x broken-document.docx -orepaired
cd repaired
7z a -tzip ../new-document.docx .
cd ..
unzip -t new-document.docx

Contents