nfssvc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. /*
  2. * Central processing for nfsd.
  3. *
  4. * Authors: Olaf Kirch (okir@monad.swb.de)
  5. *
  6. * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
  7. */
  8. #include <linux/sched.h>
  9. #include <linux/freezer.h>
  10. #include <linux/fs_struct.h>
  11. #include <linux/swap.h>
  12. #include <linux/sunrpc/stats.h>
  13. #include <linux/sunrpc/svcsock.h>
  14. #include <linux/lockd/bind.h>
  15. #include <linux/nfsacl.h>
  16. #include <linux/seq_file.h>
  17. #include <net/net_namespace.h>
  18. #include "nfsd.h"
  19. #include "cache.h"
  20. #include "vfs.h"
  21. #define NFSDDBG_FACILITY NFSDDBG_SVC
  22. extern struct svc_program nfsd_program;
  23. static int nfsd(void *vrqstp);
  24. struct timeval nfssvc_boot;
  25. /*
  26. * nfsd_mutex protects nfsd_serv -- both the pointer itself and the members
  27. * of the svc_serv struct. In particular, ->sv_nrthreads but also to some
  28. * extent ->sv_temp_socks and ->sv_permsocks. It also protects nfsdstats.th_cnt
  29. *
  30. * If (out side the lock) nfsd_serv is non-NULL, then it must point to a
  31. * properly initialised 'struct svc_serv' with ->sv_nrthreads > 0. That number
  32. * of nfsd threads must exist and each must listed in ->sp_all_threads in each
  33. * entry of ->sv_pools[].
  34. *
  35. * Transitions of the thread count between zero and non-zero are of particular
  36. * interest since the svc_serv needs to be created and initialized at that
  37. * point, or freed.
  38. *
  39. * Finally, the nfsd_mutex also protects some of the global variables that are
  40. * accessed when nfsd starts and that are settable via the write_* routines in
  41. * nfsctl.c. In particular:
  42. *
  43. * user_recovery_dirname
  44. * user_lease_time
  45. * nfsd_versions
  46. */
  47. DEFINE_MUTEX(nfsd_mutex);
  48. struct svc_serv *nfsd_serv;
  49. /*
  50. * nfsd_drc_lock protects nfsd_drc_max_pages and nfsd_drc_pages_used.
  51. * nfsd_drc_max_pages limits the total amount of memory available for
  52. * version 4.1 DRC caches.
  53. * nfsd_drc_pages_used tracks the current version 4.1 DRC memory usage.
  54. */
  55. spinlock_t nfsd_drc_lock;
  56. unsigned int nfsd_drc_max_mem;
  57. unsigned int nfsd_drc_mem_used;
  58. #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  59. static struct svc_stat nfsd_acl_svcstats;
  60. static struct svc_version * nfsd_acl_version[] = {
  61. [2] = &nfsd_acl_version2,
  62. [3] = &nfsd_acl_version3,
  63. };
  64. #define NFSD_ACL_MINVERS 2
  65. #define NFSD_ACL_NRVERS ARRAY_SIZE(nfsd_acl_version)
  66. static struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS];
  67. static struct svc_program nfsd_acl_program = {
  68. .pg_prog = NFS_ACL_PROGRAM,
  69. .pg_nvers = NFSD_ACL_NRVERS,
  70. .pg_vers = nfsd_acl_versions,
  71. .pg_name = "nfsacl",
  72. .pg_class = "nfsd",
  73. .pg_stats = &nfsd_acl_svcstats,
  74. .pg_authenticate = &svc_set_client,
  75. };
  76. static struct svc_stat nfsd_acl_svcstats = {
  77. .program = &nfsd_acl_program,
  78. };
  79. #endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */
  80. static struct svc_version * nfsd_version[] = {
  81. [2] = &nfsd_version2,
  82. #if defined(CONFIG_NFSD_V3)
  83. [3] = &nfsd_version3,
  84. #endif
  85. #if defined(CONFIG_NFSD_V4)
  86. [4] = &nfsd_version4,
  87. #endif
  88. };
  89. #define NFSD_MINVERS 2
  90. #define NFSD_NRVERS ARRAY_SIZE(nfsd_version)
  91. static struct svc_version *nfsd_versions[NFSD_NRVERS];
  92. struct svc_program nfsd_program = {
  93. #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  94. .pg_next = &nfsd_acl_program,
  95. #endif
  96. .pg_prog = NFS_PROGRAM, /* program number */
  97. .pg_nvers = NFSD_NRVERS, /* nr of entries in nfsd_version */
  98. .pg_vers = nfsd_versions, /* version table */
  99. .pg_name = "nfsd", /* program name */
  100. .pg_class = "nfsd", /* authentication class */
  101. .pg_stats = &nfsd_svcstats, /* version table */
  102. .pg_authenticate = &svc_set_client, /* export authentication */
  103. };
  104. u32 nfsd_supported_minorversion;
  105. int nfsd_vers(int vers, enum vers_op change)
  106. {
  107. if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
  108. return 0;
  109. switch(change) {
  110. case NFSD_SET:
  111. nfsd_versions[vers] = nfsd_version[vers];
  112. #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  113. if (vers < NFSD_ACL_NRVERS)
  114. nfsd_acl_versions[vers] = nfsd_acl_version[vers];
  115. #endif
  116. break;
  117. case NFSD_CLEAR:
  118. nfsd_versions[vers] = NULL;
  119. #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  120. if (vers < NFSD_ACL_NRVERS)
  121. nfsd_acl_versions[vers] = NULL;
  122. #endif
  123. break;
  124. case NFSD_TEST:
  125. return nfsd_versions[vers] != NULL;
  126. case NFSD_AVAIL:
  127. return nfsd_version[vers] != NULL;
  128. }
  129. return 0;
  130. }
  131. int nfsd_minorversion(u32 minorversion, enum vers_op change)
  132. {
  133. if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
  134. return -1;
  135. switch(change) {
  136. case NFSD_SET:
  137. nfsd_supported_minorversion = minorversion;
  138. break;
  139. case NFSD_CLEAR:
  140. if (minorversion == 0)
  141. return -1;
  142. nfsd_supported_minorversion = minorversion - 1;
  143. break;
  144. case NFSD_TEST:
  145. return minorversion <= nfsd_supported_minorversion;
  146. case NFSD_AVAIL:
  147. return minorversion <= NFSD_SUPPORTED_MINOR_VERSION;
  148. }
  149. return 0;
  150. }
  151. /*
  152. * Maximum number of nfsd processes
  153. */
  154. #define NFSD_MAXSERVS 8192
  155. int nfsd_nrthreads(void)
  156. {
  157. int rv = 0;
  158. mutex_lock(&nfsd_mutex);
  159. if (nfsd_serv)
  160. rv = nfsd_serv->sv_nrthreads;
  161. mutex_unlock(&nfsd_mutex);
  162. return rv;
  163. }
  164. static int nfsd_init_socks(int port)
  165. {
  166. int error;
  167. if (!list_empty(&nfsd_serv->sv_permsocks))
  168. return 0;
  169. error = svc_create_xprt(nfsd_serv, "udp", &init_net, PF_INET, port,
  170. SVC_SOCK_DEFAULTS);
  171. if (error < 0)
  172. return error;
  173. error = svc_create_xprt(nfsd_serv, "tcp", &init_net, PF_INET, port,
  174. SVC_SOCK_DEFAULTS);
  175. if (error < 0)
  176. return error;
  177. return 0;
  178. }
  179. static bool nfsd_up = false;
  180. static int nfsd_startup(unsigned short port, int nrservs)
  181. {
  182. int ret;
  183. if (nfsd_up)
  184. return 0;
  185. /*
  186. * Readahead param cache - will no-op if it already exists.
  187. * (Note therefore results will be suboptimal if number of
  188. * threads is modified after nfsd start.)
  189. */
  190. ret = nfsd_racache_init(2*nrservs);
  191. if (ret)
  192. return ret;
  193. ret = nfsd_init_socks(port);
  194. if (ret)
  195. goto out_racache;
  196. ret = lockd_up();
  197. if (ret)
  198. goto out_racache;
  199. ret = nfs4_state_start();
  200. if (ret)
  201. goto out_lockd;
  202. nfsd_up = true;
  203. return 0;
  204. out_lockd:
  205. lockd_down();
  206. out_racache:
  207. nfsd_racache_shutdown();
  208. return ret;
  209. }
  210. static void nfsd_shutdown(void)
  211. {
  212. /*
  213. * write_ports can create the server without actually starting
  214. * any threads--if we get shut down before any threads are
  215. * started, then nfsd_last_thread will be run before any of this
  216. * other initialization has been done.
  217. */
  218. if (!nfsd_up)
  219. return;
  220. nfs4_state_shutdown();
  221. lockd_down();
  222. nfsd_racache_shutdown();
  223. nfsd_up = false;
  224. }
  225. static void nfsd_last_thread(struct svc_serv *serv)
  226. {
  227. /* When last nfsd thread exits we need to do some clean-up */
  228. nfsd_serv = NULL;
  229. nfsd_shutdown();
  230. svc_rpcb_cleanup(serv);
  231. printk(KERN_WARNING "nfsd: last server has exited, flushing export "
  232. "cache\n");
  233. nfsd_export_flush();
  234. }
  235. void nfsd_reset_versions(void)
  236. {
  237. int found_one = 0;
  238. int i;
  239. for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++) {
  240. if (nfsd_program.pg_vers[i])
  241. found_one = 1;
  242. }
  243. if (!found_one) {
  244. for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++)
  245. nfsd_program.pg_vers[i] = nfsd_version[i];
  246. #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  247. for (i = NFSD_ACL_MINVERS; i < NFSD_ACL_NRVERS; i++)
  248. nfsd_acl_program.pg_vers[i] =
  249. nfsd_acl_version[i];
  250. #endif
  251. }
  252. }
  253. /*
  254. * Each session guarantees a negotiated per slot memory cache for replies
  255. * which in turn consumes memory beyond the v2/v3/v4.0 server. A dedicated
  256. * NFSv4.1 server might want to use more memory for a DRC than a machine
  257. * with mutiple services.
  258. *
  259. * Impose a hard limit on the number of pages for the DRC which varies
  260. * according to the machines free pages. This is of course only a default.
  261. *
  262. * For now this is a #defined shift which could be under admin control
  263. * in the future.
  264. */
  265. static void set_max_drc(void)
  266. {
  267. #define NFSD_DRC_SIZE_SHIFT 10
  268. nfsd_drc_max_mem = (nr_free_buffer_pages()
  269. >> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE;
  270. nfsd_drc_mem_used = 0;
  271. spin_lock_init(&nfsd_drc_lock);
  272. dprintk("%s nfsd_drc_max_mem %u \n", __func__, nfsd_drc_max_mem);
  273. }
  274. int nfsd_create_serv(void)
  275. {
  276. int err = 0;
  277. WARN_ON(!mutex_is_locked(&nfsd_mutex));
  278. if (nfsd_serv) {
  279. svc_get(nfsd_serv);
  280. return 0;
  281. }
  282. if (nfsd_max_blksize == 0) {
  283. /* choose a suitable default */
  284. struct sysinfo i;
  285. si_meminfo(&i);
  286. /* Aim for 1/4096 of memory per thread
  287. * This gives 1MB on 4Gig machines
  288. * But only uses 32K on 128M machines.
  289. * Bottom out at 8K on 32M and smaller.
  290. * Of course, this is only a default.
  291. */
  292. nfsd_max_blksize = NFSSVC_MAXBLKSIZE;
  293. i.totalram <<= PAGE_SHIFT - 12;
  294. while (nfsd_max_blksize > i.totalram &&
  295. nfsd_max_blksize >= 8*1024*2)
  296. nfsd_max_blksize /= 2;
  297. }
  298. nfsd_reset_versions();
  299. nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
  300. nfsd_last_thread, nfsd, THIS_MODULE);
  301. if (nfsd_serv == NULL)
  302. return -ENOMEM;
  303. set_max_drc();
  304. do_gettimeofday(&nfssvc_boot); /* record boot time */
  305. return err;
  306. }
  307. int nfsd_nrpools(void)
  308. {
  309. if (nfsd_serv == NULL)
  310. return 0;
  311. else
  312. return nfsd_serv->sv_nrpools;
  313. }
  314. int nfsd_get_nrthreads(int n, int *nthreads)
  315. {
  316. int i = 0;
  317. if (nfsd_serv != NULL) {
  318. for (i = 0; i < nfsd_serv->sv_nrpools && i < n; i++)
  319. nthreads[i] = nfsd_serv->sv_pools[i].sp_nrthreads;
  320. }
  321. return 0;
  322. }
  323. int nfsd_set_nrthreads(int n, int *nthreads)
  324. {
  325. int i = 0;
  326. int tot = 0;
  327. int err = 0;
  328. WARN_ON(!mutex_is_locked(&nfsd_mutex));
  329. if (nfsd_serv == NULL || n <= 0)
  330. return 0;
  331. if (n > nfsd_serv->sv_nrpools)
  332. n = nfsd_serv->sv_nrpools;
  333. /* enforce a global maximum number of threads */
  334. tot = 0;
  335. for (i = 0; i < n; i++) {
  336. if (nthreads[i] > NFSD_MAXSERVS)
  337. nthreads[i] = NFSD_MAXSERVS;
  338. tot += nthreads[i];
  339. }
  340. if (tot > NFSD_MAXSERVS) {
  341. /* total too large: scale down requested numbers */
  342. for (i = 0; i < n && tot > 0; i++) {
  343. int new = nthreads[i] * NFSD_MAXSERVS / tot;
  344. tot -= (nthreads[i] - new);
  345. nthreads[i] = new;
  346. }
  347. for (i = 0; i < n && tot > 0; i++) {
  348. nthreads[i]--;
  349. tot--;
  350. }
  351. }
  352. /*
  353. * There must always be a thread in pool 0; the admin
  354. * can't shut down NFS completely using pool_threads.
  355. */
  356. if (nthreads[0] == 0)
  357. nthreads[0] = 1;
  358. /* apply the new numbers */
  359. svc_get(nfsd_serv);
  360. for (i = 0; i < n; i++) {
  361. err = svc_set_num_threads(nfsd_serv, &nfsd_serv->sv_pools[i],
  362. nthreads[i]);
  363. if (err)
  364. break;
  365. }
  366. svc_destroy(nfsd_serv);
  367. return err;
  368. }
  369. /*
  370. * Adjust the number of threads and return the new number of threads.
  371. * This is also the function that starts the server if necessary, if
  372. * this is the first time nrservs is nonzero.
  373. */
  374. int
  375. nfsd_svc(unsigned short port, int nrservs)
  376. {
  377. int error;
  378. bool nfsd_up_before;
  379. mutex_lock(&nfsd_mutex);
  380. dprintk("nfsd: creating service\n");
  381. if (nrservs <= 0)
  382. nrservs = 0;
  383. if (nrservs > NFSD_MAXSERVS)
  384. nrservs = NFSD_MAXSERVS;
  385. error = 0;
  386. if (nrservs == 0 && nfsd_serv == NULL)
  387. goto out;
  388. error = nfsd_create_serv();
  389. if (error)
  390. goto out;
  391. nfsd_up_before = nfsd_up;
  392. error = nfsd_startup(port, nrservs);
  393. if (error)
  394. goto out_destroy;
  395. error = svc_set_num_threads(nfsd_serv, NULL, nrservs);
  396. if (error)
  397. goto out_shutdown;
  398. /* We are holding a reference to nfsd_serv which
  399. * we don't want to count in the return value,
  400. * so subtract 1
  401. */
  402. error = nfsd_serv->sv_nrthreads - 1;
  403. out_shutdown:
  404. if (error < 0 && !nfsd_up_before)
  405. nfsd_shutdown();
  406. out_destroy:
  407. svc_destroy(nfsd_serv); /* Release server */
  408. out:
  409. mutex_unlock(&nfsd_mutex);
  410. return error;
  411. }
  412. /*
  413. * This is the NFS server kernel thread
  414. */
  415. static int
  416. nfsd(void *vrqstp)
  417. {
  418. struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp;
  419. int err, preverr = 0;
  420. /* Lock module and set up kernel thread */
  421. mutex_lock(&nfsd_mutex);
  422. /* At this point, the thread shares current->fs
  423. * with the init process. We need to create files with a
  424. * umask of 0 instead of init's umask. */
  425. if (unshare_fs_struct() < 0) {
  426. printk("Unable to start nfsd thread: out of memory\n");
  427. goto out;
  428. }
  429. current->fs->umask = 0;
  430. /*
  431. * thread is spawned with all signals set to SIG_IGN, re-enable
  432. * the ones that will bring down the thread
  433. */
  434. allow_signal(SIGKILL);
  435. allow_signal(SIGHUP);
  436. allow_signal(SIGINT);
  437. allow_signal(SIGQUIT);
  438. nfsdstats.th_cnt++;
  439. mutex_unlock(&nfsd_mutex);
  440. /*
  441. * We want less throttling in balance_dirty_pages() so that nfs to
  442. * localhost doesn't cause nfsd to lock up due to all the client's
  443. * dirty pages.
  444. */
  445. current->flags |= PF_LESS_THROTTLE;
  446. set_freezable();
  447. /*
  448. * The main request loop
  449. */
  450. for (;;) {
  451. /*
  452. * Find a socket with data available and call its
  453. * recvfrom routine.
  454. */
  455. while ((err = svc_recv(rqstp, 60*60*HZ)) == -EAGAIN)
  456. ;
  457. if (err == -EINTR)
  458. break;
  459. else if (err < 0) {
  460. if (err != preverr) {
  461. printk(KERN_WARNING "%s: unexpected error "
  462. "from svc_recv (%d)\n", __func__, -err);
  463. preverr = err;
  464. }
  465. schedule_timeout_uninterruptible(HZ);
  466. continue;
  467. }
  468. validate_process_creds();
  469. svc_process(rqstp);
  470. validate_process_creds();
  471. }
  472. /* Clear signals before calling svc_exit_thread() */
  473. flush_signals(current);
  474. mutex_lock(&nfsd_mutex);
  475. nfsdstats.th_cnt --;
  476. out:
  477. /* Release the thread */
  478. svc_exit_thread(rqstp);
  479. /* Release module */
  480. mutex_unlock(&nfsd_mutex);
  481. module_put_and_exit(0);
  482. return 0;
  483. }
  484. static __be32 map_new_errors(u32 vers, __be32 nfserr)
  485. {
  486. if (nfserr == nfserr_jukebox && vers == 2)
  487. return nfserr_dropit;
  488. if (nfserr == nfserr_wrongsec && vers < 4)
  489. return nfserr_acces;
  490. return nfserr;
  491. }
  492. int
  493. nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
  494. {
  495. struct svc_procedure *proc;
  496. kxdrproc_t xdr;
  497. __be32 nfserr;
  498. __be32 *nfserrp;
  499. dprintk("nfsd_dispatch: vers %d proc %d\n",
  500. rqstp->rq_vers, rqstp->rq_proc);
  501. proc = rqstp->rq_procinfo;
  502. /*
  503. * Give the xdr decoder a chance to change this if it wants
  504. * (necessary in the NFSv4.0 compound case)
  505. */
  506. rqstp->rq_cachetype = proc->pc_cachetype;
  507. /* Decode arguments */
  508. xdr = proc->pc_decode;
  509. if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base,
  510. rqstp->rq_argp)) {
  511. dprintk("nfsd: failed to decode arguments!\n");
  512. *statp = rpc_garbage_args;
  513. return 1;
  514. }
  515. /* Check whether we have this call in the cache. */
  516. switch (nfsd_cache_lookup(rqstp)) {
  517. case RC_INTR:
  518. case RC_DROPIT:
  519. return 0;
  520. case RC_REPLY:
  521. return 1;
  522. case RC_DOIT:;
  523. /* do it */
  524. }
  525. /* need to grab the location to store the status, as
  526. * nfsv4 does some encoding while processing
  527. */
  528. nfserrp = rqstp->rq_res.head[0].iov_base
  529. + rqstp->rq_res.head[0].iov_len;
  530. rqstp->rq_res.head[0].iov_len += sizeof(__be32);
  531. /* Now call the procedure handler, and encode NFS status. */
  532. nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
  533. nfserr = map_new_errors(rqstp->rq_vers, nfserr);
  534. if (nfserr == nfserr_dropit || rqstp->rq_dropme) {
  535. dprintk("nfsd: Dropping request; may be revisited later\n");
  536. nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
  537. return 0;
  538. }
  539. if (rqstp->rq_proc != 0)
  540. *nfserrp++ = nfserr;
  541. /* Encode result.
  542. * For NFSv2, additional info is never returned in case of an error.
  543. */
  544. if (!(nfserr && rqstp->rq_vers == 2)) {
  545. xdr = proc->pc_encode;
  546. if (xdr && !xdr(rqstp, nfserrp,
  547. rqstp->rq_resp)) {
  548. /* Failed to encode result. Release cache entry */
  549. dprintk("nfsd: failed to encode result!\n");
  550. nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
  551. *statp = rpc_system_err;
  552. return 1;
  553. }
  554. }
  555. /* Store reply in cache. */
  556. nfsd_cache_update(rqstp, proc->pc_cachetype, statp + 1);
  557. return 1;
  558. }
  559. int nfsd_pool_stats_open(struct inode *inode, struct file *file)
  560. {
  561. int ret;
  562. mutex_lock(&nfsd_mutex);
  563. if (nfsd_serv == NULL) {
  564. mutex_unlock(&nfsd_mutex);
  565. return -ENODEV;
  566. }
  567. /* bump up the psudo refcount while traversing */
  568. svc_get(nfsd_serv);
  569. ret = svc_pool_stats_open(nfsd_serv, file);
  570. mutex_unlock(&nfsd_mutex);
  571. return ret;
  572. }
  573. int nfsd_pool_stats_release(struct inode *inode, struct file *file)
  574. {
  575. int ret = seq_release(inode, file);
  576. mutex_lock(&nfsd_mutex);
  577. /* this function really, really should have been called svc_put() */
  578. svc_destroy(nfsd_serv);
  579. mutex_unlock(&nfsd_mutex);
  580. return ret;
  581. }