• Mat Martineau's avatar
    mptcp: Avoid acquiring PM lock for subflow priority changes · c21b50d5
    Mat Martineau authored
    The in-kernel path manager code for changing subflow flags acquired both
    the msk socket lock and the PM lock when possibly changing the "backup"
    and "fullmesh" flags. mptcp_pm_nl_mp_prio_send_ack() does not access
    anything protected by the PM lock, and it must release and reacquire
    the PM lock.
    
    By pushing the PM lock to where it is needed in mptcp_pm_nl_fullmesh(),
    the lock is only acquired when the fullmesh flag is changed and the
    backup flag code no longer has to release and reacquire the PM lock. The
    change in locking context requires the MIB update to be modified - move
    that to a better location instead.
    
    This change also makes it possible to call
    mptcp_pm_nl_mp_prio_send_ack() for the userspace PM commands without
    manipulating the in-kernel PM lock.
    
    Fixes: 0f9f696a ("mptcp: add set_flags command in PM netlink")
    Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c21b50d5
options.c 45.7 KB