• Veaceslav Falico's avatar
    net: rename sysfs symlinks on device name change · 5bb025fa
    Veaceslav Falico authored
    Currently, we don't rename the upper/lower_ifc symlinks in
    /sys/class/net/*/ , which might result stale/duplicate links/names.
    
    Fix this by adding netdev_adjacent_rename_links(dev, oldname) which renames
    all the upper/lower interface's links to dev from the upper/lower_oldname
    to the new name.
    
    We don't need a rollback because only we control these symlinks and if we
    fail to rename them - sysfs will anyway complain.
    Reported-by: default avatarDing Tianhong <dingtianhong@huawei.com>
    CC: Ding Tianhong <dingtianhong@huawei.com>
    CC: "David S. Miller" <davem@davemloft.net>
    CC: Eric Dumazet <edumazet@google.com>
    CC: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    CC: Cong Wang <amwang@redhat.com>
    Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5bb025fa
dev.c 174 KB