1. 22 7月, 2014 2 次提交
    • J
      nfsd: fix race that grants unrecallable delegation · 417c6629
      Jeff Layton 提交于
      If nfs4_setlease succesfully acquires a new delegation, then another
      task breaks the delegation before we reach hash_delegation_locked, then
      the breaking task will see an empty fi_delegations list and do nothing.
      The client will receive an open reply incorrectly granting a delegation
      and will never receive a recall.
      
      Move more of the delegation fields to be protected by the fi_lock. It's
      more granular than the state_lock and in later patches we'll want to
      be able to rely on it in addition to the state_lock.
      
      Attempt to acquire a delegation. If that succeeds, take the spinlocks
      and then check to see if the file has had a conflict show up since then.
      If it has, then we assume that the lease is no longer valid and that
      we shouldn't hand out a delegation.
      
      There's also one more potential (but very unlikely) problem. If the
      lease is broken before the delegation is hashed, then it could leak.
      In the event that the fi_delegations list is empty, reset the
      fl_break_time to jiffies so that it's cleaned up ASAP by
      the normal lease handling code.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      417c6629
    • J
      nfsd4: CREATE_SESSION should update backchannel immediately · 57a37144
      J. Bruce Fields 提交于
      nfsd4_probe_callback kicks off some work that will eventually run
      nfsd4_process_cb_update and update the session flags.  In theory we
      could process a following SEQUENCE call before that update happens
      resulting in flags that don't accurately represent, for example, the
      lack of a backchannel.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      57a37144
  2. 18 7月, 2014 3 次提交
    • C
      svcrdma: Select NFSv4.1 backchannel transport based on forward channel · 3c45ddf8
      Chuck Lever 提交于
      The current code always selects XPRT_TRANSPORT_BC_TCP for the back
      channel, even when the forward channel was not TCP (eg, RDMA). When
      a 4.1 mount is attempted with RDMA, the server panics in the TCP BC
      code when trying to send CB_NULL.
      
      Instead, construct the transport protocol number from the forward
      channel transport or'd with XPRT_TRANSPORT_BC. Transports that do
      not support bi-directional RPC will not have registered a "BC"
      transport, causing create_backchannel_client() to fail immediately.
      
      Fixes: https://bugzilla.linux-nfs.org/show_bug.cgi?id=265Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      3c45ddf8
    • J
      nfsd4: zero op arguments beyond the 8th compound op · 5d6031ca
      J. Bruce Fields 提交于
      The first 8 ops of the compound are zeroed since they're a part of the
      argument that's zeroed by the
      
      	memset(rqstp->rq_argp, 0, procp->pc_argsize);
      
      in svc_process_common().  But we handle larger compounds by allocating
      the memory on the fly in nfsd4_decode_compound().  Other than code
      recently fixed by 01529e3f "NFSD: Fix memory leak in encoding denied
      lock", I don't know of any examples of code depending on this
      initialization. But it definitely seems possible, and I'd rather be
      safe.
      
      Compounds this long are unusual so I'm much more worried about failure
      in this poorly tested cases than about an insignificant performance hit.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      5d6031ca
    • J
      nfsd: silence sparse warning about accessing credentials · ae4b884f
      Jeff Layton 提交于
      sparse says:
      
          fs/nfsd/auth.c:31:38: warning: incorrect type in argument 1 (different address spaces)
          fs/nfsd/auth.c:31:38:    expected struct cred const *cred
          fs/nfsd/auth.c:31:38:    got struct cred const [noderef] <asn:4>*real_cred
      
      Add a new accessor for the ->real_cred and use that to fetch the
      pointer. Accessing current->real_cred directly is actually quite safe
      since we know that they can't go away so this is mostly a cosmetic fixup
      to silence sparse.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ae4b884f
  3. 17 7月, 2014 4 次提交
  4. 12 7月, 2014 2 次提交
  5. 11 7月, 2014 13 次提交
  6. 10 7月, 2014 12 次提交
  7. 09 7月, 2014 4 次提交