• Pavel Emelyanov's avatar
    vma: Fix badly inherited FD in filemap_open · f0a87835
    Pavel Emelyanov authored
    Previous patch (5a1e1aac) tried to minimize the amount of
    open()s called when mmap()ing the files. Unfortunatley, there
    was a mistake and wrong flags were compared which resulted in
    the whole optimization working randomly (typically not
    working).
    
    Fixing the flags comparison revealed another problem. The
    patch in question correllated with the 03e8c417 one, which
    caused some vmas to be opened and mmaped much later than the
    premap. When hitting the situation when vmas sharing their
    fds are partially premapped and partially not, the whole
    vm_open sharing became broken in multiple places -- either
    needed fd was not opened, or the not needed left un-closed.
    
    To fix this the context, that tracks whether the fd should
    be shared or not, should be moved from collect stage to
    the real opening loop. In this case we need to explicitly
    know which vmas _may_ share fds (file private and shared)
    with each other, so the sharing knowledge becomes spread
    between open_filemap() and its callers. Oh, well...
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    f0a87835
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...