1. 06 8月, 2014 2 次提交
  2. 05 8月, 2014 7 次提交
  3. 02 8月, 2014 1 次提交
  4. 01 8月, 2014 7 次提交
  5. 30 7月, 2014 1 次提交
  6. 24 7月, 2014 2 次提交
  7. 22 7月, 2014 1 次提交
  8. 17 7月, 2014 3 次提交
  9. 11 7月, 2014 4 次提交
    • J
      nfsd: make deny mode enforcement more efficient and close races in it · baeb4ff0
      Jeff Layton 提交于
      The current enforcement of deny modes is both inefficient and scattered
      across several places, which makes it hard to guarantee atomicity. The
      inefficiency is a problem now, and the lack of atomicity will mean races
      once the client_mutex is removed.
      
      First, we address the inefficiency. We have to track deny modes on a
      per-stateid basis to ensure that open downgrades are sane, but when the
      server goes to enforce them it has to walk the entire list of stateids
      and check against each one.
      
      Instead of doing that, maintain a per-nfs4_file deny mode. When a file
      is opened, we simply set any deny bits in that mode that were specified
      in the OPEN call. We can then use that unified deny mode to do a simple
      check to see whether there are any conflicts without needing to walk the
      entire stateid list.
      
      The only time we'll need to walk the entire list of stateids is when a
      stateid that has a deny mode on it is being released, or one is having
      its deny mode downgraded. In that case, we must walk the entire list and
      recalculate the fi_share_deny field. Since deny modes are pretty rare
      today, this should be very rare under normal workloads.
      
      To address the potential for races once the client_mutex is removed,
      protect fi_share_deny with the fi_lock. In nfs4_get_vfs_file, check to
      make sure that any deny mode we want to apply won't conflict with
      existing access. If that's ok, then have nfs4_file_get_access check that
      new access to the file won't conflict with existing deny modes.
      
      If that also passes, then get file access references, set the correct
      access and deny bits in the stateid, and update the fi_share_deny field.
      If opening the file or truncating it fails, then unwind the whole mess
      and return the appropriate error.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      baeb4ff0
    • J
      nfsd: shrink st_access_bmap and st_deny_bmap · c11c591f
      Jeff Layton 提交于
      We never use anything above bit #3, so an unsigned long for each is
      wasteful. Shrink them to a char each, and add some WARN_ON_ONCE calls if
      we try to set or clear bits that would go outside those sizes.
      
      Note too that because atomic bitops work on unsigned longs, we have to
      abandon their use here. That shouldn't be a problem though since we
      don't really care about the atomicity in this code anyway. Using them
      was just a convenient way to flip bits.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c11c591f
    • T
      nfsd: Add locking to the nfs4_file->fi_fds[] array · de18643d
      Trond Myklebust 提交于
      Preparation for removal of the client_mutex, which currently protects
      this array. While we don't actually need the find_*_file_locked variants
      just yet, a later patch will. So go ahead and add them now to reduce
      future churn in this code.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      de18643d
    • T
      nfsd: Add fine grained protection for the nfs4_file->fi_stateids list · 1d31a253
      Trond Myklebust 提交于
      Access to this list is currently serialized by the client_mutex. Add
      finer grained locking around this list in preparation for its removal.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      1d31a253
  10. 10 7月, 2014 4 次提交
  11. 09 7月, 2014 2 次提交
  12. 23 5月, 2014 1 次提交
  13. 07 5月, 2014 2 次提交
  14. 02 7月, 2013 1 次提交
  15. 16 4月, 2013 1 次提交
    • J
      nfsd4: implement SEQ4_STATUS_RECALLABLE_STATE_REVOKED · 3bd64a5b
      J. Bruce Fields 提交于
      A 4.1 server must notify a client that has had any state revoked using
      the SEQ4_STATUS_RECALLABLE_STATE_REVOKED flag.  The client can figure
      out exactly which state is the problem using CHECK_STATEID and then free
      it using FREE_STATEID.  The status flag will be unset once all such
      revoked stateids are freed.
      
      Our server's only recallable state is delegations.  So we keep with each
      4.1 client a list of delegations that have timed out and been recalled,
      but haven't yet been freed by FREE_STATEID.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      3bd64a5b
  16. 08 4月, 2013 1 次提交
    • J
      nfsd4: cleanup handling of nfsv4.0 closed stateid's · 9411b1d4
      J. Bruce Fields 提交于
      Closed stateid's are kept around a little while to handle close replays
      in the 4.0 case.  So we stash them in the last-used stateid in the
      oo_last_closed_stateid field of the open owner.  We can free that in
      encode_seqid_op_tail once the seqid on the open owner is next
      incremented.  But we don't want to do that on the close itself; so we
      set NFS4_OO_PURGE_CLOSE flag set on the open owner, skip freeing it the
      first time through encode_seqid_op_tail, then when we see that flag set
      next time we free it.
      
      This is unnecessarily baroque.
      
      Instead, just move the logic that increments the seqid out of the xdr
      code and into the operation code itself.
      
      The justification given for the current placement is that we need to
      wait till the last minute to be sure we know whether the status is a
      sequence-id-mutating error or not, but examination of the code shows
      that can't actually happen.
      Reported-by: NYanchuan Nian <ycnian@gmail.com>
      Tested-by: NYanchuan Nian <ycnian@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9411b1d4