Commit b1a8e41d authored by Pavel Emelyanov's avatar Pavel Emelyanov

mnt: Don't validate mounts on pre-dump

This is for two reasons. First, validation can meet external mount
and will call plugins, which is not correct on pre-dump and actually
crashes on uninitilized plugins lists. Second, even if on pre-dump
mount tree is not "supported" this can be a temporary situation (yes,
yes, unlikely, but still).

On the other hand, it's better to fail earlier, but that's another
story.
Reported-by: 's avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
parent a6e746ba
......@@ -48,7 +48,7 @@ extern struct collect_image_info nsfile_cinfo;
extern int walk_namespaces(struct ns_desc *nd, int (*cb)(struct ns_id *, void *), void *oarg);
extern int collect_namespaces(bool for_dump);
extern int collect_mnt_namespaces(void);
extern int collect_mnt_namespaces(bool for_dump);
extern int dump_mnt_namespaces(void);
extern int dump_namespaces(struct pstree_item *item, unsigned int ns_flags);
extern int prepare_namespace(struct pstree_item *item, unsigned long clone_flags);
......
......@@ -2146,7 +2146,7 @@ static int collect_mntns(struct ns_id *ns, void *oarg)
return 0;
}
int collect_mnt_namespaces(void)
int collect_mnt_namespaces(bool for_dump)
{
int need_to_validate = 0, ret;
......@@ -2154,7 +2154,7 @@ int collect_mnt_namespaces(void)
if (ret)
goto err;
if (need_to_validate) {
if (for_dump && need_to_validate) {
if (collect_shared(mntinfo))
goto err;
if (validate_mounts(mntinfo, true))
......
......@@ -573,7 +573,7 @@ int collect_namespaces(bool for_dump)
{
int ret;
ret = collect_mnt_namespaces();
ret = collect_mnt_namespaces(for_dump);
if (ret < 0)
return ret;
......
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