1. 11 7月, 2014 3 次提交
    • 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
    • J
      nfsd: reduce some spinlocking in put_client_renew · d6c249b4
      Jeff Layton 提交于
      No need to take the lock unless the count goes to 0.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      d6c249b4
    • J
      nfsd: close potential race between delegation break and laundromat · dff1399f
      Jeff Layton 提交于
      Bruce says:
      
          There's also a preexisting expire_client/laundromat vs break race:
      
          - expire_client/laundromat adds a delegation to its local
            reaplist using the same dl_recall_lru field that a delegation
            uses to track its position on the recall lru and drops the
            state lock.
      
          - a concurrent break_lease adds the delegation to the lru.
      
          - expire/client/laundromat then walks it reaplist and sees the
            lru head as just another delegation on the list....
      
      Fix this race by checking the dl_time under the state_lock. If we find
      that it's not 0, then we know that it has already been queued to the LRU
      list and that we shouldn't queue it again.
      
      In the case of destroy_client, we must also ensure that we don't hit
      similar races by ensuring that we don't move any delegations to the
      reaplist with a dl_time of 0. Just bump the dl_time by one before we
      drop the state_lock. We're destroying the delegations anyway, so a 1s
      difference there won't matter.
      
      The fault injection code also requires a bit of surgery here:
      
      First, in the case of nfsd_forget_client_delegations, we must prevent
      the same sort of race vs. the delegation break callback. For that, we
      just increment the dl_time to ensure that a delegation callback can't
      race in while we're working on it.
      
      We can't do that for nfsd_recall_client_delegations, as we need to have
      it actually queue the delegation, and that won't happen if we increment
      the dl_time. The state lock is held over that function, so we don't need
      to worry about these sorts of races there.
      
      There is one other potential bug nfsd_recall_client_delegations though.
      Entries on the victims list are not dequeued before calling
      nfsd_break_one_deleg. That's a potential list corruptor, so ensure that
      we do that there.
      Reported-by: N"J. Bruce Fields" <bfields@fieldses.org>
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      dff1399f
  2. 10 7月, 2014 9 次提交
  3. 09 7月, 2014 7 次提交
  4. 23 6月, 2014 1 次提交
  5. 18 6月, 2014 1 次提交
    • N
      NFSD: Don't hand out delegations for 30 seconds after recalling them. · 6282cd56
      NeilBrown 提交于
      If nfsd needs to recall a delegation for some reason it implies that there is
      contention on the file, so further delegations should not be handed out.
      
      The current code fails to do so, and the result is effectively a
      live-lock under some workloads: a client attempting a conflicting
      operation on a read-delegated file receives NFS4ERR_DELAY and retries
      the operation, but by the time it retries the server may already have
      given out another delegation.
      
      We could simply avoid delegations for (say) 30 seconds after any recall, but
      this is probably too heavy handed.
      
      We could keep a list of inodes (or inode numbers or filehandles) for recalled
      delegations, but that requires memory allocation and searching.
      
      The approach taken here is to use a bloom filter to record the filehandles
      which are currently blocked from delegation, and to accept the cost of a few
      false positives.
      
      We have 2 bloom filters, each of which is valid for 30 seconds.   When a
      delegation is recalled the filehandle is added to one filter and will remain
      disabled for between 30 and 60 seconds.
      
      We keep a count of the number of filehandles that have been added, so when
      that count is zero we can bypass all other tests.
      
      The bloom filters have 256 bits and 3 hash functions.  This should allow a
      couple of dozen blocked  filehandles with minimal false positives.  If many
      more filehandles are all blocked at once, behaviour will degrade towards
      rejecting all delegations for between 30 and 60 seconds, then resetting and
      allowing new delegations.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6282cd56
  6. 10 6月, 2014 1 次提交
  7. 05 6月, 2014 3 次提交
  8. 31 5月, 2014 5 次提交
  9. 29 5月, 2014 1 次提交
  10. 23 5月, 2014 2 次提交
  11. 22 5月, 2014 1 次提交
  12. 21 5月, 2014 2 次提交
  13. 09 5月, 2014 1 次提交
  14. 07 5月, 2014 3 次提交