[CRIU] Re: [PATCH] reg-files: Serialize linking of ghost files

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 17 10:28:57 EDT 2012


On Mon, Sep 17, 2012 at 06:22:51PM +0400, Pavel Emelyanov wrote:
> On 09/17/2012 02:47 PM, Cyrill Gorcunov wrote:
> > On Mon, Sep 17, 2012 at 02:31:18PM +0400, Cyrill Gorcunov wrote:
> >> On Mon, Sep 17, 2012 at 02:26:47PM +0400, Pavel Emelyanov wrote:
> >>> On 09/17/2012 12:50 PM, Cyrill Gorcunov wrote:
> >>>> In case if there at least two tasks with same ghost
> >>>> file we've a race in open_path -- both task may enter
> >>>> the open_path at same time and try to link ghost file
> >>>> to same name leading to
> >>>>
> >>>>  | 26445: Error (files-reg.c:363): Can't link
> >>>>  | /home/crtools/test/zdtm/live/static/write_read10.test (deleted).cr.1.ghost ->
> >>>>  | /home/crtools/test/zdtm/live/static/write_read10.test (deleted)
> >>>>
> >>>> The both tasks have ghost files as
> >>>>
> >>>>  | id:  0x3 flags: 0x8002 pos: 0000000000000000 ... name: "/home/crtools/test/zdtm/live/static/write_read10.test (deleted)"
> >>>>
> >>>> and
> >>>>
> >>>>  | id: 0x10 flags: 0x8002 pos: 0000000000000000 ... name: "/home/crtools/test/zdtm/live/static/write_read10.test (deleted)"
> >>>>
> >>>> Thus, to serialize link/unlink procedure we use per-ghost-file mutex.
> >>>
> >>> In that case users can be just unsigned int
> >>
> >> Yes, but I didn't want to squash everything in one patch. I'll do that on top.
> > 
> > Here is one on top.
> 
> There's a race with two ghosts of the same name.

Pavel, would it be an error if we just generate names for unlinked files?
I mean instead of that "  (deleted)" name created by dcache for us we could
simply generate unique names, no?

	Cyrill


More information about the CRIU mailing list