Skip to content

Commit

Permalink
Merge pull request #2860 from stgraber/master
Browse files Browse the repository at this point in the history
mount: Allow over-mounting
  • Loading branch information
brauner committed Feb 16, 2019
2 parents eba282e + 7152131 commit 7a8959d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lxc/lxccontainer.c
Expand Up @@ -4970,7 +4970,10 @@ static int create_mount_target(const char *dest, mode_t st_mode)
ret = mkdir(dest, 0000);
else
ret = mknod(dest, S_IFREG | 0000, 0);
if (ret < 0) {

if (ret == 0)
TRACE("Created mount target \"%s\"", dest);
else if (ret < 0 && ret != EEXIST) {
SYSERROR("Failed to create mount target \"%s\"", dest);
return -1;
}
Expand Down Expand Up @@ -5071,12 +5074,9 @@ static int do_lxcapi_mount(struct lxc_container *c, const char *source,
_exit(EXIT_FAILURE);
}

if (access(target, F_OK) < 0 && errno == ENOENT) {
ret = create_mount_target(target, sb.st_mode);
if (ret < 0)
_exit(EXIT_FAILURE);
TRACE("Created mount target \"%s\"", target);
}
ret = create_mount_target(target, sb.st_mode);
if (ret < 0)
_exit(EXIT_FAILURE);

suff = strrchr(template, '/');
if (!suff)
Expand Down

0 comments on commit 7a8959d

Please sign in to comment.