mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
return clonepath errors
currently the error is ignored and it was expected the primary call would fail. problem is it returns confusing errors as a result. (eg ENOENT vs EPERM)
This commit is contained in:
parent
05d81dbc23
commit
35075bb0cd
6 changed files with 53 additions and 34 deletions
33
src/link.cpp
33
src/link.cpp
|
|
@ -49,7 +49,9 @@ _link_create_path_core(const string &oldbasepath,
|
|||
if(oldbasepath != newbasepath)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(newbasepath,oldbasepath,newfusedirpath.c_str());
|
||||
rv = fs::clonepath(newbasepath,oldbasepath,newfusedirpath.c_str());
|
||||
if(rv == -1)
|
||||
return errno;
|
||||
}
|
||||
|
||||
fs::path::make(&oldbasepath,oldfusepath,oldfullpath);
|
||||
|
|
@ -131,25 +133,18 @@ _clonepath_if_would_create(Policy::Func::Search searchFunc,
|
|||
newfusedirpathcstr = newfusedirpath.c_str();
|
||||
|
||||
rv = createFunc(srcmounts,newfusedirpathcstr,minfreespace,newbasepath);
|
||||
if(rv != -1)
|
||||
{
|
||||
if(oldbasepath == *newbasepath[0])
|
||||
{
|
||||
rv = searchFunc(srcmounts,newfusedirpathcstr,minfreespace,newbasepath);
|
||||
if(rv != -1)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(*newbasepath[0],oldbasepath,newfusedirpathcstr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = -1;
|
||||
errno = EXDEV;
|
||||
}
|
||||
}
|
||||
if(rv == -1)
|
||||
return -1;
|
||||
|
||||
return rv;
|
||||
if(oldbasepath != *newbasepath[0])
|
||||
return (errno=EXDEV,-1);
|
||||
|
||||
rv = searchFunc(srcmounts,newfusedirpathcstr,minfreespace,newbasepath);
|
||||
if(rv == -1)
|
||||
return -1;
|
||||
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
return fs::clonepath(*newbasepath[0],oldbasepath,newfusedirpathcstr);
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue