]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix error handling in __write_ports_addxprt
authorJeff Layton <jlayton@redhat.com>
Mon, 19 Jul 2010 20:50:06 +0000 (16:50 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Jul 2010 12:51:24 +0000 (08:51 -0400)
commit19b52e3bcbc3915eae9b2d5e244f32b6cfa54e10
treedb6a42968f9069b17ad64200f7e7cd7c90c303bb
parent2512eba3e7bc01891012fa0548212deb0f0eaece
nfsd: fix error handling in __write_ports_addxprt

__write_ports_addxprt calls nfsd_create_serv. That increases the
refcount of nfsd_serv (which is tracked in sv_nrthreads). The service
only decrements the thread count on error, not on success like
__write_ports_addfd does, so using this interface leaves the nfsd
thread count high.

Fix this by having this function call svc_destroy() on error to release
the reference (and possibly to tear down the service) and simply
decrement the refcount without tearing down the service on success.

This makes the sv_threads handling work basically the same in both
__write_ports_addxprt and __write_ports_addfd.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfsctl.c