1. 15 1月, 2018 2 次提交
    • B
      pnfs/blocklayout: handle transient devices · b3dce6a2
      Benjamin Coddington 提交于
      PNFS block/SCSI layouts should gracefully handle cases where block devices
      are not available when a layout is retrieved, or the block devices are
      removed while the client holds a layout.
      
      While setting up a layout segment, keep a record of an unavailable or
      un-parsable block device in cache with a flag so that subsequent layouts do
      not spam the server with GETDEVINFO.  We can reuse the current
      NFS_DEVICEID_UNAVAILABLE handling with one variation: instead of reusing
      the device, we will discard it and send a fresh GETDEVINFO after the
      timeout, since the lookup and validation of the device occurs within the
      GETDEVINFO response handling.
      
      A lookup of a layout segment that references an unavailable device will
      return a segment with the NFS_LSEG_UNAVAILABLE flag set.  This will allow
      the pgio layer to mark the layout with the appropriate fail bit, which
      forces subsequent IO to the MDS, and prevents spamming the server with
      LAYOUTGET, LAYOUTRETURN.
      
      Finally, when IO to a block device fails, look up the block device(s)
      referenced by the pgio header, and mark them as unavailable.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b3dce6a2
    • B
      pnfs/blocklayout: set PNFS_LAYOUTRETURN_ON_ERROR · d78471d3
      Benjamin Coddington 提交于
      If there's an error doing I/O to block device, and the client resends the
      I/O to the MDS, the MDS must recall the layout from the client before
      processing the I/O.  Let's preempt that exchange by returning the layout
      before falling back to the MDS when there's an error.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      d78471d3
  2. 18 11月, 2017 4 次提交
  3. 15 8月, 2017 1 次提交
  4. 24 5月, 2017 1 次提交
    • B
      pnfs: Fix the check for requests in range of layout segment · 08cb5b0f
      Benjamin Coddington 提交于
      It's possible and acceptable for NFS to attempt to add requests beyond the
      range of the current pgio->pg_lseg, a case which should be caught and
      limited by the pg_test operation.  However, the current handling of this
      case replaces pgio->pg_lseg with a new layout segment (after a WARN) within
      that pg_test operation.  That will cause all the previously added requests
      to be submitted with this new layout segment, which may not be valid for
      those requests.
      
      Fix this problem by only returning zero for the number of bytes to coalesce
      from pg_test for this case which allows any previously added requests to
      complete on the current layout segment.  The check for requests starting
      out of range of the layout segment moves to pg_init, so that the
      replacement of pgio->pg_lseg will be done when the next request is added.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      08cb5b0f
  5. 25 4月, 2017 1 次提交
  6. 21 4月, 2017 1 次提交
  7. 18 3月, 2017 1 次提交
  8. 04 12月, 2016 2 次提交
  9. 02 12月, 2016 7 次提交
  10. 20 9月, 2016 2 次提交
  11. 25 7月, 2016 3 次提交
  12. 18 7月, 2016 1 次提交
  13. 06 7月, 2016 1 次提交
  14. 26 5月, 2016 1 次提交
  15. 18 5月, 2016 4 次提交
    • J
      pnfs: rework LAYOUTGET retry handling · 183d9e7b
      Jeff Layton 提交于
      There are several problems in the way a stateid is selected for a
      LAYOUTGET operation:
      
      We pick a stateid to use in the RPC prepare op, but that makes
      it difficult to serialize LAYOUTGETs that use the open stateid. That
      serialization is done in pnfs_update_layout, which occurs well before
      the rpc_prepare operation.
      
      Between those two events, the i_lock is dropped and reacquired.
      pnfs_update_layout can find that the list has lsegs in it and not do any
      serialization, but then later pnfs_choose_layoutget_stateid ends up
      choosing the open stateid.
      
      This patch changes the client to select the stateid to use in the
      LAYOUTGET earlier, when we're searching for a usable layout segment.
      This way we can do it all while holding the i_lock the first time, and
      ensure that we serialize any LAYOUTGET call that uses a non-layout
      stateid.
      
      This also means a rework of how LAYOUTGET replies are handled, as we
      must now get the latest stateid if we want to retransmit in response
      to a retryable error.
      
      Most of those errors boil down to the fact that the layout state has
      changed in some fashion. Thus, what we really want to do is to re-search
      for a layout when it fails with a retryable error, so that we can avoid
      reissuing the RPC at all if possible.
      
      While the LAYOUTGET RPC is async, the initiating thread always waits for
      it to complete, so it's effectively synchronous anyway. Currently, when
      we need to retry a LAYOUTGET because of an error, we drive that retry
      via the rpc state machine.
      
      This means that once the call has been submitted, it runs until it
      completes. So, we must move the error handling for this RPC out of the
      rpc_call_done operation and into the caller.
      
      In order to handle errors like NFS4ERR_DELAY properly, we must also
      pass a pointer to the sliding timeout, which is now moved to the stack
      in pnfs_update_layout.
      
      The complicating errors are -NFS4ERR_RECALLCONFLICT and
      -NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
      up and return NULL back to the caller. So, there is some special
      handling for those errors to ensure that the layers driving the retries
      can handle that appropriately.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      183d9e7b
    • J
      pnfs: only tear down lsegs that precede seqid in LAYOUTRETURN args · 6d597e17
      Jeff Layton 提交于
      LAYOUTRETURN is "special" in that servers and clients are expected to
      work with old stateids. When the client sends a LAYOUTRETURN with an old
      stateid in it then the server is expected to only tear down layout
      segments that were present when that seqid was current. Ensure that the
      client handles its accounting accordingly.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      6d597e17
    • J
      pnfs: keep track of the return sequence number in pnfs_layout_hdr · 3982a6a2
      Jeff Layton 提交于
      When we want to selectively do a LAYOUTRETURN, we need to specify a
      stateid that represents most recent layout acquisition that is to be
      returned.
      
      When we mark a layout stateid to be returned, we update the return
      sequence number in the layout header with that value, if it's newer
      than the existing one. Then, when we go to do a LAYOUTRETURN on
      layout header put, we overwrite the seqid in the stateid with the
      saved one, and then zero it out.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      3982a6a2
    • J
      pnfs: record sequence in pnfs_layout_segment when it's created · 66755283
      Jeff Layton 提交于
      In later patches, we're going to teach the client to be more selective
      about how it returns layouts. This means keeping a record of what the
      stateid's seqid was at the time that the server handed out a layout
      segment.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      66755283
  16. 09 5月, 2016 1 次提交
  17. 28 1月, 2016 1 次提交
  18. 05 1月, 2016 3 次提交
  19. 01 1月, 2016 1 次提交
  20. 29 12月, 2015 2 次提交