[CRIU] [PATCH] irmap: add --irmap-scan-path option
Pavel Emelyanov
xemul at parallels.com
Mon Sep 21 01:47:16 PDT 2015
On 09/16/2015 07:27 AM, Tycho Andersen wrote:
> This option allows users to specify their own irmap paths to scan in the event
> that they don't have a path in one of the hard coded hints.
Applied, thanks! One comment inline :) to be fixed on top.
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> @@ -260,6 +262,27 @@ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino)
> goto out;
> }
>
> + /* Let's scan any user provided paths first; since the user told us
> + * about them, hopefully they're more interesting than our hints.
> + */
> + list_for_each_entry(o, &opts.irmap_scan_paths, node) {
> + struct irmap *ir;
> +
> + ir = xzalloc(sizeof(*ir));
> + if (!ir)
> + goto out;
> +
> + ir->nr_kids = -1;
> + ir->path = o->path;
> +
> + c = irmap_scan(ir, s_dev, i_ino);
> + if (c) {
> + pr_debug("\tScanned %s\n", c->path);
> + path = c->path;
> + goto out;
> + }
Here we leak the ir object. Any additional call to irmal_resolve will add more and
more of them.
> + }
> +
> for (h = hints; h->path; h++) {
> pr_debug("Scanning %s hint\n", h->path);
> c = irmap_scan(h, s_dev, i_ino);
More information about the CRIU
mailing list