03 Apr, 2020

2 commits

  • We must not return from nfs_d_automount() without holding 2 references
    to the mount record. Doing so, will trigger the BUG() in finish_automount().
    Also ensure that we don't try to reschedule the automount timer with
    a negative or zero timeout value.

    Fixes: 22a1ae9a93fb ("NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts")
    Cc: stable@vger.kernel.org # v5.5+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • nfs_vers_tokens, nfs_xprt_protocol_tokens, and nfs_secflavor_tokens were
    all missing an empty item at the end of the array, allowing
    lookup_constant() to potentially walk off the end and trigger and oops.

    Reported-by: Olga Kornievskaia
    Signed-off-by: Scott Mayhew
    Fixes: e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
    Cc: stable@vger.kernel.org # v5.6
    Signed-off-by: Trond Myklebust

    Scott Mayhew
     

02 Apr, 2020

9 commits


01 Apr, 2020

1 commit


29 Mar, 2020

1 commit


28 Mar, 2020

20 commits


27 Mar, 2020

7 commits

  • Change the rpcrdma_xprt_disconnect() function so that it no longer
    waits for the DISCONNECTED event. This prevents blocking if the
    remote is unresponsive.

    In rpcrdma_xprt_disconnect(), the transport's rpcrdma_ep is
    detached. Upon return from rpcrdma_xprt_disconnect(), the transport
    (r_xprt) is ready immediately for a new connection.

    The RDMA_CM_DEVICE_REMOVAL and RDMA_CM_DISCONNECTED events are now
    handled almost identically.

    However, because the lifetimes of rpcrdma_xprt structures and
    rpcrdma_ep structures are now independent, creating an rpcrdma_ep
    needs to take a module ref count. The ep now owns most of the
    hardware resources for a transport.

    Also, a kref is needed to ensure that rpcrdma_ep sticks around
    long enough for the cm_event_handler to finish.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • rpcrdma_cm_event_handler() is always passed an @id pointer that is
    valid. However, in a subsequent patch, we won't be able to extract
    an r_xprt in every case. So instead of using the r_xprt's
    presentation address strings, extract them from struct rdma_cm_id.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • I eventually want to allocate rpcrdma_ep separately from struct
    rpcrdma_xprt so that on occasion there can be more than one ep per
    xprt.

    The new struct rpcrdma_ep will contain all the fields currently in
    rpcrdma_ia and in rpcrdma_ep. This is all the device and CM settings
    for the connection, in addition to per-connection settings
    negotiated with the remote.

    Take this opportunity to rename the existing ep fields from rep_* to
    re_* to disambiguate these from struct rpcrdma_rep.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • Completion errors after a disconnect often occur much sooner than a
    CM_DISCONNECT event. Use this to try to detect connection loss more
    quickly.

    Note that other kernel ULPs do take care to disconnect explicitly
    when a WR is flushed.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • Clean up:
    The upper layer serializes calls to xprt_rdma_close, so there is no
    need for an atomic bit operation, saving 8 bytes in rpcrdma_ia.

    This enables merging rpcrdma_ia_remove directly into the disconnect
    logic.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • Move rdma_cm_id creation into rpcrdma_ep_create() so that it is now
    responsible for allocating all per-connection hardware resources.

    With this clean-up, all three arms of the switch statement in
    rpcrdma_ep_connect are exactly the same now, thus the switch can be
    removed.

    Because device removal behaves a little differently than
    disconnection, there is a little more work to be done before
    rpcrdma_ep_destroy() can release the connection's rdma_cm_id. So
    it is not quite symmetrical with rpcrdma_ep_create() yet.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever
     
  • Make a Protection Domain (PD) a per-connection resource rather than
    a per-transport resource. In other words, when the connection
    terminates, the PD is destroyed.

    Thus there is one less HW resource that remains allocated to a
    transport after a connection is closed.

    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker

    Chuck Lever