linux/fs/nfsd/nfssvc.c
<<
>>
Prefs
   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
   9#include <linux/sched.h>
  10#include <linux/freezer.h>
  11#include <linux/module.h>
  12#include <linux/fs_struct.h>
  13#include <linux/swap.h>
  14
  15#include <linux/sunrpc/stats.h>
  16#include <linux/sunrpc/svcsock.h>
  17#include <linux/lockd/bind.h>
  18#include <linux/nfsacl.h>
  19#include <linux/seq_file.h>
  20#include <net/net_namespace.h>
  21#include "nfsd.h"
  22#include "cache.h"
  23#include "vfs.h"
  24#include "netns.h"
  25
  26#define NFSDDBG_FACILITY        NFSDDBG_SVC
  27
  28extern struct svc_program       nfsd_program;
  29static int                      nfsd(void *vrqstp);
  30
  31/*
  32 * nfsd_mutex protects nn->nfsd_serv -- both the pointer itself and the members
  33 * of the svc_serv struct. In particular, ->sv_nrthreads but also to some
  34 * extent ->sv_temp_socks and ->sv_permsocks. It also protects nfsdstats.th_cnt
  35 *
  36 * If (out side the lock) nn->nfsd_serv is non-NULL, then it must point to a
  37 * properly initialised 'struct svc_serv' with ->sv_nrthreads > 0. That number
  38 * of nfsd threads must exist and each must listed in ->sp_all_threads in each
  39 * entry of ->sv_pools[].
  40 *
  41 * Transitions of the thread count between zero and non-zero are of particular
  42 * interest since the svc_serv needs to be created and initialized at that
  43 * point, or freed.
  44 *
  45 * Finally, the nfsd_mutex also protects some of the global variables that are
  46 * accessed when nfsd starts and that are settable via the write_* routines in
  47 * nfsctl.c. In particular:
  48 *
  49 *      user_recovery_dirname
  50 *      user_lease_time
  51 *      nfsd_versions
  52 */
  53DEFINE_MUTEX(nfsd_mutex);
  54
  55/*
  56 * nfsd_drc_lock protects nfsd_drc_max_pages and nfsd_drc_pages_used.
  57 * nfsd_drc_max_pages limits the total amount of memory available for
  58 * version 4.1 DRC caches.
  59 * nfsd_drc_pages_used tracks the current version 4.1 DRC memory usage.
  60 */
  61spinlock_t      nfsd_drc_lock;
  62unsigned long   nfsd_drc_max_mem;
  63unsigned long   nfsd_drc_mem_used;
  64
  65#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
  66static struct svc_stat  nfsd_acl_svcstats;
  67static struct svc_version *     nfsd_acl_version[] = {
  68        [2] = &nfsd_acl_version2,
  69        [3] = &nfsd_acl_version3,
  70};
  71
  72#define NFSD_ACL_MINVERS            2
  73#define NFSD_ACL_NRVERS         ARRAY_SIZE(nfsd_acl_version)
  74static struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS];
  75
  76static struct svc_program       nfsd_acl_program = {
  77        .pg_prog                = NFS_ACL_PROGRAM,
  78        .pg_nvers               = NFSD_ACL_NRVERS,
  79        .pg_vers                = nfsd_acl_versions,
  80        .pg_name                = "nfsacl",
  81        .pg_class               = "nfsd",
  82        .pg_stats               = &nfsd_acl_svcstats,
  83        .pg_authenticate        = &svc_set_client,
  84};
  85
  86static struct svc_stat  nfsd_acl_svcstats = {
  87        .program        = &nfsd_acl_program,
  88};
  89#endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */
  90
  91static struct svc_version *     nfsd_version[] = {
  92        [2] = &nfsd_version2,
  93#if defined(CONFIG_NFSD_V3)
  94        [3] = &nfsd_version3,
  95#endif
  96#if defined(CONFIG_NFSD_V4)
  97        [4] = &nfsd_version4,
  98#endif
  99};
 100
 101#define NFSD_MINVERS            2
 102#define NFSD_NRVERS             ARRAY_SIZE(nfsd_version)
 103static struct svc_version *nfsd_versions[NFSD_NRVERS];
 104
 105struct svc_program              nfsd_program = {
 106#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 107        .pg_next                = &nfsd_acl_program,
 108#endif
 109        .pg_prog                = NFS_PROGRAM,          /* program number */
 110        .pg_nvers               = NFSD_NRVERS,          /* nr of entries in nfsd_version */
 111        .pg_vers                = nfsd_versions,        /* version table */
 112        .pg_name                = "nfsd",               /* program name */
 113        .pg_class               = "nfsd",               /* authentication class */
 114        .pg_stats               = &nfsd_svcstats,       /* version table */
 115        .pg_authenticate        = &svc_set_client,      /* export authentication */
 116
 117};
 118
 119static bool nfsd_supported_minorversions[NFSD_SUPPORTED_MINOR_VERSION + 1] = {
 120        [0] = 1,
 121        [1] = 1,
 122};
 123
 124int nfsd_vers(int vers, enum vers_op change)
 125{
 126        if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
 127                return 0;
 128        switch(change) {
 129        case NFSD_SET:
 130                nfsd_versions[vers] = nfsd_version[vers];
 131#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 132                if (vers < NFSD_ACL_NRVERS)
 133                        nfsd_acl_versions[vers] = nfsd_acl_version[vers];
 134#endif
 135                break;
 136        case NFSD_CLEAR:
 137                nfsd_versions[vers] = NULL;
 138#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 139                if (vers < NFSD_ACL_NRVERS)
 140                        nfsd_acl_versions[vers] = NULL;
 141#endif
 142                break;
 143        case NFSD_TEST:
 144                return nfsd_versions[vers] != NULL;
 145        case NFSD_AVAIL:
 146                return nfsd_version[vers] != NULL;
 147        }
 148        return 0;
 149}
 150
 151int nfsd_minorversion(u32 minorversion, enum vers_op change)
 152{
 153        if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
 154                return -1;
 155        switch(change) {
 156        case NFSD_SET:
 157                nfsd_supported_minorversions[minorversion] = true;
 158                break;
 159        case NFSD_CLEAR:
 160                nfsd_supported_minorversions[minorversion] = false;
 161                break;
 162        case NFSD_TEST:
 163                return nfsd_supported_minorversions[minorversion];
 164        case NFSD_AVAIL:
 165                return minorversion <= NFSD_SUPPORTED_MINOR_VERSION;
 166        }
 167        return 0;
 168}
 169
 170/*
 171 * Maximum number of nfsd processes
 172 */
 173#define NFSD_MAXSERVS           8192
 174
 175int nfsd_nrthreads(struct net *net)
 176{
 177        int rv = 0;
 178        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 179
 180        mutex_lock(&nfsd_mutex);
 181        if (nn->nfsd_serv)
 182                rv = nn->nfsd_serv->sv_nrthreads;
 183        mutex_unlock(&nfsd_mutex);
 184        return rv;
 185}
 186
 187static int nfsd_init_socks(struct net *net)
 188{
 189        int error;
 190        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 191
 192        if (!list_empty(&nn->nfsd_serv->sv_permsocks))
 193                return 0;
 194
 195        error = svc_create_xprt(nn->nfsd_serv, "udp", net, PF_INET, NFS_PORT,
 196                                        SVC_SOCK_DEFAULTS);
 197        if (error < 0)
 198                return error;
 199
 200        error = svc_create_xprt(nn->nfsd_serv, "tcp", net, PF_INET, NFS_PORT,
 201                                        SVC_SOCK_DEFAULTS);
 202        if (error < 0)
 203                return error;
 204
 205        return 0;
 206}
 207
 208static int nfsd_users = 0;
 209
 210static int nfsd_startup_generic(int nrservs)
 211{
 212        int ret;
 213
 214        if (nfsd_users++)
 215                return 0;
 216
 217        /*
 218         * Readahead param cache - will no-op if it already exists.
 219         * (Note therefore results will be suboptimal if number of
 220         * threads is modified after nfsd start.)
 221         */
 222        ret = nfsd_racache_init(2*nrservs);
 223        if (ret)
 224                return ret;
 225        ret = nfs4_state_start();
 226        if (ret)
 227                goto out_racache;
 228        return 0;
 229
 230out_racache:
 231        nfsd_racache_shutdown();
 232        return ret;
 233}
 234
 235static void nfsd_shutdown_generic(void)
 236{
 237        if (--nfsd_users)
 238                return;
 239
 240        nfs4_state_shutdown();
 241        nfsd_racache_shutdown();
 242}
 243
 244static int nfsd_startup_net(int nrservs, struct net *net)
 245{
 246        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 247        int ret;
 248
 249        if (nn->nfsd_net_up)
 250                return 0;
 251
 252        ret = nfsd_startup_generic(nrservs);
 253        if (ret)
 254                return ret;
 255        ret = nfsd_init_socks(net);
 256        if (ret)
 257                goto out_socks;
 258        ret = lockd_up(net);
 259        if (ret)
 260                goto out_socks;
 261        ret = nfs4_state_start_net(net);
 262        if (ret)
 263                goto out_lockd;
 264
 265        nn->nfsd_net_up = true;
 266        return 0;
 267
 268out_lockd:
 269        lockd_down(net);
 270out_socks:
 271        nfsd_shutdown_generic();
 272        return ret;
 273}
 274
 275static void nfsd_shutdown_net(struct net *net)
 276{
 277        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 278
 279        nfs4_state_shutdown_net(net);
 280        lockd_down(net);
 281        nn->nfsd_net_up = false;
 282        nfsd_shutdown_generic();
 283}
 284
 285static void nfsd_last_thread(struct svc_serv *serv, struct net *net)
 286{
 287        struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 288
 289        /*
 290         * write_ports can create the server without actually starting
 291         * any threads--if we get shut down before any threads are
 292         * started, then nfsd_last_thread will be run before any of this
 293         * other initialization has been done.
 294         */
 295        if (!nn->nfsd_net_up)
 296                return;
 297        nfsd_shutdown_net(net);
 298
 299        svc_rpcb_cleanup(serv, net);
 300
 301        printk(KERN_WARNING "nfsd: last server has exited, flushing export "
 302                            "cache\n");
 303        nfsd_export_flush(net);
 304}
 305
 306void nfsd_reset_versions(void)
 307{
 308        int found_one = 0;
 309        int i;
 310
 311        for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++) {
 312                if (nfsd_program.pg_vers[i])
 313                        found_one = 1;
 314        }
 315
 316        if (!found_one) {
 317                for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++)
 318                        nfsd_program.pg_vers[i] = nfsd_version[i];
 319#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
 320                for (i = NFSD_ACL_MINVERS; i < NFSD_ACL_NRVERS; i++)
 321                        nfsd_acl_program.pg_vers[i] =
 322                                nfsd_acl_version[i];
 323#endif
 324        }
 325}
 326
 327/*
 328 * Each session guarantees a negotiated per slot memory cache for replies
 329 * which in turn consumes memory beyond the v2/v3/v4.0 server. A dedicated
 330 * NFSv4.1 server might wory to u.2 '&esd/nfssvc.c#L32" nam   */
3231  3     
3232  3     return 3223#ena href="fs/nfsd/nfssvc.c3L234"33her initialization has been * Impoa h clard limit ry >

 234
<3 href="fs/nfsd/nfssvc.c#3235" 33span>
3225}
3226
3227
3238  3             return;
3239
<3 href="fs/nfsd/nfssvc.c#3240" 3d="L24ead" class="sref">nfsd_lastnfssmax_dr"+code=net" clasnfssmax_dr"7" id="L307" class="line" name="L307"> 240  3      241  3     NFSD_MAXSERVSceC_SIZE_SHIFfs/nfsd/nfssvc.c#L163ceC_SIZE_SHIFfshutdown"107" class="line" name="L317"> 232  3a href="fs/nfsd/nfssvc.c3L243"34n_generic" class="sref">nfsd_shutdr"smax_fs/ref="+code=i" class=dr"smax_fs/class="servs);
 223#en href="fs/nfsd/nfssvc.c#3244" 34ode=found_one" class="sref">fffffffffffffffffref"_VERSION" class="sref">NFceC_SIZE_SHIFfs/nfsd/nfssvc.c#L163ceC_SIZE_SHIFfshut)v* ION" class="srePAGE_SIZEs/nfsd/nfssvc.cPAGE_SIZE="L310" class="line" name="L310"> 244st3tic int nfsd_shutdr"smem38" f="fs/nfsd/nfssvc.c#Ldr"smem38" f" id="L309" class="line" name="L309"> 245{
3a href="fs/nfsd/nfssvc.c3L246"34ref">nn->(2*(2*nfsd_mutex);
 246  3     struct );
nfsd_net_id);
 227 2483nfsd_startupgsnf c3_Aaur"smablksizef="fs/nfsd/nfssartupgsnf c3_Aaur"smablksizer"7" id="L307" class="line" name="L307"> 2503               return 0;3 2513svc_serv * 2523       ret 223#       if (runsig="srlodd/sa href="fs/nfs/nfsd/nfssvc.c#L273" id="L273" class="line" name="L2733> 2543               return ret = nfsd_mutex 2563       if (NFSD_ACL.cPAGE_SHIFfs/nfsd/nfssvc.cPAGE_SHIid="L273" class="line" name="L2733> 227<               goto  2613       
nftarg/nfsd/nfssvc.c#L3targ/nid="affref"_V=r12L273" class="line" name="L2733> 2633               goto nfcode=nfs4_state_start_net" class="sref">nfs.c#sd/nMAXBLKE_SIZEs/nfsd/nfssvc.c#sd/nMAXBLKE_SIid="L273" class="line" name="L2733> 2653       nnwhile)
nfcode=nfs4_state_start_net"f"_V=r8*1024*2L307" class="line" name="L307"> 2663       return 0;
nfcode=nfs4_state_start_net"/= 2L273" class="line" name="L2733> 227<nfsd_startuprting"trtingnet)
ret;
r"sref">nfsd_net *nn = net_generic(net, nfsd_net_id);
ret = found_one)fsd_muisr"s;<8" f="fs/nfsd/nfsfsd_muisr"s;<8"*nfsd_mutex);
ret)
nfsd_serv)
 2773       struct i = nfsd_serv)
err"L309" class="line" name="L309"> 2793       nfsd_program"smablksizef="fs/nfsd/nfssartup"smablksizer"7" ==="L203" class="line" name="L2033> 2813       nfsd_program"smablksizef="fs/nfsd/nfssartup"smablksizer"7" =s="sref">nfsd_startupgsnf c3_Aaur"smablksizef="fs/nfsd/nfssartupgsnf c3_Aaur"smablksizer"7" LL204" class="line" name="L2043> 2823       nfsd_sht_versions(void)
mutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
svc_create_xprtpool8" f="fs/nfsd/nfste_xprtpool8"*nfsd_mutex);
<.ref">nfsd_net_id);"smablksizef="fs/nfsd/nfssartup"smablksizer"7"L201" class="line" name="L2013> 2843nfsd_net_id);lead(struct nfsd_net_id)ruct nfsd_net_idnnmutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
nfsd_usersret = svc_create_xbin" f="fs/nfsd/nfste_xbin"net, nfsd_serv)
 2893       /38lass="sref">ret)
 2903span class="comment">   3     39de=i" class="sref">i<"sref">svc_create_xde"sro href="+code=nn"te_xde"sro net, nfsd_serv)
   3     39+code=nfsd_acl_prograef">error;
   3     3_empty" class=L169" class="line" name="L1693> 2933span class="comment">   3     39id="L244" class="line" name="L2443> 2943span class="comment">   3     393ode=nfsd_versiass="sref">nfstnfssmax_dr"+code=net" clasnfssmax_dr"7" LL204" class="line" name="L2043> 2853       if (!error = nfsd_mutexode=nfsd_serv" class="sref">nfsd_serv)
i<"="fs/nfsd/nfssvc.c#L218aefacco boo" time222" id="L222" class="line" name="L2223> 2963               return;
<3 href39d/nfssvc.c#L267" id="L267" class="line" name="L2673> 2973        2983nfsd_startupnrpool>(void)
net *net)
svc_serv *nn = net_generic(net, nfsd_net_id);
   4     4d_exp4rt_flush" clasnmutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
ret 3054mutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svpnrpool>(void)
id="L204" class="line" name="L2044> 3074
nfsd_startupgsnfnrssvc.c#f="fs/nfsd/nfssartupgsnfnrssvc.c#netnfsd_staf="fs/nfsd/nfssas="srelass> = net *net)
i;
svc_serv *nn = net_generic(net, nfsd_net_id);
nfsd_usersode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
NFSD_ACLoode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svpnrpool>(void)
id="afLreffLrefrsiass="sref">nfode=NFSD_ACL_NRVERS" class="sref">NFSD_ACLof="fs/nfsd/nfssas="s++)
error = nfsd_versionode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svppool>(void)
id=" = [r">ret 3204               for (nfsd_resede"sro href="+code=nn"_resede"sro *net *net)
svc_serv *nn = net_generic(net, nfsd_net_id);
ret;
nfsd_serv)
nfsd_serv)svpnrssvc.c#f="fs/nfsd/nfsssvfnrssvc.c#id="ss c1"L217" class="line" name="L3174> 3164/*<4span>42_users" class="sr * 4ach s42code=error" class="sr"sref">svc_create_xwn_net(nfsd_serv)
 * 4hich 42leanup" class="sref">svc_rpcb_clde"sro href="+code=nn"te_xde"sro net, nfsd_serv)
 * 4FSv4.43" class="sref="sref">nfsd_prograde"sro href="+code=nn"de"sro *nfsd_programode=nfsd_serv" class="sref">nfsd_serv)
svc_crea.UL)
nfsd_startup_snfnrssvc.c#f="fs/nfsd/nfssartupssnfnrssvc.c#netnfsd_staf="fs/nfsd/nfssas="srelass> = net *net)
ret;
ret;
found_one er/nfsd/nfssvc.c#L204id="id="L309" class="line" name="L3094> 3294<3 href="fs/nfsd/nfssvc.4#324043leanup" class"sref">svc_serv *nn = net_generic(net, nfsd_net_id);
printk(;
found_one)fsd_muisr"s;<8" f="fs/nfsd/nfsfsd_muisr"s;<8"*nfsd_mutex);
mutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
defined(ret 2454
3a href="fs/nfsd/nfssvc4c3L2444id="L316" class="line" name="L3164> 2464 3     struct ret)
nfsd_serv)
nfsd_serv)svpnrpool>(void)
id="L203" class="line" name="L2034>32274sp.c#L261" id="L261" cla4s3et"44de=i" class="sref">i = nfsd_versionode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svpnrpool>(void)
id="L204" class="line" name="L2044> 2484
lockd_downi = NFSD_ACLof="fs/nfsd/nfssas="s++)
nfsd_programssvc.c#f="fs/nfsd/nfssassvc.c#net< = MAXSERVref="+code=i" class="sAXSERVrid="L203" class="line" name="L2034> 2234       if (r class="sref">i = nfsd_versioref">MAXSERVref="+code=i" class="sAXSERVrid="L309" class="line" name="L3094> 2444               return lockd_downnfsd_versionssvc.c#f="fs/nfsd/nfssassvc.c#net< = retret)
MAXSERVref="+code=i" class="sAXSERVrid="L"L317" class="line" name="L3174>32274               goto iNFSD_ACLof="fs/nfsd/nfssas="safLreffLrefrsiass="sref">nfto"+code=nn" classtotid="if"_VE0 < r class="sref">infsd_staew=nfsd_net_id" claws="scsref">nfsd_versionssvc.c#f="fs/nfsd/nfssassvc.c#net< = MAXSERVref="+code=i" class="sAXSERVrid=" /rsiass="sref">nfto"+code=nn" classtotid="L309" class="line" name="L3094> 2604               goto ilockd_down);
nfsd_aclssvc.c#f="fs/nfsd/nfssassvc.c#net< = nfsd_versionew=nfsd_net_id" claws="sL204" class="line" name="L2044> 2524       if (r class="/a> = NFSD_ACLof="fs/nfsd/nfssas="safLreffLrefrsiass="sref">nfto"+code=nn" classtotid="if"_VE0 < nfsd_aclssvc.c#f="fs/nfsd/nfssassvc.c#net< = lockd_down

in poolE0 &y >
fsadm" id="L290" class="line" name="L2904> 2614       mutex_unlocossvc.c#f="fs/nfsd/nfssassvc.c#net< 0] ==="L203" class="line" name="L2034> 2644lockd_downra="fs/nfsd/nfssvc.c#L290 applyry >
nfsd_ssvc_g/nfsd/nfssvc.c#L3svc_g/nnet, nfsd_serv)
 = NFSD_ACLof="fs/nfsd/nfssas="s++)
r class=">found_one er/nfsd/nfssvc.c#L204id="id=s="sref">nfsd_ssvc_ssnfnum_ssvc.c#f="fs/nfsd/nfsssvc_ssnfnum_ssvc.c#net, nfsd_serv)
nfsd_mutexode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svppool>(void)
id=" = infsd_aclssvc.c#f="fs/nfsd/nfssassvc.c#net< = )
nfsd_serv)
, nef">error;
/48 turn consumes memory beyond tAdjust y >
erry >
   4     49server might wory to u.2 '&esd. Thi
tartsiy >
c#L32" et   4     4933mber of nfsd processes
   4     4933 href="fs/nfsd/nfssvc.c#L172" id="L222" class="line" name="L2224> 2934span class="comment">   4     49id="Lint222" class="line" name="L2224> 2844span class="comment">   4     493ode=>nfsd_serv)
nfsd_starc#L33="+code=net" clarc#L33id=", ">net *net)
ret;
ss=">found_one er/s/nfsd/nfssvc.c#L204" id="L204" class="line" name="L2044> 2974       nfsd_sboolnfsd/nfssvc.c#Lboolwn_net" >nfsd_serv)
e="+code=net" claeid="L204" class="line" name="L2044> 2884svc_serv *nn = net_generic(net, nfsd_net_id);
lockd_downnfsd_mutex);
printk();

   5  remutex_unlocorc#L33="+code=net" clarc#L33id="class=="L203" class="line" name="L2035>33015 pan class="comment">   5d_exp50lass="sref">r class="ef">mutex_unlocorc#L33="+code=net" clarc#L33id="cd="L309" class="line" name="L3095> 3045
mutex_unlocorc#L33="+code=net" clarc#L33id="cl"_VERSION" class="sref">MAXSERVref="+code=i" class="sAXSERVrid="L203" class="line" name="L2035> 3055mutex_unlocorc#L33="+code=net" clarc#L33id="cd=ef">nfsd_versioref">MAXSERVref="+code=i" class="sAXSERVrid="L309" class="line" name="L3095>63055<              return;
<5eset_50fs/nfsd/nfssv>found_one er/s/nfsd/nfssvc.c#L204" id="cd="L309" class="line" name="L3095>73055<      nfoode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
nfsoue=nfsd_net_id" coueid="L309" class="line" name="L3095>93085       lockd_downsvc_crea.c#L1cting"trting, i)
nfsoue=nfsd_net_id" coueid="L309" class="line" name="L3095>33015                       <5 href5 id="L214" class="line" name="L2145> 3145       }
nfsd_serv)
e="+code=net" claeid="csref">nfsd_versionode=nfsd_serv" class="sref">nfsd_serv)
found_one er/s/nfsd/nfssvc.c#L204" id="cd=>nfsd_serv)
, nfsouehde"sro href="+code=nn"ouehde"sro id="L309" class="line" name="L3095>93085if r>found_one er/s/nfsd/nfssvc.c#L204" id="cd=>nfsd_serv)svc_ssnfnum_ssvc.c#f="fs/nfsd/nfsssvc_ssnfnum_ssvc.c#net, nfsd_serv)
nfs.UL)
, nfsd_progranfsouehwn_net
ef">errvalue," id="L222" class="line" name="L2225> 3145       }
found_one er/s/nfsd/nfssvc.c#L204" id="cd=>nfsd_serv)
ode=nfsd_serv" class="sref">nfsd_serv)
nfsd_serv)svpnrssvc.c#f="fs/nfsd/nfsssvfnrssvc.c#id="s-="L314" class="line" name="L3145> 3275span class="comment">/*<5span>52_userlass="sref">nfsouehwn_net * 5ach s52code=error" cet)
found_one)
e="+code=net" claeid="L286" class="line" name="L2865>93085span class="comment"> * 5hich 529ass="sref">r class=">found_one .c#L18n_net( * 5FSv4.53" clalass="sref">nfsouehde"sro href="+code=nn"ouehde"sro id=":314" class="line" name="L3145>32315 3     printk(, r class=">="fs/nfsd/nfssvc.c#L290 Releas>
c#L32" b2" id="L222" class="line" name="L2225> 3225 3     return nfsoue=nfsd_net_id" coueid=":314" class="line" name="L3145> 3235ena href="fs/nfsd/nfssvc5c3L2353ck" class="sref">mutex_unlocfsd_muun"s;nfsd_mutex);
error;

ass c#L32" kernel erv" claid="L290" class="line" name="L2905> 2405 3     nfsine"f="fs/nfsd/nfssvc.cnet = svc_serv * = svc_serv *)>svc_serv *svc_serv * = nfsd_serv)list_.2 r href="+code=nn"list_.2 r *, nfsd_serv)rq_c#L32"ef="fs/nfsd/nfsrq_c#L32"id="sref">nfsd_serv)svppermss;<>(void)
id="pg_vers[nfsd_net_idsvc_serv *nfsd_net_idr">net *net)
nfsd_serv)xpt_/nfsd/nfssvc.c#L28xpt_/nfid="L204" class="line" name="L2045>32275sp.c#L261" id="L261" cla5s3et"54lass="sref">ret;

lockd_downnfsd_mutex);

erv" ceshares curr.c#sref"fs" id="L222" class="line" name="L2225> 2235       if (
init process. We need toccting< files with a" id="L222" class="line" name="L2225> 2445               return nnmutex_unlocunshare_fs_">netnetnfsd_serv)pf"+code=KERN_WARNING dclass="sref"/span>);
infsoue=nfsd_net_id" coueid="L309" class="line" name="L3095> 2485       lockd_downnfsd_serv)f>(void)
nfsd_serv)umaskf="fs/nfsd/nfssumaskid="cd="L309" class="line" name="L3095> 2615       
is reawned with all signalsrset tocSIG_IGN, re-enable" id="L222" class="line" name="L2225> 2445found_one allow_signalf="fs/nfsd/nfssallow_signal*, nfsd_sallow_signalf="fs/nfsd/nfssallow_signal*, ret = , r>found_one allow_signalf="fs/nfsd/nfssallow_signal*, printk([printk(nfsd_mutex);

clit_t's" id="L222" class="line" name="L2225>32275       struct r>found_one curr.c#=nfsd_net_id" ccurr.c#id="sref">nfsd_serv)flag>(void)
ass="|d=>nfsd_serv)PF_LESS_THROTTLE(void)
lockd_down
maif=reques/ "sop" id="L222" class="line" name="L2225> 2645n/a> =;;L"L317" class="line" name="L3175> 2665
/58 turn consumes memory beyondad will down befo2" id="L222" class="line" name="L2225> 2905span class="comment">   5     59de=i" class="sref">i)
nfsd_serv)svc_recvf="fs/nfsd/nfsssvc_recv*, ,    5     59+code=nfsd_acl_program" classL309" class="line" name="L3095> 2825span class="comment">   5     59e=nfsd_program" class="sref">nfsd_progra;
   5     59lass="sref">r class="sref">i   5     59code=ret" class="sref">lockd_downmutex_unlocsvc_processf="fs/nfsd/nfsssvc_process*, 
lockd_down(void)
*,    6  printk(nfsd_mutex);
   6d_exp60ck" class="sref">mutex_unloc
[nfsoue=nfsd_net_id" coueid=":314" class="line" name="L3146>63056<              return;
<6eset_60fs/nfsd/nfssv>found_one rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_c#L32"ef="fs/nfsd/nfsrq_c#L32"id="ss="sref">svc_crea.UL)
="fs/nfsd/nfssvc.c#L290 Releas>
y >
erv" ceo2" id="L222" class="line" name="L2226>93086       svc_rpcb_clexit_ssvc.cf="fs/nfsd/nfsssvc_exit_ssvc.c*, printk(, ="fs/nfsd/nfssvc.c#L290 Releas>
moduleLo2" id="L222" class="line" name="L2226> 3146       }
nfsd_serv)fsd_muun"s;nfsd_mutex);
nfsd_serv)fodule_put_and_exita href="+code=nfodule_put_and_exitnet63056       if (!ret73056               for (nfsd_serv)__be 3     retucode=n__be 3s/nfs>nfsd_serv)fap_f=w_204" #f="fs/nfsd/nfssfap_f=w_204" #*, , i)
nfsnamnf32"#f="fs/nfsd/nfssver3id="ss c2L286" class="line" name="L2866>23016                        6     62e=nfsd_program" classef">error;
mutex_unlocoamnfsnamnf32"#f="fs/nfsd/nfssver3id="s" id=4L286" class="line" name="L2866> 3146       }
retnfsnamnef">error;
/*<6span>62id="L268" class="line" name="L2686> 3086span class="comment"> * 6ach s62code=int222" class="line" name="L2226>93086span class="comment"> * 6hich 629ass=intk(svc_serv * =  =  * 6FSv4.63" claL317" class="line" name="L3176>32316 3     pr"sref">svc_serv *e="+code=net" clsvc_procedu>ess="sref> = printk(mutex_unloc__be 3     retucode=n__be 3s/nfssssssssssssssssssor;
nfsd_serv)__be 3     retucode=n__be 3s/nfssssssssssssssssss/a>)
found_one ref"+code=KERN_WARNING" dclass="sref"/span>);
i;
nfsd_serv)rq_32"#f="fs/nfsd/nfssrq_32"#id=", a>, nfsd_serv)rq_proc="+code=net" clrq_proc id="L204" class="line" name="L2046> 3186 3             return;
<6 3ref63="sref">ret = svc_crearqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_procinfo="+code=net" clrq_procinfoid="L204" class="line" name="L2046>93086<3 href="fs/nfsd/nfssvc.6#324063id="L170" class="line" name="L1706> 2406 3     
y >
xdr der a chance tocchangenw293" f ianwants" id="L222" class="line" name="L2226> 2326 3a href="fs/nfsd/nfssvc6c3L2464started, then nfsd_last_thread will b (necessary * iy >
NFSv4.0  gepounsrcase)" id="L222" class="line" name="L2226> 3236en href="fs/nfsd/nfssvc.6#324464L324"hreads--if we get shut down befo2" id="L222" class="line" name="L2226> 2446t3tic int nfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_cachetype="+code=net" clrq_cachetypeid="ss="sref">svc_creaproc="+code=net" clprocid="sref">nfsd_serv)pc_cachetype="+code=net" clpc_cachetypeid="L204" class="line" name="L2046> 2456
3a href="fs/nfsd/nfssvc6c3L24645ode=ret" cla>="fs/nfsd/nfssvc.c#L290 De arguc.c##L22" id="L222" class="line" name="L2226> 2466 3     struct svc_creaproc="+code=net" clprocid="sref">nfsd_serv)pc_de="+code=net" clpc_deid="L204" class="line" name="L2046>32276sp.c#L261" id="L261" cla6s3et"64_users" class="srfound_one)xdrf="fs/nfsd/nfssxdrid="=a>, nfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_arg="+code=net" clrq_argid="pg_vers[nfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_argpef="fs/nfsd/nfsrq_argp id="L"L317" class="line" name="L3176> 2496       if (r class=">found_one ref"+code=KERN_WARNING" dclass="sref"/span>);
 arguc.c##!u c.c#L303" id="L204" class="line" name="L2046> 2506               return 0;6i<> = svc_crearpc_garbage_arg#f="fs/nfsd/nfssrpc_garbage_arg#id="L204" class="line" name="L2046> 2516err"L314" class="line" name="L3146> 2526       
cache.es2" id="L222" class="line" name="L2226> 2456       nswitch/aef">mutex_unlocoamd_cache_lookupef="fs/nfsd/nfssvc.ccache_lookup*, svc_creaRC_DROPIT
i<">ret 2486       svc_creaRC_REPLY
r class="ef">err"L314" class="line" name="L3146> 2606               goto svc_creaRC_DOIT
ery >
ctatus, as" id="L222" class="line" name="L2226> 2456       nfsd_s/amsvc_crearqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_re#f="fs/nfsd/nfssrq_re#id="pg_vers[svc_crearqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_re#f="fs/nfsd/nfssrq_re#id="pg_vers[r>found_one rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_re#f="fs/nfsd/nfssrq_re#id="pg_vers[, pri="fs/nfsd/nfssvc.c#L290 Now"call y >
procedu>e handler, ansren_cr>
ass ctatus.es2" id="L222" class="line" name="L2226> 2526       return printk(svc_creaproc="+code=net" clprocid="sref">nfsd_serv)pc_nfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_argpef="fs/nfsd/nfsrq_argp id=, >nfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_re#pef="fs/nfsd/nfsrq_re#ps/nf"L204" class="line" name="L2046> 2636
mutex_unloc
svc_creafap_f=w_204" #f="fs/nfsd/nfssfap_f=w_204" #*, nfsd_serv)rq_32"#f="fs/nfsd/nfssrq_32"#id=", a>, mutex_unlocoamnfsnamnfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_dropme="+code=net" clrq_dropmeid="""L317" class="line" name="L3176> 2756tatic void mutex_unlocref"+code=KERN_WARNING" dclass="sref"/span>);

efvisited lateru c.c#L303" id="L204" class="line" name="L2046> 2566
nfsd_serv)RC_NOCACHE(void)
nfsd_serv).UL)
i<">ret 2686mutex_unlocrqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_proc="+code=net" clrq_proc id= !=="L203" class="line" name="L2036> 2616       nfsd_serv)
="fs/nfsd/nfssvc.c#L290 En_cr>
re#ulte" id="L219" class="line" name="L2196> 2646retmutex_unlocoamnfrqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_32"#f="fs/nfsd/nfssrq_32"#id="ss c2L""L317" class="line" name="L3176>32276       struct i<>found_one xdrf="fs/nfsd/nfssxdrid="ss="sref">svc_creaproc="+code=net" clprocid="sref">nfsd_serv)pc_en_cr>="+code=net" clpc_en_cr>id="L204" class="line" name="L2046> 2686found_one)xdrf="fs/nfsd/nfssxdrid="=a>, /689ass="sref">r class=" class="sref">i<>found_one rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_re#pef="fs/nfsd/nfsrq_re#ps/nf"""L317" class="line" name="L3176> 2906span class="comment">   6     69de=i" class="sref">i="fs/nfsd/nfssvc.c#L290 Failed tocen_cr>
re#ulte Releas>
cache .2 r  b2" id="L222" class="line" name="L2226> 2816span class="comment">   6     69+code=nfsd_acl_program" class>found_one ref"+code=KERN_WARNING" dclass="sref"/span>);

re#ult!u c.c#L303" id="L204" class="line" name="L2046> 2826span class="comment">   6     69e=nfsd_program" classm" class>found_one svc.ccache_updngnfsd_serv)RC_NOCACHE(void)
nfsd_serv).UL)
   6     69lass="sref">r class="sref">i<> = svc_crearpc_system_   6     69code=ret" class="srefffffffffef">err"L314" class="line" name="L3146> 2856       if (!="fs/nfsd/nfssvc.c#L290 Sta>erreply infcache.es2" id="L222" class="line" name="L2226> 2896       r>found_one svc.ccache_updngnfsd_serv)rqstpef="fs/nfsd/nfsrqstpid="sref">nfsd_serv)rq_cachetype="+code=net" clrq_cachetypeid=", >nfsd_serv)rtatpef="fs/nfsd/nfsrtatpid="s+ 1LL204" class="line" name="L2047> 3007err"L314" class="line" name="L3147> 3017          7     7d_exp70ck" cet;
svc_serv *="+code=net" clincr> clas> =  cla,r"sref">svc_serv * = nnt;
r">net *net)
="+code=net" clincr> clasref">nfsd_serv)i_sb="+code=net" cli_sb clasref">nfsd_serv)s_fs_info="+code=net" cls_fs_infoid=", a>)
ret = nfsd_mutex);
mutex_unlocoode=nfsd_serv" class="sref">nfsd_serv)
nfs.UL)
i = nfsd_mutex);
err-a>, ="fs/nfsd/nfssvc.c#L290 bump up y >
psudo clacount while tra32"#rdd/s2" id="L222" class="line" name="L2227> 3147       }
nfsd_serv)svc_gL2href="+code=nn"svc_gL2id="=a>, nfsd_serv)
nfsd_serv)rde=nfsd_net_id" crnfid="cd=>nfsd_serv)svc_pool_rtat#_ope/href="+code=nn"svc_pool_rtat#_ope/id="=a>, nfsd_serv)
found_one fsd_muun"s;nfsd_mutex);
error;
;
id="="sref">svc_serv *="+code=net" clincr> clas> =  cla,r"sref">svc_serv * = id="=a>,  cla, a>)
net *net)
 clasref">nfsd_serv)i_sb="+code=net" cli_sb clasref">nfsd_serv)s_fs_info="+code=net" cls_fs_infoid="L204" class="line" name="L2047> 3147       }
nfsd_serv)fsd_mu"s;nfsd_mutex);
="fs/nfsd/nfssvc.c#L290 w293"vc_put/)3o2" id="L222" class="line" name="L2227> 3277span class="comment">/*<7span>72own_net" class="sref">nfsd_s/am hde"sro href="+code=nn"_resede"sro *,  * 7ach s72="sref">ret = nfsd_mutex);
 * 7hich 72leanup" classef">error;
 * 7FSv4.73" cla="26" class="line" name="L3267>32317 3     


T > origi al LXR softwarenby y > 26" classhttp://source/a>ge.las/projects/lxr">LXR ssvcunity cla, w293"experic.c#al 32"#rt rby 26" classmailto:lxr@refux.no">lxr@refux.no cla.
lxr.refux.no kindly hosaed/by 26" classhttp://www.redpill-refpro.no">Redpill Lefpro AS cla, provia>r of Lefux ssn#ultrdd/ansroperatit srservices since 1995.