1. 07 9月, 2017 1 次提交
  2. 25 8月, 2017 1 次提交
  3. 14 7月, 2017 11 次提交
  4. 15 5月, 2017 11 次提交
  5. 09 5月, 2017 1 次提交
    • J
      lockd: fix lockd shutdown race · efda760f
      J. Bruce Fields 提交于
      As reported by David Jeffery: "a signal was sent to lockd while lockd
      was shutting down from a request to stop nfs.  The signal causes lockd
      to call restart_grace() which puts the lockd_net structure on the grace
      list.  If this signal is received at the wrong time, it will occur after
      lockd_down_net() has called locks_end_grace() but before
      lockd_down_net() stops the lockd thread.  This leads to lockd putting
      the lockd_net structure back on the grace list, then exiting without
      anything removing it from the list."
      
      So, perform the final locks_end_grace() from the the lockd thread; this
      ensures it's serialized with respect to restart_grace().
      Reported-by: NDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      efda760f
  6. 26 4月, 2017 1 次提交
  7. 21 4月, 2017 1 次提交
    • B
      lockd: Introduce nlmclnt_operations · b1ece737
      Benjamin Coddington 提交于
      NFS would enjoy the ability to modify the behavior of the NLM client's
      unlock RPC task in order to delay the transmission of the unlock until IO
      that was submitted under that lock has completed.  This ability can ensure
      that the NLM client will always complete the transmission of an unlock even
      if the waiting caller has been interrupted with fatal signal.
      
      For this purpose, a pointer to a struct nlmclnt_operations can be assigned
      in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
      the nlm_host.  The struct nlmclnt_operations defines three callback
      operations that will be used in a following patch:
      
      nlmclnt_alloc_call - used to call back after a successful allocation of
      	a struct nlm_rqst in nlmclnt_proc().
      
      nlmclnt_unlock_prepare - used to call back during NLM unlock's
      	rpc_call_prepare.  The NLM client defers calling rpc_call_start()
      	until this callback returns false.
      
      nlmclnt_release_call - used to call back when the NLM client's struct
      	nlm_rqst is freed.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b1ece737
  8. 02 3月, 2017 1 次提交
  9. 01 2月, 2017 1 次提交
  10. 18 11月, 2016 1 次提交
    • A
      netns: make struct pernet_operations::id unsigned int · c7d03a00
      Alexey Dobriyan 提交于
      Make struct pernet_operations::id unsigned.
      
      There are 2 reasons to do so:
      
      1)
      This field is really an index into an zero based array and
      thus is unsigned entity. Using negative value is out-of-bound
      access by definition.
      
      2)
      On x86_64 unsigned 32-bit data which are mixed with pointers
      via array indexing or offsets added or subtracted to pointers
      are preffered to signed 32-bit data.
      
      "int" being used as an array index needs to be sign-extended
      to 64-bit before being used.
      
      	void f(long *p, int i)
      	{
      		g(p[i]);
      	}
      
        roughly translates to
      
      	movsx	rsi, esi
      	mov	rdi, [rsi+...]
      	call 	g
      
      MOVSX is 3 byte instruction which isn't necessary if the variable is
      unsigned because x86_64 is zero extending by default.
      
      Now, there is net_generic() function which, you guessed it right, uses
      "int" as an array index:
      
      	static inline void *net_generic(const struct net *net, int id)
      	{
      		...
      		ptr = ng->ptr[id - 1];
      		...
      	}
      
      And this function is used a lot, so those sign extensions add up.
      
      Patch snipes ~1730 bytes on allyesconfig kernel (without all junk
      messing with code generation):
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      
      Unfortunately some functions actually grow bigger.
      This is a semmingly random artefact of code generation with register
      allocator being used differently. gcc decides that some variable
      needs to live in new r8+ registers and every access now requires REX
      prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be
      used which is longer than [r8]
      
      However, overall balance is in negative direction:
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      	function                                     old     new   delta
      	nfsd4_lock                                  3886    3959     +73
      	tipc_link_build_proto_msg                   1096    1140     +44
      	mac80211_hwsim_new_radio                    2776    2808     +32
      	tipc_mon_rcv                                1032    1058     +26
      	svcauth_gss_legacy_init                     1413    1429     +16
      	tipc_bcbase_select_primary                   379     392     +13
      	nfsd4_exchange_id                           1247    1260     +13
      	nfsd4_setclientid_confirm                    782     793     +11
      		...
      	put_client_renew_locked                      494     480     -14
      	ip_set_sockfn_get                            730     716     -14
      	geneve_sock_add                              829     813     -16
      	nfsd4_sequence_done                          721     703     -18
      	nlmclnt_lookup_host                          708     686     -22
      	nfsd4_lockt                                 1085    1063     -22
      	nfs_get_client                              1077    1050     -27
      	tcf_bpf_init                                1106    1076     -30
      	nfsd4_encode_fattr                          5997    5930     -67
      	Total: Before=154856051, After=154854321, chg -0.00%
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7d03a00
  11. 12 10月, 2016 1 次提交
  12. 01 7月, 2016 1 次提交
  13. 30 5月, 2016 1 次提交
  14. 07 1月, 2016 2 次提交
  15. 23 12月, 2015 1 次提交
  16. 24 10月, 2015 1 次提交
    • A
      lockd: get rid of reference-counted NSM RPC clients · 0d0f4aab
      Andrey Ryabinin 提交于
      Currently we have reference-counted per-net NSM RPC client
      which created on the first monitor request and destroyed
      after the last unmonitor request. It's needed because
      RPC client need to know 'utsname()->nodename', but utsname()
      might be NULL when nsm_unmonitor() called.
      
      So instead of holding the rpc client we could just save nodename
      in struct nlm_host and pass it to the rpc_create().
      Thus ther is no need in keeping rpc client until last
      unmonitor request. We could create separate RPC clients
      for each monitor/unmonitor requests.
      Signed-off-by: NAndrey Ryabinin <aryabinin@virtuozzo.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      0d0f4aab
  17. 23 10月, 2015 1 次提交
  18. 13 10月, 2015 1 次提交
    • A
      lockd: create NSM handles per net namespace · 0ad95472
      Andrey Ryabinin 提交于
      Commit cb7323ff ("lockd: create and use per-net NSM
       RPC clients on MON/UNMON requests") introduced per-net
      NSM RPC clients. Unfortunately this doesn't make any sense
      without per-net nsm_handle.
      
      E.g. the following scenario could happen
      Two hosts (X and Y) in different namespaces (A and B) share
      the same nsm struct.
      
      1. nsm_monitor(host_X) called => NSM rpc client created,
      	nsm->sm_monitored bit set.
      2. nsm_mointor(host-Y) called => nsm->sm_monitored already set,
      	we just exit. Thus in namespace B ln->nsm_clnt == NULL.
      3. host X destroyed => nsm->sm_count decremented to 1
      4. host Y destroyed => nsm_unmonitor() => nsm_mon_unmon() => NULL-ptr
      	dereference of *ln->nsm_clnt
      
      So this could be fixed by making per-net nsm_handles list,
      instead of global. Thus different net namespaces will not be able
      share the same nsm_handle.
      Signed-off-by: NAndrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      0ad95472
  19. 13 8月, 2015 1 次提交