• David Howells's avatar
    afs: Fix cell DNS lookup · d5c32c89
    David Howells authored
    Currently, once configured, AFS cells are looked up in the DNS at regular
    intervals - which is a waste of resources if those cells aren't being
    used.  It also leads to a problem where cells preloaded, but not
    configured, before the network is brought up end up effectively statically
    configured with no VL servers and are unable to get any.
    
    Fix this by not doing the DNS lookup until the first time a cell is
    touched.  It is waited for if we don't have any cached records yet,
    otherwise the DNS lookup to maintain the record is done in the background.
    
    This has the downside that the first time you touch a cell, you now have to
    wait for the upcall to do the required DNS lookups rather than them already
    being cached.
    
    Further, the record is not replaced if the old record has at least one
    server in it and the new record doesn't have any.
    
    Fixes: 0a5143f2 ("afs: Implement VL server rotation")
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    d5c32c89
cell.c 20.5 KB