From 364f8c440734549b4fd94f89fc23c182d08ef839 Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Sat, 18 Apr 2026 00:58:51 -0400 Subject: [PATCH] fs_movefile_and_open: -ENOSPC when no destination branch available The create policy can legitimately return success with an empty destination list (e.g. every candidate rejected). Previously we then dereferenced dst_branch[0] and faulted. Return -ENOSPC so the original write that triggered the move propagates a sensible errno to userspace. --- src/fs_movefile_and_open.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fs_movefile_and_open.cpp b/src/fs_movefile_and_open.cpp index 75de245a..6f3bc86a 100644 --- a/src/fs_movefile_and_open.cpp +++ b/src/fs_movefile_and_open.cpp @@ -82,6 +82,8 @@ _movefile_and_open(const Policy::Create &createFunc_, rv = createFunc_(branches_,fusepath_,dst_branch); if(rv < 0) return rv; + if(dst_branch.empty()) + return -ENOSPC; origfd_flags = fs::getfl(origfd_); if(origfd_flags < 0)