1. 02 12月, 2016 3 次提交
  2. 08 11月, 2016 1 次提交
  3. 28 9月, 2016 1 次提交
  4. 20 9月, 2016 2 次提交
  5. 05 9月, 2016 1 次提交
    • T
      pNFS: Don't forget the layout stateid if there are outstanding LAYOUTGETs · 334a8f37
      Trond Myklebust 提交于
      If there are outstanding LAYOUTGET rpc calls, then we want to ensure that
      we keep the layout stateid around so we that don't inadvertently pick up
      an old/misordered sequence id.
      The race is as follows:
      
      Client				Server
      ======				======
      LAYOUTGET(seqid)
      LAYOUTGET(seqid)
      				return LAYOUTGET(seqid+1)
      				return LAYOUTGET(seqid+2)
      process LAYOUTGET(seqid+2)
      	forget layout
      process LAYOUTGET(seqid+1)
      
      If it forgets the layout stateid before processing seqid+1, then
      the client will not check the layout->plh_barrier, and so will set
      the stateid with seqid+1.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      334a8f37
  6. 04 9月, 2016 2 次提交
  7. 23 8月, 2016 1 次提交
  8. 20 8月, 2016 1 次提交
  9. 25 7月, 2016 12 次提交
  10. 20 7月, 2016 3 次提交
  11. 06 7月, 2016 1 次提交
  12. 25 6月, 2016 3 次提交
  13. 26 5月, 2016 1 次提交
  14. 18 5月, 2016 8 次提交
    • J
      pnfs: make pnfs_layout_process more robust · 1b3c6d07
      Jeff Layton 提交于
      It can return NULL if layoutgets are blocked currently. Fix it to return
      -EAGAIN in that case, so we can properly handle it in pnfs_update_layout.
      
      Also, clean up and simplify the error handling -- eliminate "status" and
      just use "lseg".
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      1b3c6d07
    • 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: lift retry logic from send_layoutget to pnfs_update_layout · 83026d80
      Jeff Layton 提交于
      If we get back something like NFS4ERR_OLD_STATEID, that will be
      translated into -EAGAIN, and the do/while loop in send_layoutget
      will drive the call again.
      
      This is not quite what we want, I think. An error like that is a
      sign that something has changed. That something could have been a
      concurrent LAYOUTGET that would give us a usable lseg.
      
      Lift the retry logic into pnfs_update_layout instead. That allows
      us to redo the layout search, and may spare us from having to issue
      an RPC.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      83026d80
    • J
      pnfs: fix bad error handling in send_layoutget · d03ab29d
      Jeff Layton 提交于
      Currently, the code will clear the fail bit if we get back a fatal
      error. I don't think that's correct -- we want to clear that bit
      if we do not get a fatal error.
      
      Fixes: 0bcbf039 (nfs: handle request add failure properly)
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      d03ab29d
    • 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
    • T