• Jeff Layton's avatar
    sunrpc: fix up the special handling of sv_nrpools == 1 · 8e0c8d23
    Jeff Layton authored
    Only pooled services take a reference to the svc_pool_map. The sunrpc
    code has always used the sv_nrpools value to detect whether the service
    is pooled.
    
    The problem there is that nfsd is a pooled service, but when it's
    running in "global" pool_mode, it doesn't take a reference to the pool
    map because it has a sv_nrpools value of 1. This means that we have
    two separate codepaths for starting the server, depending on whether
    it's pooled or not.
    
    Fix this by adding a new flag to the svc_serv, that indicates whether
    the serv is pooled. With this we can have the nfsd service
    unconditionally take a reference, regardless of pool_mode.
    
    Note that this is a behavior change for
    /sys/module/sunrpc/parameters/pool_mode. Usually this file does not
    allow you to change the pool-mode while there are nfsd threads running,
    but if the pool-mode is "global" it's allowed. My assumption is that
    this is a bug, since it probably should never have worked this way.
    
    This patch changes the behavior such that you get back EBUSY even
    when nfsd is running in global mode. I think this is more reasonable
    behavior, and given that most people set this today using the module
    parameter, it's doubtful anyone will notice.
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    8e0c8d23
svc.c 42.5 KB