mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-23 00:16:31 -05:00
stop clonepath at base directory. fixes #467
This commit is contained in:
parent
62ae871d51
commit
f48c16d162
14 changed files with 238 additions and 267 deletions
|
|
@ -49,10 +49,8 @@ _mknod_core(const string &fullpath,
|
|||
|
||||
static
|
||||
int
|
||||
_mknod_loop_core(const string &existingpath,
|
||||
const string &createpath,
|
||||
_mknod_loop_core(const string &createpath,
|
||||
const char *fusepath,
|
||||
const char *fusedirpath,
|
||||
const mode_t mode,
|
||||
const mode_t umask,
|
||||
const dev_t dev,
|
||||
|
|
@ -61,14 +59,6 @@ _mknod_loop_core(const string &existingpath,
|
|||
int rv;
|
||||
string fullpath;
|
||||
|
||||
if(createpath != existingpath)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
rv = fs::clonepath(existingpath,createpath,fusedirpath);
|
||||
if(rv == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fs::path::make(&createpath,fusepath,fullpath);
|
||||
|
||||
rv = _mknod_core(fullpath,mode,umask,dev);
|
||||
|
|
@ -86,14 +76,19 @@ _mknod_loop(const string &existingpath,
|
|||
const mode_t umask,
|
||||
const dev_t dev)
|
||||
{
|
||||
int rv;
|
||||
int error;
|
||||
|
||||
error = -1;
|
||||
for(size_t i = 0, ei = createpaths.size(); i != ei; i++)
|
||||
{
|
||||
error = _mknod_loop_core(existingpath,*createpaths[i],
|
||||
fusepath,fusedirpath,
|
||||
mode,umask,dev,error);
|
||||
rv = fs::clonepath_as_root(existingpath,*createpaths[i],fusedirpath);
|
||||
if(rv == -1)
|
||||
error = error::calc(rv,error,errno);
|
||||
else
|
||||
error = _mknod_loop_core(*createpaths[i],
|
||||
fusepath,
|
||||
mode,umask,dev,error);
|
||||
}
|
||||
|
||||
return -error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue