• Andrey Vagin's avatar
    pipe: fix deadlock · ecc2776f
    Andrey Vagin authored
    Probably all of you know about "lock inversion". There was a similar
    problem on restoring pipes.
    
    One process try to restore pipe1 and waits when another process attached
    to it.  In this time another process restores pipe2 and waits too.
    
    I know two solves.
    1. Open all pipes -> attach to them -> close unnecessary ends.
    This method has a problem, if only one end belongs to the process.  In
    this cases another end occupies a descriptor, which may be needed to
    another pipe.
    
    2. Restore pipes in the same order. This patch does that.
    A sorted list of pipe entries are constructed.
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Acked-by: 's avatarPavel Emelianov <xemul@parallels.com>
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    ecc2776f
Name
Last commit
Last update
include Loading commit data...
kernel Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
INTERNALS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
TODO Loading commit data...
cr-dump.c Loading commit data...
cr-restore.c Loading commit data...
cr-show.c Loading commit data...
crtools.c Loading commit data...
gen-offsets.sh Loading commit data...
parasite-syscall.c Loading commit data...
parasite.c Loading commit data...
parasite.lds.S Loading commit data...
restorer.c Loading commit data...
seize.c Loading commit data...
util.c Loading commit data...