• Kirill Tkhai's avatar
    files-reg: Create ghost files in first existing parent directory · 6345b6aa
    Kirill Tkhai authored
    Since a deleted file may belong to a deleted directory
    (which, in turn, may belong to another deleted, etc),
    it's necessary to recreate all missing dentries in the path.
    
    Doing this in mkreg_ghost() is not a good idea, because
    another ghost file may need some of the dentries in the path,
    and this requires to do refcouting of recreated directories.
    
    To avoid this, we restore a ghost file in the first existing
    parent directory of the patch. This guarantees, the ghost file
    will be in the same mount with target file (rfi_remap() needs
    that, because it uses link()).
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    6345b6aa
files-reg.c 35.2 KB