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.
This commit is contained in:
Antonio S. Musumeci
2026-04-18 13:47:23 -05:00
committed by trapexit
parent ef9c7ad5df
commit 364f8c4407
+2
View File
@@ -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)