Skip to content
  • David Howells's avatar
    afs: Fix refcounting in callback registration · d4a96bec
    David Howells authored
    The refcounting on afs_cb_interest struct objects in
    afs_register_server_cb_interest() is wrong as it uses the server list
    entry's call back interest pointer without regard for the fact that it
    might be replaced at any time and the object thrown away.
    
    Fix this by:
    
     (1) Put a lock on the afs_server_list struct that can be used to
         mediate access to the callback interest pointers in the servers array.
    
     (2) Keep a ref on the callback interest that we get from the entry.
    
     (3) Dropping the old reference held by vnode->cb_interest if we replace
         the pointer.
    
    Fixes: c435ee34
    
     ("afs: Overhaul the callback handling")
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    d4a96bec