Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
8fd5b5d9
Commit
8fd5b5d9
authored
Mar 07, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't trigger SYSERROR for optional mounts
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
36ea44bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
conf.c
src/lxc/conf.c
+23
-18
No files found.
src/lxc/conf.c
View file @
8fd5b5d9
...
@@ -1821,11 +1821,18 @@ int parse_mntopts(const char *mntopts, unsigned long *mntflags,
...
@@ -1821,11 +1821,18 @@ int parse_mntopts(const char *mntopts, unsigned long *mntflags,
static
int
mount_entry
(
const
char
*
fsname
,
const
char
*
target
,
static
int
mount_entry
(
const
char
*
fsname
,
const
char
*
target
,
const
char
*
fstype
,
unsigned
long
mountflags
,
const
char
*
fstype
,
unsigned
long
mountflags
,
const
char
*
data
)
const
char
*
data
,
int
optional
)
{
{
if
(
mount
(
fsname
,
target
,
fstype
,
mountflags
&
~
MS_REMOUNT
,
data
))
{
if
(
mount
(
fsname
,
target
,
fstype
,
mountflags
&
~
MS_REMOUNT
,
data
))
{
SYSERROR
(
"failed to mount '%s' on '%s'"
,
fsname
,
target
);
if
(
optional
)
{
return
-
1
;
INFO
(
"failed to mount '%s' on '%s' (optional): %s"
,
fsname
,
target
,
strerror
(
errno
));
return
0
;
}
else
{
SYSERROR
(
"failed to mount '%s' on '%s'"
,
fsname
,
target
);
return
-
1
;
}
}
}
if
((
mountflags
&
MS_REMOUNT
)
||
(
mountflags
&
MS_BIND
))
{
if
((
mountflags
&
MS_REMOUNT
)
||
(
mountflags
&
MS_BIND
))
{
...
@@ -1835,9 +1842,16 @@ static int mount_entry(const char *fsname, const char *target,
...
@@ -1835,9 +1842,16 @@ static int mount_entry(const char *fsname, const char *target,
if
(
mount
(
fsname
,
target
,
fstype
,
if
(
mount
(
fsname
,
target
,
fstype
,
mountflags
|
MS_REMOUNT
,
data
))
{
mountflags
|
MS_REMOUNT
,
data
))
{
SYSERROR
(
"failed to mount '%s' on '%s'"
,
if
(
optional
)
{
fsname
,
target
);
INFO
(
"failed to mount '%s' on '%s' (optional): %s"
,
return
-
1
;
fsname
,
target
,
strerror
(
errno
));
return
0
;
}
else
{
SYSERROR
(
"failed to mount '%s' on '%s'"
,
fsname
,
target
);
return
-
1
;
}
}
}
}
}
...
@@ -1910,10 +1924,7 @@ static inline int mount_entry_on_systemfs(struct mntent *mntent)
...
@@ -1910,10 +1924,7 @@ static inline int mount_entry_on_systemfs(struct mntent *mntent)
}
}
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
mntent
->
mnt_dir
,
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
mntent
->
mnt_dir
,
mntent
->
mnt_type
,
mntflags
,
mntdata
);
mntent
->
mnt_type
,
mntflags
,
mntdata
,
optional
);
if
(
optional
)
ret
=
0
;
free
(
pathdirname
);
free
(
pathdirname
);
free
(
mntdata
);
free
(
mntdata
);
...
@@ -2000,13 +2011,10 @@ skipabs:
...
@@ -2000,13 +2011,10 @@ skipabs:
}
}
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
path
,
mntent
->
mnt_type
,
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
path
,
mntent
->
mnt_type
,
mntflags
,
mntdata
);
mntflags
,
mntdata
,
optional
);
free
(
mntdata
);
free
(
mntdata
);
if
(
optional
)
ret
=
0
;
out:
out:
free
(
pathdirname
);
free
(
pathdirname
);
return
ret
;
return
ret
;
...
@@ -2059,10 +2067,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
...
@@ -2059,10 +2067,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
}
}
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
path
,
mntent
->
mnt_type
,
ret
=
mount_entry
(
mntent
->
mnt_fsname
,
path
,
mntent
->
mnt_type
,
mntflags
,
mntdata
);
mntflags
,
mntdata
,
optional
);
if
(
optional
)
ret
=
0
;
free
(
pathdirname
);
free
(
pathdirname
);
free
(
mntdata
);
free
(
mntdata
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment