1. 20 11月, 2010 7 次提交
    • M
      NFSv4.1: Make sure nfsd can decode SP4_SSV correctly at exchange_id · 5afa040b
      Mi Jinlong 提交于
      According to RFC, the argument of ssv_sp_parms4 is:
      
         struct ssv_sp_parms4 {
                 state_protect_ops4      ssp_ops;
                 sec_oid4                ssp_hash_algs<>;
                 sec_oid4                ssp_encr_algs<>;
                 uint32_t                ssp_window;
                 uint32_t                ssp_num_gss_handles;
         };
      
      If client send a exchange_id with SP4_SSV, server cann't decode
      the SP4_SSV's ssp_hash_algs and ssp_encr_algs arguments correctly.
      
      Because the kernel treat the two arguments as a signal
      sec_oid4 struct, but should be a set of sec_oid4 struct.
      Signed-off-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      5afa040b
    • J
      svcrpc: fix wspace-checking race · 9c335c0b
      J. Bruce Fields 提交于
      We call svc_xprt_enqueue() after something happens which we think may
      require handling from a server thread.  To avoid such events being lost,
      svc_xprt_enqueue() must guarantee that there will be a svc_serv() call
      from a server thread following any such event.  It does that by either
      waking up a server thread itself, or checking that XPT_BUSY is set (in
      which case somebody else is doing it).
      
      But the check of XPT_BUSY could occur just as someone finishes
      processing some other event, and just before they clear XPT_BUSY.
      
      Therefore it's important not to clear XPT_BUSY without subsequently
      doing another svc_export_enqueue() to check whether the xprt should be
      requeued.
      
      The xpo_wspace() check in svc_xprt_enqueue() breaks this rule, allowing
      an event to be missed in situations like:
      
      	data arrives
      	call svc_tcp_data_ready():
      	call svc_xprt_enqueue():
      	set BUSY
      	find no write space
      				svc_reserve():
      				free up write space
      				call svc_enqueue():
      				test BUSY
      	clear BUSY
      
      So, instead, check wspace in the same places that the state flags are
      checked: before taking BUSY, and in svc_receive().
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9c335c0b
    • J
      svcrpc: svc_close_xprt comment · b1763316
      J. Bruce Fields 提交于
      Neil Brown had to explain to me why we do this here; record the answer
      for posterity.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      b1763316
    • J
      svcrpc: simplify svc_close_all · f8c0d226
      J. Bruce Fields 提交于
      There's no need to be fooling with XPT_BUSY now that all the threads
      are gone.
      
      The list_del_init() here could execute at the same time as the
      svc_xprt_enqueue()'s list_add_tail(), with undefined results.  We don't
      really care at this point, but it might result in a spurious
      list-corruption warning or something.
      
      And svc_close() isn't adding any value; just call svc_delete_xprt()
      directly.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      f8c0d226
    • J
      nfsd4: centralize more calls to svc_xprt_received · ca7896cd
      J. Bruce Fields 提交于
      Follow up on b48fa6b9 by moving all the
      svc_xprt_received() calls for the main xprt to one place.  The clearing
      of XPT_BUSY here is critical to the correctness of the server, so I'd
      prefer it to be obvious where we do it.
      
      The only substantive result is moving svc_xprt_received() after
      svc_receive_deferred().  Other than a (likely insignificant) delay
      waking up the next thread, that should be harmless.
      
      Also reshuffle the exit code a little to skip a few other steps that we
      don't care about the in the svc_delete_xprt() case.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ca7896cd
    • J
      svcrpc: don't set then immediately clear XPT_DEFERRED · 62bac4af
      J. Bruce Fields 提交于
      There's no harm to doing this, since the only caller will immediately
      call svc_enqueue() afterwards, ensuring we don't miss the remaining
      deferred requests just because XPT_DEFERRED was briefly cleared.
      
      But why not just do this the simple way?
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      62bac4af
    • D
      nfsd: fix NULL dereference in setattr() · 43b0178e
      Dan Carpenter 提交于
      The original code would oops if this were called from nfsd4_setattr()
      because "filpp" is NULL.
      
      (Note this case is currently impossible, as long as we only give out
      read delegations.)
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      43b0178e
  2. 16 11月, 2010 27 次提交
  3. 15 11月, 2010 6 次提交