Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
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
zhul
criu
Commits
89d95787
Commit
89d95787
authored
Jan 23, 2015
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: Print parsed fstype for unsupported mounts
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d1d4c018
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
proc_parse.c
proc_parse.c
+8
-4
No files found.
proc_parse.c
View file @
89d95787
...
@@ -910,7 +910,7 @@ static int parse_mnt_opt(char *str, struct mount_info *mi, int *off)
...
@@ -910,7 +910,7 @@ static int parse_mnt_opt(char *str, struct mount_info *mi, int *off)
return
0
;
return
0
;
}
}
static
int
parse_mountinfo_ent
(
char
*
str
,
struct
mount_info
*
new
)
static
int
parse_mountinfo_ent
(
char
*
str
,
struct
mount_info
*
new
,
char
**
r_fstype
)
{
{
unsigned
int
kmaj
,
kmin
;
unsigned
int
kmaj
,
kmin
;
int
ret
,
n
;
int
ret
,
n
;
...
@@ -951,6 +951,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
...
@@ -951,6 +951,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
ret
=
-
1
;
ret
=
-
1
;
new
->
fstype
=
find_fstype_by_name
(
fstype
);
new
->
fstype
=
find_fstype_by_name
(
fstype
);
if
(
new
->
fstype
->
code
==
FSTYPE__UNSUPPORTED
)
*
r_fstype
=
fstype
;
/* keep for logging */
new
->
options
=
xmalloc
(
strlen
(
opt
)
+
1
);
new
->
options
=
xmalloc
(
strlen
(
opt
)
+
1
);
if
(
!
new
->
options
)
if
(
!
new
->
options
)
...
@@ -962,7 +964,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
...
@@ -962,7 +964,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
ret
=
0
;
ret
=
0
;
err:
err:
free
(
opt
);
free
(
opt
);
free
(
fstype
);
if
(
!*
r_fstype
)
free
(
fstype
);
return
ret
;
return
ret
;
}
}
...
@@ -981,6 +984,7 @@ struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid)
...
@@ -981,6 +984,7 @@ struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid)
while
(
fgets
(
str
,
sizeof
(
str
),
f
))
{
while
(
fgets
(
str
,
sizeof
(
str
),
f
))
{
struct
mount_info
*
new
;
struct
mount_info
*
new
;
int
ret
;
int
ret
;
char
*
fst
=
NULL
;
new
=
mnt_entry_alloc
();
new
=
mnt_entry_alloc
();
if
(
!
new
)
if
(
!
new
)
...
@@ -991,14 +995,14 @@ struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid)
...
@@ -991,14 +995,14 @@ struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid)
new
->
next
=
list
;
new
->
next
=
list
;
list
=
new
;
list
=
new
;
ret
=
parse_mountinfo_ent
(
str
,
new
);
ret
=
parse_mountinfo_ent
(
str
,
new
,
&
fst
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
pr_err
(
"Bad format in %d mountinfo
\n
"
,
pid
);
pr_err
(
"Bad format in %d mountinfo
\n
"
,
pid
);
goto
err
;
goto
err
;
}
}
pr_info
(
"
\t
type %s source %s mnt_id %#x s_dev %#x %s @ %s flags %#x options %s
\n
"
,
pr_info
(
"
\t
type %s source %s mnt_id %#x s_dev %#x %s @ %s flags %#x options %s
\n
"
,
new
->
fstype
->
name
,
new
->
source
,
fst
?
:
new
->
fstype
->
name
,
new
->
source
,
new
->
mnt_id
,
new
->
s_dev
,
new
->
root
,
new
->
mountpoint
,
new
->
mnt_id
,
new
->
s_dev
,
new
->
root
,
new
->
mountpoint
,
new
->
flags
,
new
->
options
);
new
->
flags
,
new
->
options
);
...
...
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