24 Oct, 2015

1 commit

  • Currently we have reference-counted per-net NSM RPC client
    which created on the first monitor request and destroyed
    after the last unmonitor request. It's needed because
    RPC client need to know 'utsname()->nodename', but utsname()
    might be NULL when nsm_unmonitor() called.

    So instead of holding the rpc client we could just save nodename
    in struct nlm_host and pass it to the rpc_create().
    Thus ther is no need in keeping rpc client until last
    unmonitor request. We could create separate RPC clients
    for each monitor/unmonitor requests.

    Signed-off-by: Andrey Ryabinin
    Signed-off-by: J. Bruce Fields

    Andrey Ryabinin
     

13 Oct, 2015

1 commit

  • Commit cb7323fffa85 ("lockd: create and use per-net NSM
    RPC clients on MON/UNMON requests") introduced per-net
    NSM RPC clients. Unfortunately this doesn't make any sense
    without per-net nsm_handle.

    E.g. the following scenario could happen
    Two hosts (X and Y) in different namespaces (A and B) share
    the same nsm struct.

    1. nsm_monitor(host_X) called => NSM rpc client created,
    nsm->sm_monitored bit set.
    2. nsm_mointor(host-Y) called => nsm->sm_monitored already set,
    we just exit. Thus in namespace B ln->nsm_clnt == NULL.
    3. host X destroyed => nsm->sm_count decremented to 1
    4. host Y destroyed => nsm_unmonitor() => nsm_mon_unmon() => NULL-ptr
    dereference of *ln->nsm_clnt

    So this could be fixed by making per-net nsm_handles list,
    instead of global. Thus different net namespaces will not be able
    share the same nsm_handle.

    Signed-off-by: Andrey Ryabinin
    Cc:
    Signed-off-by: J. Bruce Fields

    Andrey Ryabinin
     

18 Sep, 2014

1 commit

  • Currently, all of the grace period handling is part of lockd. Eventually
    though we'd like to be able to build v4-only servers, at which point
    we'll need to put all of this elsewhere.

    Move the code itself into fs/nfs_common and have it build a grace.ko
    module. Then, rejigger the Kconfig options so that both nfsd and lockd
    enable it automatically.

    Signed-off-by: Jeff Layton

    Jeff Layton
     

02 Oct, 2012

1 commit

  • NSM RPC client can be required on NFSv3 umount, when child reaper is dying (and
    destroying it's mount namespace). It means, that current nsproxy is set to
    NULL already, but creation of RPC client requires UTS namespace for gaining
    hostname string.
    This patch introduces reference counted NFS RPC clients creation and
    destruction helpers (similar to RPCBIND RPC clients).

    Signed-off-by: Stanislav Kinsbursky
    Cc:
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     

28 Jul, 2012

5 commits


15 Feb, 2012

1 commit

  • Lockd is going to be shared between network namespaces - i.e. going to be able
    to handle lock requests from different network namespaces. This means, that
    network namespace related resources have to be allocated not once (like now),
    but for every network namespace context, from which service is requested to
    operate.
    This patch implements Lockd per-net users accounting. New per-net counter is
    used to determine, when per-net resources have to be freed.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky