lkml.org 
[lkml]   [2008]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v9][PATCH 05/13] Dump memory address space
Quoting Oren Laadan (orenl@cs.columbia.edu):
> +/**
> + * cr_fill_fname - return pathname of a given file
> + * @path: path name
> + * @root: relative root
> + * @buf: buffer for pathname
> + * @n: buffer length (in) and pathname length (out)
> + */
> +static char *
> +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n)
> +{
> + struct path tmp = *root;
> + char *fname;
> +
> + BUG_ON(!buf);
> + fname = __d_path(path, &tmp, buf, *n);
> + if (!IS_ERR(fname))
> + *n = (buf + (*n) - fname);
> + /*
> + * FIXME: if __d_path() changed these, it must have stepped out of
> + * init's namespace. Since currently we require a unified namespace
> + * within the container: simply fail.
> + */
> + if (tmp.mnt != root->mnt || tmp.dentry != root->dentry)
> + fname = ERR_PTR(-EBADF);

...

> +static int cr_ctx_checkpoint(struct cr_ctx *ctx, pid_t pid)
> +{
> + ctx->root_pid = pid;
> +
> + /*
> + * assume checkpointer is in container's root vfs
> + * FIXME: this works for now, but will change with real containers
> + */
> + ctx->vfsroot = &current->fs->root;
> + path_get(ctx->vfsroot);

Hi Oren,

Is there really any good reason to use current->fs->root rather
than ctx->root_task->fs->root here?

The way I'm testing, the checkpointer is in fact in a different
container, so the root passed into cr_fill_fname() is different
from the container's root, so cr_fill_fname() always returns me
-EBADF.

thanks,
-serge


\
 
 \ /
  Last update: 2008-11-11 17:49    [W:0.332 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site