Commit 31a26026 authored by Stanislav Kinsburskiy's avatar Stanislav Kinsburskiy Committed by Pavel Emelyanov

autofs: use temporary value for virtual pgrp on dump

Otherwise information about real pid is lost in case of pid_to_virt returned
zero. This is required to output the real pid in error message instead of
always outputting zero (result of pid_to_virt).
IOW, would be nice to know the process pid we failed to find in the tree.
Signed-off-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 63d61425
...@@ -290,7 +290,7 @@ static int autofs_create_entry(struct mount_info *pm, AutofsEntry *entry) ...@@ -290,7 +290,7 @@ static int autofs_create_entry(struct mount_info *pm, AutofsEntry *entry)
entry->has_gid = true; entry->has_gid = true;
if (entry->fd != AUTOFS_CATATONIC_FD) { if (entry->fd != AUTOFS_CATATONIC_FD) {
int found, read_fd; int found, read_fd, virt_pgrp;
read_fd = autofs_find_read_fd(entry->pgrp, pipe_ino); read_fd = autofs_find_read_fd(entry->pgrp, pipe_ino);
if (read_fd < 0) if (read_fd < 0)
...@@ -310,13 +310,14 @@ static int autofs_create_entry(struct mount_info *pm, AutofsEntry *entry) ...@@ -310,13 +310,14 @@ static int autofs_create_entry(struct mount_info *pm, AutofsEntry *entry)
} }
/* We need to get virtual pgrp to restore mount */ /* We need to get virtual pgrp to restore mount */
entry->pgrp = pid_to_virt(entry->pgrp); virt_pgrp = pid_to_virt(entry->pgrp);
if (!entry->pgrp) { if (!virt_pgrp) {
pr_err("failed to find pstree item with pid %d\n", pr_err("failed to find pstree item with pid %d\n",
entry->pgrp); entry->pgrp);
pr_err("Non-catatonic mount without master?\n"); pr_err("Non-catatonic mount without master?\n");
return -1; return -1;
} }
entry->pgrp = virt_pgrp;
} }
return 0; return 0;
} }
......
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