• Arnd Bergmann's avatar
    macvtap: rework object lifetime rules · 02df55d2
    Arnd Bergmann authored
    This reworks the change done by the previous patch
    in a more complete way.
    
    The original macvtap code has a number of problems
    resulting from the use of RCU for protecting the
    access to struct macvtap_queue from open files.
    
    This includes
    - need for GFP_ATOMIC allocations for skbs
    - potential deadlocks when copy_*_user sleeps
    - inability to work with vhost-net
    
    Changing the lifetime of macvtap_queue to always
    depend on the open file solves all these. The
    RCU reference simply moves one step down to
    the reference on the macvlan_dev, which we
    only need for nonblocking operations.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarSridhar Samudrala <sri@us.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    02df55d2
macvtap.c 13.2 KB