mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-19 16:16:48 +00:00
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:
committed by
trapexit
parent
ef9c7ad5df
commit
364f8c4407
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user