Merge tag 'nfsd-4.6' of git://linux-nfs.org/~bfields/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2016 17:41:00 +0000 (10:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2016 17:41:00 +0000 (10:41 -0700)
Pull nfsd updates from Bruce Fields:
 "Various bugfixes, a RDMA update from Chuck Lever, and support for a
  new pnfs layout type from Christoph Hellwig.  The new layout type is a
  variant of the block layout which uses SCSI features to offer improved
  fencing and device identification.

  (Also: note this pull request also includes the client side of SCSI
  layout, with Trond's permission.)"

* tag 'nfsd-4.6' of git://linux-nfs.org/~bfields/linux:
  sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
  nfsd: recover: fix memory leak
  nfsd: fix deadlock secinfo+readdir compound
  nfsd4: resfh unused in nfsd4_secinfo
  svcrdma: Use new CQ API for RPC-over-RDMA server send CQs
  svcrdma: Use new CQ API for RPC-over-RDMA server receive CQs
  svcrdma: Remove close_out exit path
  svcrdma: Hook up the logic to return ERR_CHUNK
  svcrdma: Use correct XID in error replies
  svcrdma: Make RDMA_ERROR messages work
  rpcrdma: Add RPCRDMA_HDRLEN_ERR
  svcrdma: svc_rdma_post_recv() should close connection on error
  svcrdma: Close connection when a send error occurs
  nfsd: Lower NFSv4.1 callback message size limit
  svcrdma: Do not send Write chunk XDR pad with inline content
  svcrdma: Do not write xdr_buf::tail in a Write chunk
  svcrdma: Find client-provided write and reply chunks once per reply
  nfsd: Update NFS server comments related to RDMA support
  nfsd: Fix a memory leak when meeting unsupported state_protect_how4
  nfsd4: fix bad bounds checking

1  2 
fs/nfsd/nfs4recover.c

diff --combined fs/nfsd/nfs4recover.c
  *
  */
  
 +#include <crypto/hash.h>
  #include <linux/file.h>
  #include <linux/slab.h>
  #include <linux/namei.h>
 -#include <linux/crypto.h>
  #include <linux/sched.h>
  #include <linux/fs.h>
  #include <linux/module.h>
@@@ -104,35 -104,29 +104,35 @@@ static in
  nfs4_make_rec_clidname(char *dname, const struct xdr_netobj *clname)
  {
        struct xdr_netobj cksum;
 -      struct hash_desc desc;
 -      struct scatterlist sg;
 +      struct crypto_shash *tfm;
        int status;
  
        dprintk("NFSD: nfs4_make_rec_clidname for %.*s\n",
                        clname->len, clname->data);
 -      desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
 -      desc.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
 -      if (IS_ERR(desc.tfm)) {
 -              status = PTR_ERR(desc.tfm);
 +      tfm = crypto_alloc_shash("md5", 0, 0);
 +      if (IS_ERR(tfm)) {
 +              status = PTR_ERR(tfm);
                goto out_no_tfm;
        }
  
 -      cksum.len = crypto_hash_digestsize(desc.tfm);
 +      cksum.len = crypto_shash_digestsize(tfm);
        cksum.data = kmalloc(cksum.len, GFP_KERNEL);
        if (cksum.data == NULL) {
                status = -ENOMEM;
                goto out;
        }
  
 -      sg_init_one(&sg, clname->data, clname->len);
 +      {
 +              SHASH_DESC_ON_STACK(desc, tfm);
 +
 +              desc->tfm = tfm;
 +              desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
 +
 +              status = crypto_shash_digest(desc, clname->data, clname->len,
 +                                           cksum.data);
 +              shash_desc_zero(desc);
 +      }
  
 -      status = crypto_hash_digest(&desc, &sg, sg.length, cksum.data);
        if (status)
                goto out;
  
        status = 0;
  out:
        kfree(cksum.data);
 -      crypto_free_hash(desc.tfm);
 +      crypto_free_shash(tfm);
  out_no_tfm:
        return status;
  }
@@@ -1266,6 -1260,7 +1266,7 @@@ nfsd4_umh_cltrack_init(struct net *net
        /* XXX: The usermode helper s not working in container yet. */
        if (net != &init_net) {
                pr_warn("NFSD: attempt to initialize umh client tracking in a container ignored.\n");
+               kfree(grace_start);
                return -EINVAL;
        }