• Jeff Layton's avatar
    nfsd: fix startup order in nfsd_reply_cache_init · ac534ff2
    Jeff Layton authored
    If we end up doing "goto out_nomem" in this function, we'll call
    nfsd_reply_cache_shutdown. That will attempt to walk the LRU list and
    free entries, but that list may not be initialized yet if the server is
    starting up for the first time. It's also possible for the shrinker to
    kick in before we've initialized the LRU list.
    
    Rearrange the initialization so that the LRU list_head and cache size
    are initialized before doing any of the allocations that might fail.
    Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    ac534ff2
nfscache.c 12.7 KB