mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-01 15:28:45 +08:00
Merge pull request #203 from trapexit/mknod-fix
fix indexing of mknod targets. closes #202
This commit is contained in:
commit
091cc230d8
|
@ -47,9 +47,8 @@ _mkdir(Policy::Func::Search searchFunc,
|
|||
int rv;
|
||||
int error;
|
||||
string dirname;
|
||||
string fullpath;
|
||||
string existingpath;
|
||||
vector<string> createpaths;
|
||||
vector<string> existingpath;
|
||||
|
||||
dirname = fs::path::dirname(fusepath);
|
||||
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
|
||||
|
@ -65,10 +64,10 @@ _mkdir(Policy::Func::Search searchFunc,
|
|||
{
|
||||
string &createpath = createpaths[i];
|
||||
|
||||
if(createpath != existingpath[0])
|
||||
if(createpath != existingpath)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(existingpath[0],createpath,dirname);
|
||||
fs::clonepath(existingpath,createpath,dirname);
|
||||
}
|
||||
|
||||
fs::path::append(createpath,fusepath);
|
||||
|
|
|
@ -49,8 +49,8 @@ _mknod(Policy::Func::Search searchFunc,
|
|||
int rv;
|
||||
int error;
|
||||
string dirname;
|
||||
string existingpath;
|
||||
vector<string> createpaths;
|
||||
vector<string> existingpath;
|
||||
|
||||
dirname = fs::path::dirname(fusepath);
|
||||
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
|
||||
|
@ -64,12 +64,12 @@ _mknod(Policy::Func::Search searchFunc,
|
|||
error = -1;
|
||||
for(size_t i = 0, ei = createpaths.size(); i != ei; i++)
|
||||
{
|
||||
string &createpath = createpaths[0];
|
||||
string &createpath = createpaths[i];
|
||||
|
||||
if(createpath != existingpath[0])
|
||||
if(createpath != existingpath)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(existingpath[0],createpath,dirname);
|
||||
fs::clonepath(existingpath,createpath,dirname);
|
||||
}
|
||||
|
||||
fs::path::append(createpath,fusepath);
|
||||
|
|
Loading…
Reference in New Issue
Block a user