From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [RFC v9][PATCH 05/13] Dump memory address space Date: Tue, 11 Nov 2008 18:53:23 -0500 Message-ID: <491A1AF3.20609@cs.columbia.edu> References: <1226335060-7061-1-git-send-email-orenl@cs.columbia.edu> <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> <20081111164517.GA15999@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20081111164517.GA15999-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Serge E. Hallyn" Cc: Andrew Morton , Linus Torvalds , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thomas Gleixner , Dave Hansen , Ingo Molnar , "H. Peter Anvin" , Alexander Viro List-Id: linux-api@vger.kernel.org Serge E. Hallyn wrote: > Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org): >> +/** >> + * 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 = ¤t->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? Oops, that's a leftover from before supporting external checkpoint. Will fix. > > 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, Oren. -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html