{"record":{"id":"ea7bef39f386a850","repo":"EpicGames/lore","slug":"file-refused-further-writes-psync","errorCode":null,"errorMessage":"file refused further writes","messagePattern":"file refused further writes","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"lore-io/src/psync.rs","lineNumber":110,"sourceCode":"            .await\n    }\n\n    /// Writes all `len` bytes, looping inside one dispatch. See [`Self::read_exact_at`].\n    pub(crate) async fn write_all_at<B: StableBuf>(\n        &self,\n        file: Arc<File>,\n        buffer: B,\n        len: usize,\n        offset: u64,\n    ) -> std::io::Result<B> {\n        SyscallPool::global()\n            .submit(move || {\n                let mut done = 0;\n                while done < len {\n                    let written =\n                        write_at_impl(&file, &buffer.as_ref()[done..len], offset + done as u64)?;\n                    if written == 0 {\n                        return Err(std::io::Error::new(\n                            std::io::ErrorKind::WriteZero,\n                            \"file refused further writes\",\n                        ));\n                    }\n                    done += written;\n                }\n                Ok(buffer)\n            })\n            .await\n    }\n\n    pub(crate) async fn write_at<B: StableBuf>(\n        &self,\n        file: Arc<File>,\n        buffer: B,\n        buffer_offset: usize,\n        len: usize,\n        offset: u64,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-io/src/psync.rs#L92-L128","documentation":"The synchronous write_all_at loop received a zero-byte write from write_at_impl, indicating the file accepted no more data at the current offset. The library reports this as ErrorKind::WriteZero instead of a silent partial write, so callers can rely on full-buffer semantics.","triggerScenarios":"Calling write_all_at where an individual positioned write returns Ok(0): volume is full or at quota, the file was truncated concurrently, or the target is a special file whose write end is closed.","commonSituations":"Disk-full during a large synchronous write; another process shrank the file mid-write; writing to a full tmpfs or a size-limited container volume; quota enforced on network filesystems.","solutions":["Free disk space or raise the quota on the target volume, then retry.","Reopen the file (it may have been truncated/replaced) and rewrite from scratch.","Check ENOSPC conditions proactively: stat the filesystem's free bytes before large writes.","If writing to pipes/special files, ensure the consumer end is open."],"exampleFix":"// before\npsync::write_all_at(&file, &data, offset)?;\n// after\nif fs_free_bytes(&path)? < data.len() as u64 {\n    return Err(std::io::Error::new(std::io::ErrorKind::StorageFull, \"insufficient space\"));\n}\npsync::write_all_at(&file, &data, offset)?;","handlingStrategy":"try-catch","validationCode":"// Rust\nif fs2::available_space(&path)? < data.len() as u64 {\n    return Err(std::io::Error::new(std::io::ErrorKind::StorageFull, \"insufficient space\"));\n}","typeGuard":null,"tryCatchPattern":"// Rust\nmatch psync::write_all_at(&file, &data, offset) {\n    Ok(()) => {}\n    Err(e) if e.kind() == std::io::ErrorKind::WriteZero => { /* ENOSPC handling: free space, reopen, retry */ }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Monitor free space/quota on target volumes","Don't share writable files across processes without locking","Cap file sizes and check before writing","Handle WriteZero as ENOSPC-equivalent in sync I/O paths"],"tags":["io","filesystem","write"],"backgroundTag":"file-write-failed","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}