1. 18 10月, 2017 1 次提交
    • K
      sunrpc: Convert timers to use timer_setup() · ff861c4d
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Cc: Anna Schumaker <anna.schumaker@netapp.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-nfs@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff861c4d
  2. 13 7月, 2017 1 次提交
    • C
      sunrpc: Allocate up to RPCSVC_MAXPAGES per svc_rqst · 8c6ae498
      Chuck Lever 提交于
      svcrdma needs 259 pages allocated to receive 1MB NFSv4.0 WRITE requests:
      
       - 1 page for the transport header and head iovec
       - 256 pages for the data payload
       - 1 page for the trailing GETATTR request (since NFSD XDR decoding
         does not look for a tail iovec, the GETATTR is stuck at the end
         of the rqstp->rq_arg.pages list)
       - 1 page for building the reply xdr_buf
      
      But RPCSVC_MAXPAGES is already 259 (on x86_64). The problem is that
      svc_alloc_arg never allocates that many pages. To address this:
      
      1. The final element of rq_pages always points to NULL. To
         accommodate up to 259 pages in rq_pages, add an extra element
         to rq_pages for the array termination sentinel.
      
      2. Adjust the calculation of "pages" to match how RPCSVC_MAXPAGES
         is calculated, so it can go up to 259. Bruce noted that the
         calculation assumes sv_max_mesg is a multiple of PAGE_SIZE,
         which might not always be true. I didn't change this assumption.
      
      3. Change the loop boundaries to allow 259 pages to be allocated.
      
      Additional clean-up: WARN_ON_ONCE adds an extra conditional branch,
      which is basically never taken. And there's no need to dump the
      stack here because svc_alloc_arg has only one caller.
      
      Keeping that NULL "array termination sentinel"; there doesn't appear to
      be any code that depends on it, only code in nfsd_splice_actor() which
      needs the 259th element to be initialized to *something*.  So it's
      possible we could just keep the array at 259 elements and drop that
      final NULL, but we're being conservative for now.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      8c6ae498
  3. 14 1月, 2017 1 次提交
    • P
      locking/atomic, kref: Add kref_read() · 2c935bc5
      Peter Zijlstra 提交于
      Since we need to change the implementation, stop exposing internals.
      
      Provide kref_read() to read the current reference count; typically
      used for debug messages.
      
      Kills two anti-patterns:
      
      	atomic_read(&kref->refcount)
      	kref->refcount.counter
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      2c935bc5
  4. 13 1月, 2017 1 次提交
  5. 14 11月, 2016 1 次提交
    • S
      sunrpc: svc_age_temp_xprts_now should not call setsockopt non-tcp transports · ea08e392
      Scott Mayhew 提交于
      This fixes the following panic that can occur with NFSoRDMA.
      
      general protection fault: 0000 [#1] SMP
      Modules linked in: rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi
      scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp
      scsi_tgt ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm
      mlx5_ib ib_core intel_powerclamp coretemp kvm_intel kvm sg ioatdma
      ipmi_devintf ipmi_ssif dcdbas iTCO_wdt iTCO_vendor_support pcspkr
      irqbypass sb_edac shpchp dca crc32_pclmul ghash_clmulni_intel edac_core
      lpc_ich aesni_intel lrw gf128mul glue_helper ablk_helper mei_me mei
      ipmi_si cryptd wmi ipmi_msghandler acpi_pad acpi_power_meter nfsd
      auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sd_mod
      crc_t10dif crct10dif_generic mgag200 i2c_algo_bit drm_kms_helper
      syscopyarea sysfillrect sysimgblt ahci fb_sys_fops ttm libahci mlx5_core
      tg3 crct10dif_pclmul drm crct10dif_common
      ptp i2c_core libata crc32c_intel pps_core fjes dm_mirror dm_region_hash
      dm_log dm_mod
      CPU: 1 PID: 120 Comm: kworker/1:1 Not tainted 3.10.0-514.el7.x86_64 #1
      Hardware name: Dell Inc. PowerEdge R320/0KM5PX, BIOS 2.4.2 01/29/2015
      Workqueue: events check_lifetime
      task: ffff88031f506dd0 ti: ffff88031f584000 task.ti: ffff88031f584000
      RIP: 0010:[<ffffffff8168d847>]  [<ffffffff8168d847>]
      _raw_spin_lock_bh+0x17/0x50
      RSP: 0018:ffff88031f587ba8  EFLAGS: 00010206
      RAX: 0000000000020000 RBX: 20041fac02080072 RCX: ffff88031f587fd8
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 20041fac02080072
      RBP: ffff88031f587bb0 R08: 0000000000000008 R09: ffffffff8155be77
      R10: ffff880322a59b00 R11: ffffea000bf39f00 R12: 20041fac02080072
      R13: 000000000000000d R14: ffff8800c4fbd800 R15: 0000000000000001
      FS:  0000000000000000(0000) GS:ffff880322a40000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f3c52d4547e CR3: 00000000019ba000 CR4: 00000000001407e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Stack:
      20041fac02080002 ffff88031f587bd0 ffffffff81557830 20041fac02080002
      ffff88031f587c78 ffff88031f587c40 ffffffff8155ae08 000000010157df32
      0000000800000001 ffff88031f587c20 ffffffff81096acb ffffffff81aa37d0
      Call Trace:
      [<ffffffff81557830>] lock_sock_nested+0x20/0x50
      [<ffffffff8155ae08>] sock_setsockopt+0x78/0x940
      [<ffffffff81096acb>] ? lock_timer_base.isra.33+0x2b/0x50
      [<ffffffff8155397d>] kernel_setsockopt+0x4d/0x50
      [<ffffffffa0386284>] svc_age_temp_xprts_now+0x174/0x1e0 [sunrpc]
      [<ffffffffa03b681d>] nfsd_inetaddr_event+0x9d/0xd0 [nfsd]
      [<ffffffff81691ebc>] notifier_call_chain+0x4c/0x70
      [<ffffffff810b687d>] __blocking_notifier_call_chain+0x4d/0x70
      [<ffffffff810b68b6>] blocking_notifier_call_chain+0x16/0x20
      [<ffffffff815e8538>] __inet_del_ifa+0x168/0x2d0
      [<ffffffff815e8cef>] check_lifetime+0x25f/0x270
      [<ffffffff810a7f3b>] process_one_work+0x17b/0x470
      [<ffffffff810a8d76>] worker_thread+0x126/0x410
      [<ffffffff810a8c50>] ? rescuer_thread+0x460/0x460
      [<ffffffff810b052f>] kthread+0xcf/0xe0
      [<ffffffff810b0460>] ? kthread_create_on_node+0x140/0x140
      [<ffffffff81696418>] ret_from_fork+0x58/0x90
      [<ffffffff810b0460>] ? kthread_create_on_node+0x140/0x140
      Code: ca 75 f1 5d c3 0f 1f 80 00 00 00 00 eb d9 66 0f 1f 44 00 00 0f 1f
      44 00 00 55 48 89 e5 53 48 89 fb e8 7e 04 a0 ff b8 00 00 02 00 <f0> 0f
      c1 03 89 c2 c1 ea 10 66 39 c2 75 03 5b 5d c3 83 e2 fe 0f
      RIP  [<ffffffff8168d847>] _raw_spin_lock_bh+0x17/0x50
      RSP <ffff88031f587ba8>
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Fixes: c3d4879e ("sunrpc: Add a function to close temporary transports immediately")
      Reviewed-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ea08e392
  6. 14 7月, 2016 4 次提交
  7. 15 6月, 2016 1 次提交
  8. 23 5月, 2016 1 次提交
  9. 23 12月, 2015 1 次提交
    • S
      sunrpc: Add a function to close temporary transports immediately · c3d4879e
      Scott Mayhew 提交于
      Add a function svc_age_temp_xprts_now() to close temporary transports
      whose xpt_local matches the address passed in server_addr immediately
      instead of waiting for them to be closed by the timer function.
      
      The function is intended to be used by notifier_blocks that will be
      added to nfsd and lockd that will run when an ip address is deleted.
      
      This will eliminate the ACK storms and client hangs that occur in
      HA-NFS configurations where nfsd & lockd is left running on the cluster
      nodes all the time and the NFS 'service' is migrated back and forth
      within a short timeframe.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c3d4879e
  10. 11 8月, 2015 1 次提交
  11. 23 1月, 2015 1 次提交
  12. 10 12月, 2014 9 次提交
  13. 02 12月, 2014 1 次提交
  14. 25 11月, 2014 1 次提交
  15. 29 8月, 2014 1 次提交
    • J
      SUNRPC: Fix compile on non-x86 · ae89254d
      J. Bruce Fields 提交于
      current_task appears to be x86-only, oops.
      
      Let's just delete this check entirely:
      
      Any developer that adds a new user without setting rq_task will get a
      crash the first time they test it.  I also don't think there are
      normally any important locks held here, and I can't see any other reason
      why killing a server thread would bring the whole box down.
      
      So the effort to fail gracefully here looks like overkill.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Fixes: 983c6844 "SUNRPC: get rid of the request wait queue"
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ae89254d
  16. 18 8月, 2014 5 次提交
  17. 30 7月, 2014 2 次提交
  18. 31 5月, 2014 1 次提交
  19. 23 5月, 2014 2 次提交
  20. 28 3月, 2014 1 次提交
  21. 10 2月, 2014 1 次提交
  22. 17 2月, 2013 2 次提交