1. 18 5月, 2016 2 次提交
  2. 09 5月, 2016 1 次提交
    • C
      NFS: Fix an LOCK/OPEN race when unlinking an open file · 11476e9d
      Chuck Lever 提交于
      At Connectathon 2016, we found that recent upstream Linux clients
      would occasionally send a LOCK operation with a zero stateid. This
      appeared to happen in close proximity to another thread returning
      a delegation before unlinking the same file while it remained open.
      
      Earlier, the client received a write delegation on this file and
      returned the open stateid. Now, as it is getting ready to unlink the
      file, it returns the write delegation. But there is still an open
      file descriptor on that file, so the client must OPEN the file
      again before it returns the delegation.
      
      Since commit 24311f88 ('NFSv4: Recovery of recalled read
      delegations is broken'), nfs_open_delegation_recall() clears the
      NFS_DELEGATED_STATE flag _before_ it sends the OPEN. This allows a
      racing LOCK on the same inode to be put on the wire before the OPEN
      operation has returned a valid open stateid.
      
      To eliminate this race, serialize delegation return with the
      acquisition of a file lock on the same file. Adopt the same approach
      as is used in the unlock path.
      
      This patch also eliminates a similar race seen when sending a LOCK
      operation at the same time as returning a delegation on the same file.
      
      Fixes: 24311f88 ('NFSv4: Recovery of recalled read ... ')
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      [Anna: Add sentence about LOCK / delegation race]
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      11476e9d
  3. 14 3月, 2016 1 次提交
  4. 18 2月, 2016 1 次提交
  5. 06 2月, 2016 2 次提交
  6. 25 1月, 2016 1 次提交
  7. 29 12月, 2015 4 次提交
  8. 28 12月, 2015 6 次提交
    • A
      nfs: machine credential support for additional operations · 99ade3c7
      Andrew Elble 提交于
      Allow LAYOUTRETURN and DELEGRETURN to use machine credentials if the
      server supports it. Add request for OPEN_DOWNGRADE as the close path
      also uses that.
      Signed-off-by: NAndrew Elble <aweits@rit.edu>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      99ade3c7
    • T
    • O
      9759b0fb
    • O
      Adding stateid information to tracepoints · 48c9579a
      Olga Kornievskaia 提交于
      Operations to which stateid information is added:
      close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
      write, lock, locku, lockt
      
      Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
      "layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
      tracepoints.
      
      New function is added to internal.h, nfs_stateid_hash(), to compute the hash
      
      trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
      to get access to stateid.
      
      trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
      to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
      stateid information
      
      for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
      to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
      trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
      previously same LOCK_EVENT type.
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      48c9579a
    • T
      NFS: Allow the combination pNFS and labeled NFS · 95864c91
      Trond Myklebust 提交于
      Fix the nfs4_pnfs_open_bitmap so that it also allows for labeled NFS.
      Signed-off-by: NTrond Myklebust <trond,myklebust@primarydata.com>
      95864c91
    • A
      nfs: Fix race in __update_open_stateid() · 361cad3c
      Andrew Elble 提交于
      We've seen this in a packet capture - I've intermixed what I
      think was going on. The fix here is to grab the so_lock sooner.
      
      1964379 -> #1 open (for write) reply seqid=1
      1964393 -> #2 open (for read) reply seqid=2
      
        __nfs4_close(), state->n_wronly--
        nfs4_state_set_mode_locked(), changes state->state = [R]
        state->flags is [RW]
        state->state is [R], state->n_wronly == 0, state->n_rdonly == 1
      
      1964398 -> #3 open (for write) call -> because close is already running
      1964399 -> downgrade (to read) call seqid=2 (close of #1)
      1964402 -> #3 open (for write) reply seqid=3
      
       __update_open_stateid()
         nfs_set_open_stateid_locked(), changes state->flags
         state->flags is [RW]
         state->state is [R], state->n_wronly == 0, state->n_rdonly == 1
         new sequence number is exposed now via nfs4_stateid_copy()
      
         next step would be update_open_stateflags(), pending so_lock
      
      1964403 -> downgrade reply seqid=2, fails with OLD_STATEID (close of #1)
      
         nfs4_close_prepare() gets so_lock and recalcs flags -> send close
      
      1964405 -> downgrade (to read) call seqid=3 (close of #1 retry)
      
         __update_open_stateid() gets so_lock
       * update_open_stateflags() updates state->n_wronly.
         nfs4_state_set_mode_locked() updates state->state
      
         state->flags is [RW]
         state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1
      
       * should have suppressed the preceding nfs4_close_prepare() from
         sending open_downgrade
      
      1964406 -> write call
      1964408 -> downgrade (to read) reply seqid=4 (close of #1 retry)
      
         nfs_clear_open_stateid_locked()
         state->flags is [R]
         state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1
      
      1964409 -> write reply (fails, openmode)
      Signed-off-by: NAndrew Elble <aweits@rit.edu>
      Cc: stable@vger,kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      361cad3c
  9. 14 12月, 2015 2 次提交
  10. 07 12月, 2015 1 次提交
  11. 24 11月, 2015 1 次提交
  12. 14 11月, 2015 1 次提交
  13. 04 11月, 2015 1 次提交
  14. 23 10月, 2015 1 次提交
  15. 16 10月, 2015 2 次提交
  16. 08 10月, 2015 5 次提交
  17. 03 10月, 2015 3 次提交
  18. 23 9月, 2015 1 次提交
  19. 21 9月, 2015 3 次提交
  20. 02 9月, 2015 1 次提交