1. 05 8月, 2014 23 次提交
  2. 02 8月, 2014 14 次提交
  3. 01 8月, 2014 3 次提交
    • J
      nfsd: rename unhash_generic_stateid to unhash_ol_stateid · 4ae098d3
      Jeff Layton 提交于
      ...to better match other functions that deal with open/lock stateids.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      4ae098d3
    • J
      nfsd: don't thrash the cl_lock while freeing an open stateid · d83017f9
      Jeff Layton 提交于
      When we remove the client_mutex, we'll have a potential race between
      FREE_STATEID and CLOSE.
      
      The root of the problem is that we are walking the st_locks list,
      dropping the spinlock and then trying to release the persistent
      reference to the lockstateid. In between, a FREE_STATEID call can come
      along and take the lock, find the stateid and then try to put the
      reference. That leads to a double put.
      
      Fix this by not releasing the cl_lock in order to release each lock
      stateid. Use put_generic_stateid_locked to unhash them and gather them
      onto a list, and free_ol_stateid_reaplist to free any that end up on the
      list.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      d83017f9
    • J
      nfsd: reduce cl_lock thrashing in release_openowner · 2c41beb0
      Jeff Layton 提交于
      Releasing an openowner is a bit inefficient as it can potentially thrash
      the cl_lock if you have a lot of stateids attached to it. Once we remove
      the client_mutex, it'll also potentially be dangerous to do this.
      
      Add some functions to make it easier to defer the part of putting a
      generic stateid reference that needs to be done outside the cl_lock while
      doing the parts that must be done while holding it under a single lock.
      
      First we unhash each open stateid. Then we call
      put_generic_stateid_locked which will put the reference to an
      nfs4_ol_stateid. If it turns out to be the last reference, it'll go
      ahead and remove the stid from the IDR tree and put it onto the reaplist
      using the st_locks list_head.
      
      Then, after dropping the lock we'll call free_ol_stateid_reaplist to
      walk the list of stateids that are fully unhashed and ready to be freed,
      and free each of them. This function can sleep, so it must be done
      outside any spinlocks.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2c41beb0