]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix startup order in nfsd_reply_cache_init
authorJeff Layton <jlayton@redhat.com>
Fri, 15 Mar 2013 13:16:29 +0000 (09:16 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 18 Mar 2013 21:21:30 +0000 (17:21 -0400)
commit707b10a03e05bf844dddaa473b6621952eb323e7
treedb11b9341feb5b90305fa3594549a86e0ea89448
parentb606cb9da0f80801ffde3f59a4d17f2604820ea4
nfsd: fix startup order in nfsd_reply_cache_init

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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfscache.c