mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 02:48:59 -04: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:
parent
ef9c7ad5df
commit
364f8c4407
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue