mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
NFSD: Decrease nfsd_users in nfsd_startup_generic fail
commitd9499a9571upstream. A memory allocation failure could cause nfsd_startup_generic to fail, in which case nfsd_users wouldn't be incorrectly left elevated. After nfsd restarts nfsd_startup_generic will then succeed without doing anything--the first consequence is likely nfs4_start_net finding a bad laundry_wq and crashing. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Fixes:4539f14981"nfsd: replace boolean nfsd_up flag by users counter" Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6a5335b46b
commit
caacbac7bf
@@ -220,7 +220,8 @@ static int nfsd_startup_generic(int nrservs)
|
||||
*/
|
||||
ret = nfsd_racache_init(2*nrservs);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto dec_users;
|
||||
|
||||
ret = nfs4_state_start();
|
||||
if (ret)
|
||||
goto out_racache;
|
||||
@@ -228,6 +229,8 @@ static int nfsd_startup_generic(int nrservs)
|
||||
|
||||
out_racache:
|
||||
nfsd_racache_shutdown();
|
||||
dec_users:
|
||||
nfsd_users--;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user