Skip to content

Issue: Temp file disk space leak when writeback cache is enabled and FUSE_WRITE returns error #4896

Description

@Peiqi0714

Summary
When writeback cache is enabled (default) and a FUSE_WRITE request returns an error (e.g., any I/O error), the temp file associated with the inode is never cleaned up until the kernel sends ForgetInode . This causes temp directory disk space to remain occupied indefinitely.

Root Cause
The issue is caused by an interaction between the Linux FUSE kernel module's writeback cache error handling and gcsfuse's temp file lifecycle management.

Image

When FUSE_WRITE returns an error, the kernel sets AS_EIO in mapping->flags. On close(), fuse_flush() detects this via filemap_check_errors() and returns early — without sending FUSE_FLUSH to userspace

The temp file remains on disk, consuming space, until the kernel eventually sends ForgetInode (which depends on dentry cache eviction — unpredictable and potentially very long if the file still exists in the directory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2P2questionCustomer Issue: question about how to use tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions