1. 11 6月, 2015 1 次提交
    • J
      sunrpc: keep a count of swapfiles associated with the rpc_clnt · 3c87ef6e
      Jeff Layton 提交于
      Jerome reported seeing a warning pop when working with a swapfile on
      NFS. The nfs_swap_activate can end up calling sk_set_memalloc while
      holding the rcu_read_lock and that function can sleep.
      
      To fix that, we need to take a reference to the xprt while holding the
      rcu_read_lock, set the socket up for swapping and then drop that
      reference. But, xprt_put is not exported and having NFS deal with the
      underlying xprt is a bit of layering violation anyway.
      
      Fix this by adding a set of activate/deactivate functions that take a
      rpc_clnt pointer instead of an rpc_xprt, and have nfs_swap_activate and
      nfs_swap_deactivate call those.
      
      Also, add a per-rpc_clnt atomic counter to keep track of the number of
      active swapfiles associated with it. When the counter does a 0->1
      transition, we enable swapping on the xprt, when we do a 1->0 transition
      we disable swapping on it.
      
      This also allows us to be a bit more selective with the RPC_TASK_SWAPPER
      flag. If non-swapper and swapper clnts are sharing a xprt, then we only
      need to flag the tasks from the swapper clnt with that flag.
      Acked-by: NMel Gorman <mgorman@suse.de>
      Reported-by: NJerome Marchand <jmarchan@redhat.com>
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Reviewed-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      3c87ef6e
  2. 05 6月, 2015 2 次提交
  3. 03 6月, 2015 1 次提交
  4. 24 4月, 2015 1 次提交
    • J
      sunrpc: make debugfs file creation failure non-fatal · 3f940098
      Jeff Layton 提交于
      v2: gracefully handle the case where some dentry pointers end up NULL
          and be more dilligent about zeroing out dentry pointers
      
      We currently have a problem that SELinux policy is being enforced when
      creating debugfs files. If a debugfs file is created as a side effect of
      doing some syscall, then that creation can fail if the SELinux policy
      for that process prevents it.
      
      This seems wrong. We don't do that for files under /proc, for instance,
      so Bruce has proposed a patch to fix that.
      
      While discussing that patch however, Greg K.H. stated:
      
          "No kernel code should care / fail if a debugfs function fails, so
           please fix up the sunrpc code first."
      
      This patch converts all of the sunrpc debugfs setup code to be void
      return functins, and the callers to not look for errors from those
      functions.
      
      This should allow rpc_clnt and rpc_xprt creation to work, even if the
      kernel fails to create debugfs files for some reason.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: N"J. Bruce Fields" <bfields@fieldses.org>
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      3f940098
  5. 01 4月, 2015 1 次提交
    • J
      sunrpc: make debugfs file creation failure non-fatal · f9c72d10
      Jeff Layton 提交于
      We currently have a problem that SELinux policy is being enforced when
      creating debugfs files. If a debugfs file is created as a side effect of
      doing some syscall, then that creation can fail if the SELinux policy
      for that process prevents it.
      
      This seems wrong. We don't do that for files under /proc, for instance,
      so Bruce has proposed a patch to fix that.
      
      While discussing that patch however, Greg K.H. stated:
      
          "No kernel code should care / fail if a debugfs function fails, so
           please fix up the sunrpc code first."
      
      This patch converts all of the sunrpc debugfs setup code to be void
      return functins, and the callers to not look for errors from those
      functions.
      
      This should allow rpc_clnt and rpc_xprt creation to work, even if the
      kernel fails to create debugfs files for some reason.
      
      Symptoms were failing krb5 mounts on systems using gss-proxy and
      selinux.
      
      Fixes: 388f0c77 "sunrpc: add a debugfs rpc_xprt directory..."
      Cc: stable@vger.kernel.org
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      f9c72d10
  6. 31 3月, 2015 1 次提交
  7. 12 2月, 2015 1 次提交
  8. 10 2月, 2015 1 次提交
  9. 09 2月, 2015 3 次提交
  10. 04 2月, 2015 3 次提交
  11. 30 1月, 2015 2 次提交
  12. 23 1月, 2015 1 次提交
  13. 16 1月, 2015 3 次提交
  14. 10 12月, 2014 10 次提交
  15. 02 12月, 2014 1 次提交
  16. 28 11月, 2014 2 次提交
  17. 26 11月, 2014 1 次提交
    • C
      SUNRPC: serialize iostats updates · edef1297
      Chuck Lever 提交于
      Occasionally mountstats reports a negative retransmission rate.
      Ensure that two RPCs completing concurrently don't confuse the sums
      in the transport's op_metrics array.
      
      Since pNFS filelayout can invoke rpc_count_iostats() on another
      transport from xprt_release(), we can't rely on simply holding the
      transport_lock in xprt_release(). There's nothing for it but hard
      serialization. One spin lock per RPC operation should make this as
      painless as it can be.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      edef1297
  18. 25 11月, 2014 3 次提交
  19. 25 9月, 2014 1 次提交
  20. 18 8月, 2014 1 次提交