mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 18:55:12 +00:00
NFSD: Mark filecache "down" if init fails
[ Upstream commitdc0d0f885a
] NeilBrown says: > The handling of NFSD_FILE_CACHE_UP is strange. nfsd_file_cache_init() > sets it, but doesn't clear it on failure. So if nfsd_file_cache_init() > fails for some reason, nfsd_file_cache_shutdown() would still try to > clean up if it was called. Reported-by: NeilBrown <neilb@suse.de> Fixes:c7b824c3d0
("NFSD: Replace the "init once" mechanism") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fc2f4a5a71
commit
7cfc972acb
@ -718,7 +718,7 @@ nfsd_file_cache_init(void)
|
||||
|
||||
ret = rhltable_init(&nfsd_file_rhltable, &nfsd_file_rhash_params);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
ret = -ENOMEM;
|
||||
nfsd_filecache_wq = alloc_workqueue("nfsd_filecache", 0, 0);
|
||||
@ -770,6 +770,8 @@ nfsd_file_cache_init(void)
|
||||
|
||||
INIT_DELAYED_WORK(&nfsd_filecache_laundrette, nfsd_file_gc_worker);
|
||||
out:
|
||||
if (ret)
|
||||
clear_bit(NFSD_FILE_CACHE_UP, &nfsd_file_flags);
|
||||
return ret;
|
||||
out_notifier:
|
||||
lease_unregister_notifier(&nfsd_file_lease_notifier);
|
||||
|
Loading…
Reference in New Issue
Block a user