03 Apr, 2019

1 commit

  • commit 4a9be28c45bf02fa0436808bb6c0baeba30e120e upstream.

    If the last NFSv3 unmount from a given host races with a mount from the
    same host, we can destroy an nlm_host that is still in use.

    Specifically nlmclnt_lookup_host() can increment h_count on
    an nlm_host that nlmclnt_release_host() has just successfully called
    refcount_dec_and_test() on.
    Once nlmclnt_lookup_host() drops the mutex, nlm_destroy_host_lock()
    will be called to destroy the nlmclnt which is now in use again.

    The cause of the problem is that the dec_and_test happens outside the
    locked region. This is easily fixed by using
    refcount_dec_and_mutex_lock().

    Fixes: 8ea6ecc8b075 ("lockd: Create client-side nlm_host cache")
    Cc: stable@vger.kernel.org (v2.6.38+)
    Signed-off-by: NeilBrown
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    NeilBrown
     

13 Jan, 2019

1 commit

  • commit b8eee0e90f9797b747113638bc75e739b192ad38 upstream.

    Commit 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid
    for remote locks") specified that the l_pid returned for F_GETLK on a local
    file that has a remote lock should be the pid of the lock manager process.
    That commit, while updating other filesystems, failed to update lockd, such
    that locks created by lockd had their fl_pid set to that of the remote
    process holding the lock. Fix that here to be the pid of lockd.

    Also, fix the client case so that the returned lock pid is negative, which
    indicates a remote lock on a remote file.

    Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific...")
    Cc: stable@vger.kernel.org

    Signed-off-by: Benjamin Coddington
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Coddington
     

14 Nov, 2018

1 commit


10 Aug, 2018

1 commit

  • nfsd and lockd call vfs_lock_file() to lock/unlock the inode
    returned by locks_inode(file).

    Many places in nfsd/lockd code use the inode returned by
    file_inode(file) for lock manipulation. With Overlayfs, file_inode()
    (the underlying inode) is not the same object as locks_inode() (the
    overlay inode). This can result in "Leaked POSIX lock" messages
    and eventually to a kernel crash as reported by Eddie Horng:
    https://marc.info/?l=linux-unionfs&m=153086643202072&w=2

    Fix all the call sites in nfsd/lockd that should use locks_inode().
    This is a correctness bug that manifested when overlayfs gained
    NFS export support in v4.16.

    Reported-by: Eddie Horng
    Tested-by: Eddie Horng
    Cc: Jeff Layton
    Fixes: 8383f1748829 ("ovl: wire up NFS export operations")
    Cc: stable@vger.kernel.org
    Signed-off-by: Amir Goldstein
    Signed-off-by: J. Bruce Fields

    Amir Goldstein
     

20 Mar, 2018

1 commit

  • The variables nlm_ntf_refcnt and nlm_ntf_wq are local to the source and
    do not need to be in global scope, so make them static.

    Cleans up sparse warnings:
    fs/lockd/svc.c:60:10: warning: symbol 'nlm_ntf_refcnt' was not declared.
    Should it be static?
    fs/lockd/svc.c:61:1: warning: symbol 'nlm_ntf_wq' was not declared.
    Should it be static?

    Signed-off-by: Colin Ian King
    Signed-off-by: J. Bruce Fields

    Colin Ian King
     

25 Jan, 2018

1 commit

  • The server shouldn't actually delete the struct nlm_host until it hits
    the garbage collector. In order to make that work correctly with the
    refcount API, we can bump the refcount by one, and then use
    refcount_dec_if_one() in the garbage collector.

    Signed-off-by: Trond Myklebust
    Acked-by: J. Bruce Fields

    Trond Myklebust
     

15 Jan, 2018

4 commits

  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable nlm_rqst.a_count is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    **Important note for maintainers:

    Some functions from refcount_t API defined in lib/refcount.c
    have different memory ordering guarantees than their atomic
    counterparts.
    The full comparison can be seen in
    https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
    in state to be merged to the documentation tree.
    Normally the differences should not matter since refcount_t provides
    enough guarantees to satisfy the refcounting use cases, but in
    some rare cases it might matter.
    Please double check that you don't have some undocumented
    memory guarantees for this variable usage.

    For the nlm_rqst.a_count it might make a difference
    in following places:
    - nlmclnt_release_call() and nlmsvc_release_call(): decrement
    in refcount_dec_and_test() only
    provides RELEASE ordering and control dependency on success
    vs. fully ordered atomic counterpart

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Trond Myklebust

    Elena Reshetova
     
  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable nlm_lockowner.count is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    **Important note for maintainers:

    Some functions from refcount_t API defined in lib/refcount.c
    have different memory ordering guarantees than their atomic
    counterparts.
    The full comparison can be seen in
    https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
    in state to be merged to the documentation tree.
    Normally the differences should not matter since refcount_t provides
    enough guarantees to satisfy the refcounting use cases, but in
    some rare cases it might matter.
    Please double check that you don't have some undocumented
    memory guarantees for this variable usage.

    For the nlm_lockowner.count it might make a difference
    in following places:
    - nlm_put_lockowner(): decrement in refcount_dec_and_lock() only
    provides RELEASE ordering, control dependency on success and
    holds a spin lock on success vs. fully ordered atomic counterpart.
    No changes in spin lock guarantees.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Trond Myklebust

    Elena Reshetova
     
  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable nsm_handle.sm_count is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    **Important note for maintainers:

    Some functions from refcount_t API defined in lib/refcount.c
    have different memory ordering guarantees than their atomic
    counterparts.
    The full comparison can be seen in
    https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
    in state to be merged to the documentation tree.
    Normally the differences should not matter since refcount_t provides
    enough guarantees to satisfy the refcounting use cases, but in
    some rare cases it might matter.
    Please double check that you don't have some undocumented
    memory guarantees for this variable usage.

    For the nsm_handle.sm_count it might make a difference
    in following places:
    - nsm_release(): decrement in refcount_dec_and_lock() only
    provides RELEASE ordering, control dependency on success
    and holds a spin lock on success vs. fully ordered atomic
    counterpart. No change for the spin lock guarantees.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Trond Myklebust

    Elena Reshetova
     
  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable nlm_host.h_count is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    **Important note for maintainers:

    Some functions from refcount_t API defined in lib/refcount.c
    have different memory ordering guarantees than their atomic
    counterparts.
    The full comparison can be seen in
    https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
    in state to be merged to the documentation tree.
    Normally the differences should not matter since refcount_t provides
    enough guarantees to satisfy the refcounting use cases, but in
    some rare cases it might matter.
    Please double check that you don't have some undocumented
    memory guarantees for this variable usage.

    For the nlm_host.h_count it might make a difference
    in following places:
    - nlmsvc_release_host(): decrement in refcount_dec()
    provides RELEASE ordering, while original atomic_dec()
    was fully unordered. Since the change is for better, it
    should not matter.
    - nlmclnt_release_host(): decrement in refcount_dec_and_test() only
    provides RELEASE ordering and control dependency on success
    vs. fully ordered atomic counterpart. It doesn't seem to
    matter in this case since object freeing happens under mutex
    lock anyway.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Trond Myklebust

    Elena Reshetova
     

28 Nov, 2017

5 commits

  • nlm_complain_hosts() walks through nlm_server_hosts hlist, which should
    be protected by nlm_host_mutex.

    Signed-off-by: Vasily Averin
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     
  • lockd_inet[6]addr_event use nlmsvc_rqst without taken nlmsvc_mutex,
    nlmsvc_rqst can be changed during execution of notifiers and crash the host.

    Patch enables access to nlmsvc_rqst only when it was correctly initialized
    and delays its cleanup until notifiers are no longer in use.

    Note that nlmsvc_rqst can be temporally set to ERR_PTR, so the "if
    (nlmsvc_rqst)" check in notifiers is insufficient on its own.

    Signed-off-by: Vasily Averin
    Tested-by: Scott Mayhew
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     
  • Commit efda760fe95ea ("lockd: fix lockd shutdown race") is incorrect,
    it removes lockd_manager and disarm grace_period_end for init_net only.

    If nfsd was started from another net namespace lockd_up_net() calls
    set_grace_period() that adds lockd_manager into per-netns list
    and queues grace_period_end delayed work.

    These action should be reverted in lockd_down_net().
    Otherwise it can lead to double list_add on after restart nfsd in netns,
    and to use-after-free if non-disarmed delayed work will be executed after netns destroy.

    Fixes: efda760fe95e ("lockd: fix lockd shutdown race")
    Cc: stable@vger.kernel.org
    Signed-off-by: Vasily Averin
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     
  • Signed-off-by: Vasily Averin
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     
  • Publishing of net pointer is not safe,
    use net->ns.inum as net ID in debug messages

    [ 171.757678] lockd_up_net: per-net data created; net=f00001e7
    [ 171.767188] NFSD: starting 90-second grace period (net f00001e7)
    [ 300.653313] lockd: nuking all hosts in net f00001e7...
    [ 300.653641] lockd: host garbage collection for net f00001e7
    [ 300.653968] lockd: nlmsvc_mark_resources for net f00001e7
    [ 300.711483] lockd_down_net: per-net data destroyed; net=f00001e7
    [ 300.711847] lockd: nuking all hosts in net 0...
    [ 300.711847] lockd: host garbage collection for net 0
    [ 300.711848] lockd: nlmsvc_mark_resources for net 0

    Signed-off-by: Vasily Averin
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     

19 Nov, 2017

1 commit

  • Pull nfsd updates from Bruce Fields:
    "Lots of good bugfixes, including:

    - fix a number of races in the NFSv4+ state code

    - fix some shutdown crashes in multiple-network-namespace cases

    - relax our 4.1 session limits; if you've an artificially low limit
    to the number of 4.1 clients that can mount simultaneously, try
    upgrading"

    * tag 'nfsd-4.15' of git://linux-nfs.org/~bfields/linux: (22 commits)
    SUNRPC: Improve ordering of transport processing
    nfsd: deal with revoked delegations appropriately
    svcrdma: Enqueue after setting XPT_CLOSE in completion handlers
    nfsd: use nfs->ns.inum as net ID
    rpc: remove some BUG()s
    svcrdma: Preserve CB send buffer across retransmits
    nfds: avoid gettimeofday for nfssvc_boot time
    fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t
    fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t
    fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t
    lockd: double unregister of inetaddr notifiers
    nfsd4: catch some false session retries
    nfsd4: fix cached replies to solo SEQUENCE compounds
    sunrcp: make function _svc_create_xprt static
    SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
    nfsd: use ARRAY_SIZE
    nfsd: give out fewer session slots as limit approaches
    nfsd: increase DRC cache limit
    nfsd: remove unnecessary nofilehandle checks
    nfs_common: convert int to bool
    ...

    Linus Torvalds
     

16 Nov, 2017

1 commit

  • Pull module updates from Jessica Yu:
    "Summary of modules changes for the 4.15 merge window:

    - treewide module_param_call() cleanup, fix up set/get function
    prototype mismatches, from Kees Cook

    - minor code cleanups"

    * tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: Do not paper over type mismatches in module_param_call()
    treewide: Fix function prototypes for module_param_call()
    module: Prepare to convert all module_param_call() prototypes
    kernel/module: Delete an error message for a failed memory allocation in add_module_usage()

    Linus Torvalds
     

08 Nov, 2017

1 commit

  • lockd_up() can call lockd_unregister_notifiers twice:
    inside lockd_start_svc() when it calls lockd_svc_exit_thread()
    and then in error path of lockd_up()

    Patch forces lockd_start_svc() to unregister notifiers in all error cases
    and removes extra unregister in error path of lockd_up().

    Fixes: cb7d224f82e4 "lockd: unregister notifier blocks if the service ..."
    Signed-off-by: Vasily Averin
    Cc: stable@vger.kernel.org
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Vasily Averin
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

31 Oct, 2017

1 commit

  • Several function prototypes for the set/get functions defined by
    module_param_call() have a slightly wrong argument types. This fixes
    those in an effort to clean up the calls when running under type-enforced
    compiler instrumentation for CFI. This is the result of running the
    following semantic patch:

    @match_module_param_call_function@
    declarer name module_param_call;
    identifier _name, _set_func, _get_func;
    expression _arg, _mode;
    @@

    module_param_call(_name, _set_func, _get_func, _arg, _mode);

    @fix_set_prototype
    depends on match_module_param_call_function@
    identifier match_module_param_call_function._set_func;
    identifier _val, _param;
    type _val_type, _param_type;
    @@

    int _set_func(
    -_val_type _val
    +const char * _val
    ,
    -_param_type _param
    +const struct kernel_param * _param
    ) { ... }

    @fix_get_prototype
    depends on match_module_param_call_function@
    identifier match_module_param_call_function._get_func;
    identifier _val, _param;
    type _val_type, _param_type;
    @@

    int _get_func(
    -_val_type _val
    +char * _val
    ,
    -_param_type _param
    +const struct kernel_param * _param
    ) { ... }

    Two additional by-hand changes are included for places where the above
    Coccinelle script didn't notice them:

    drivers/platform/x86/thinkpad_acpi.c
    fs/lockd/svc.c

    Signed-off-by: Kees Cook
    Signed-off-by: Jessica Yu

    Kees Cook
     

12 Sep, 2017

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Hightlights include:

    Stable bugfixes:
    - Fix mirror allocation in the writeback code to avoid a use after
    free
    - Fix the O_DSYNC writes to use the correct byte range
    - Fix 2 use after free issues in the I/O code

    Features:
    - Writeback fixes to split up the inode->i_lock in order to reduce
    contention
    - RPC client receive fixes to reduce the amount of time the
    xprt->transport_lock is held when receiving data from a socket into
    am XDR buffer.
    - Ditto fixes to reduce contention between call side users of the
    rdma rb_lock, and its use in rpcrdma_reply_handler.
    - Re-arrange rdma stats to reduce false cacheline sharing.
    - Various rdma cleanups and optimisations.
    - Refactor the NFSv4.1 exchange id code and clean up the code.
    - Const-ify all instances of struct rpc_xprt_ops

    Bugfixes:
    - Fix the NFSv2 'sec=' mount option.
    - NFSv4.1: don't use machine credentials for CLOSE when using
    'sec=sys'
    - Fix the NFSv3 GRANT callback when the port changes on the server.
    - Fix livelock issues with COMMIT
    - NFSv4: Use correct inode in _nfs4_opendata_to_nfs4_state() when
    doing and NFSv4.1 open by filehandle"

    * tag 'nfs-for-4.14-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (69 commits)
    NFS: Count the bytes of skipped subrequests in nfs_lock_and_join_requests()
    NFS: Don't hold the group lock when calling nfs_release_request()
    NFS: Remove pnfs_generic_transfer_commit_list()
    NFS: nfs_lock_and_join_requests and nfs_scan_commit_list can deadlock
    NFS: Fix 2 use after free issues in the I/O code
    NFS: Sync the correct byte range during synchronous writes
    lockd: Delete an error message for a failed memory allocation in reclaimer()
    NFS: remove jiffies field from access cache
    NFS: flush data when locking a file to ensure cache coherence for mmap.
    SUNRPC: remove some dead code.
    NFS: don't expect errors from mempool_alloc().
    xprtrdma: Use xprt_pin_rqst in rpcrdma_reply_handler
    xprtrdma: Re-arrange struct rx_stats
    NFS: Fix NFSv2 security settings
    NFSv4.1: don't use machine credentials for CLOSE when using 'sec=sys'
    SUNRPC: ECONNREFUSED should cause a rebind.
    NFS: Remove unused parameter gfp_flags from nfs_pageio_init()
    NFSv4: Fix up mirror allocation
    SUNRPC: Add a separate spinlock to protect the RPC request receive list
    SUNRPC: Cleanup xs_tcp_read_common()
    ...

    Linus Torvalds
     

07 Sep, 2017

1 commit


25 Aug, 2017

1 commit


15 May, 2017

11 commits


11 May, 2017

1 commit

  • Pull nfsd updates from Bruce Fields:
    "Another RDMA update from Chuck Lever, and a bunch of miscellaneous
    bugfixes"

    * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits)
    nfsd: Fix up the "supattr_exclcreat" attributes
    nfsd: encoders mustn't use unitialized values in error cases
    nfsd: fix undefined behavior in nfsd4_layout_verify
    lockd: fix lockd shutdown race
    NFSv4: Fix callback server shutdown
    SUNRPC: Refactor svc_set_num_threads()
    NFSv4.x/callback: Create the callback service through svc_create_pooled
    lockd: remove redundant check on block
    svcrdma: Clean out old XDR encoders
    svcrdma: Remove the req_map cache
    svcrdma: Remove unused RDMA Write completion handler
    svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt
    svcrdma: Clean up RPC-over-RDMA backchannel reply processing
    svcrdma: Report Write/Reply chunk overruns
    svcrdma: Clean up RDMA_ERROR path
    svcrdma: Use rdma_rw API in RPC reply path
    svcrdma: Introduce local rdma_rw API helpers
    svcrdma: Clean up svc_rdma_get_inv_rkey()
    svcrdma: Add helper to save pages under I/O
    svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT
    ...

    Linus Torvalds
     

09 May, 2017

1 commit

  • As reported by David Jeffery: "a signal was sent to lockd while lockd
    was shutting down from a request to stop nfs. The signal causes lockd
    to call restart_grace() which puts the lockd_net structure on the grace
    list. If this signal is received at the wrong time, it will occur after
    lockd_down_net() has called locks_end_grace() but before
    lockd_down_net() stops the lockd thread. This leads to lockd putting
    the lockd_net structure back on the grace list, then exiting without
    anything removing it from the list."

    So, perform the final locks_end_grace() from the the lockd thread; this
    ensures it's serialized with respect to restart_grace().

    Reported-by: David Jeffery
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

26 Apr, 2017

1 commit

  • A null check followed by a return is being performed already, so block
    is always non-null at the second check on block, hence we can remove
    this redundant null-check (Detected by PVS-Studio). Also re-work
    comment to clean up a check-patch warning.

    Signed-off-by: Colin Ian King
    Signed-off-by: J. Bruce Fields

    Colin Ian King
     

21 Apr, 2017

1 commit

  • NFS would enjoy the ability to modify the behavior of the NLM client's
    unlock RPC task in order to delay the transmission of the unlock until IO
    that was submitted under that lock has completed. This ability can ensure
    that the NLM client will always complete the transmission of an unlock even
    if the waiting caller has been interrupted with fatal signal.

    For this purpose, a pointer to a struct nlmclnt_operations can be assigned
    in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
    the nlm_host. The struct nlmclnt_operations defines three callback
    operations that will be used in a following patch:

    nlmclnt_alloc_call - used to call back after a successful allocation of
    a struct nlm_rqst in nlmclnt_proc().

    nlmclnt_unlock_prepare - used to call back during NLM unlock's
    rpc_call_prepare. The NLM client defers calling rpc_call_start()
    until this callback returns false.

    nlmclnt_release_call - used to call back when the NLM client's struct
    nlm_rqst is freed.

    Signed-off-by: Benjamin Coddington
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     

02 Mar, 2017

1 commit


01 Feb, 2017

1 commit