[CRIU] p.haul: mtouch test "Pre-dump failed"

Oscar Fernández oscarfernandz at gmail.com
Mon Mar 31 05:07:20 PDT 2014


Hi all,

I checked for that update in the repo, but I couldn't find it, so based in
that diff output I modified the file.c, recompiled with 'make' and tried
again the mtouch test. It failed again with the same "Pre-dump failed"
error.

I remade again the info files that Andrew asked the last time, there are
some differences with the old ones (less errors but the same error at the
end), find them attached. I also attached my files.c file (just in case you
want to check if I modified it correctly).

Meanwhile I'm working on try the mtouch test on 3.13 kernel.

Thanks.



2014-03-31 9:23 GMT+02:00 Andrew Vagin <avagin at parallels.com>:

> On Sun, Mar 30, 2014 at 02:30:40PM +0400, Cyrill Gorcunov wrote:
> > On Sun, Mar 30, 2014 at 01:41:43PM +0400, Andrew Vagin wrote:
> > > On Sat, Mar 29, 2014 at 10:44:03PM +0400, Cyrill Gorcunov wrote:
> > > > From cd6596469161ea85ffb03b0f2ab576509e83a187 Mon Sep 17 00:00:00
> 2001
> > > > From: Cyrill Gorcunov <gorcunov at openvz.org>
> > > > Date: Sat, 29 Mar 2014 22:43:14 +0400
> > > > Subject: [PATCH] files: predump_one_fd -- Use direct read of pid's
> fd link
> >
> > Attached
>
> Acked-by: Andrew Vagin <avagin at parallels.com>
>
> > From e33563110d586d3e52ef4a5d438be0038d0c450f Mon Sep 17 00:00:00 2001
> > From: Cyrill Gorcunov <gorcunov at openvz.org>
> > Date: Sat, 29 Mar 2014 22:43:14 +0400
> > Subject: [PATCH] files: predump_one_fd -- Use direct read of pid's fd
> link
> >
> > Using O_PATH known to be buggy on 3.11 kernel so use
> > direct link reading procedure here.
> >
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  files.c | 34 ++++++++++------------------------
> >  1 file changed, 10 insertions(+), 24 deletions(-)
> >
> > diff --git a/files.c b/files.c
> > index 3cf5e470c5c0..9f0c69141a88 100644
> > --- a/files.c
> > +++ b/files.c
> > @@ -405,33 +405,20 @@ err:
> >
> >  static int predump_one_fd(int pid, int fd)
> >  {
> > -     int lfd, ret = 0;
> > -     struct statfs buf;
> >       const struct fdtype_ops *ops;
> > -     char link[32];
> > -
> > -     /*
> > -      * This should look like the dump_task_files_seized,
> > -      * but since we pre-dump only *notify-s, we use the
> > -      * enightened version without fds draining.
> > -      */
> > -
> > -     lfd = __open_proc(pid, O_PATH | O_RDONLY, "fd/%d", fd);
> > -     if (lfd < 0)
> > -             return 0; /* That's OK, it can be a socket */
> > +     char link[PATH_MAX], t[32];
> > +     int ret = 0;
> >
> > -     if (fstatfs(lfd, &buf)) {
> > -             pr_perror("Can't fstatfs file");
> > +     snprintf(t, sizeof(t), "/proc/%d/fd/%d", pid, fd);
> > +     ret = readlink(t, link, sizeof(link));
> > +     if (ret < 0) {
> > +             pr_perror("Can't read link of fd %d", fd);
> > +             return -1;
> > +     } else if ((size_t)ret == sizeof(link)) {
> > +             pr_err("Buffer for read link of fd %d is too small\n", fd);
> >               return -1;
> >       }
> > -
> > -     if (buf.f_type != ANON_INODE_FS_MAGIC)
> > -             goto out;
> > -
> > -     if (read_fd_link(lfd, link, sizeof(link)) < 0) {
> > -             ret = -1;
> > -             goto out;
> > -     }
> > +     link[ret] = 0;
> >
> >       if (is_inotify_link(link))
> >               ops = &inotify_dump_ops;
> > @@ -443,7 +430,6 @@ static int predump_one_fd(int pid, int fd)
> >       pr_debug("Pre-dumping %d's %d fd\n", pid, fd);
> >       ret = ops->pre_dump(pid, fd);
> >  out:
> > -     close(lfd);
> >       return ret;
> >  }
> >
> > --
> > 1.8.3.1
> >
>
>


-- 
Óscar Fernández
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140331/4d690009/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: criu.predump.log
Type: text/x-log
Size: 38281 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140331/4d690009/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: files.c
Type: text/x-csrc
Size: 23488 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140331/4d690009/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mem-touch.lsof
Type: application/octet-stream
Size: 607 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140331/4d690009/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pd.log
Type: text/x-log
Size: 12048 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140331/4d690009/attachment-0005.bin>


More information about the CRIU mailing list