Commit 90d0a6a0 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Collect mount root as well when parsing proc

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 79da5384
...@@ -89,6 +89,7 @@ struct proc_mountinfo { ...@@ -89,6 +89,7 @@ struct proc_mountinfo {
int mnt_id; int mnt_id;
int parent_mnt_id; int parent_mnt_id;
unsigned int s_dev; unsigned int s_dev;
char root[64];
char mountpoint[64]; char mountpoint[64];
}; };
......
...@@ -485,7 +485,6 @@ int parse_mountinfo(pid_t pid, struct proc_mountinfo *mi, int nr_elems) ...@@ -485,7 +485,6 @@ int parse_mountinfo(pid_t pid, struct proc_mountinfo *mi, int nr_elems)
while (fgets(str, sizeof(str), f)) { while (fgets(str, sizeof(str), f)) {
unsigned int kmaj, kmin, parent_mnt_id; unsigned int kmaj, kmin, parent_mnt_id;
char mnt_root[63];
int ret; int ret;
if ((i + 1) >= nr_elems) { if ((i + 1) >= nr_elems) {
...@@ -495,7 +494,7 @@ int parse_mountinfo(pid_t pid, struct proc_mountinfo *mi, int nr_elems) ...@@ -495,7 +494,7 @@ int parse_mountinfo(pid_t pid, struct proc_mountinfo *mi, int nr_elems)
ret = sscanf(str, "%i %i %u:%u %63s %63s", ret = sscanf(str, "%i %i %u:%u %63s %63s",
&mi[i].mnt_id, &parent_mnt_id, &mi[i].mnt_id, &parent_mnt_id,
&kmaj, &kmin, mnt_root, &kmaj, &kmin, mi[i].root,
mi[i].mountpoint); mi[i].mountpoint);
if (ret != 6) { if (ret != 6) {
pr_err("Bad format in %d mountinfo\n", pid); pr_err("Bad format in %d mountinfo\n", pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment