• Cyrill Gorcunov's avatar
    mnt: Carry run-time device ID in mount_info · 6217a84a
    Cyrill Gorcunov authored
    When we're restoring fsnotify watchees we need to resolve
    path to a handle at some mountpoint referred by @s_dev
    member (device ID) which is saved inside image. This
    ID actually may be changed at the every mount (say
    one restores container after machine reboot) or in
    case of container's migration.
    
    Thus the test for overmounting in __open_mountpoint
    will fail and we get an error.
    
    Lets do a trick: introduce @s_dev_rt member which
    is supposed to carry run-time device ID. When dumping
    this member simply equal to traditional @s_dev fetched
    from the procfs, but when restoring we fetch it from
    stat call once mountpoint become alive.
    
    https://jira.sw.ru/browse/PSBM-41610
    
    v2:
     - predefine MOUNT_INVALID_DEV
     - use fetch_rt_stat instead of assigning device in restore_shared_options
     - copy @s_dev_rt in propagate_siblings and propagate_mount
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    6217a84a
mount.h 3.71 KB