]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Merge tag 'nfsd-5.1' of git://linux-nfs.org/~bfields/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2019 22:06:54 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2019 22:06:54 +0000 (15:06 -0700)
Pull NFS server updates from Bruce Fields:
 "Miscellaneous NFS server fixes.

  Probably the most visible bug is one that could artificially limit
  NFSv4.1 performance by limiting the number of oustanding rpcs from a
  single client.

  Neil Brown also gets a special mention for fixing a 14.5-year-old
  memory-corruption bug in the encoding of NFSv3 readdir responses"

* tag 'nfsd-5.1' of git://linux-nfs.org/~bfields/linux:
  nfsd: allow nfsv3 readdir request to be larger.
  nfsd: fix wrong check in write_v4_end_grace()
  nfsd: fix memory corruption caused by readdir
  nfsd: fix performance-limiting session calculation
  svcrpc: fix UDP on servers with lots of threads
  svcrdma: Remove syslog warnings in work completion handlers
  svcrdma: Squelch compiler warning when SUNRPC_DEBUG is disabled
  svcrdma: Use struct_size() in kmalloc()
  svcrpc: fix unlikely races preventing queueing of sockets
  svcrpc: svc_xprt_has_something_to_do seems a little long
  SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot()
  nfsd: fix an IS_ERR() vs NULL check

1  2 
fs/nfsd/nfs4callback.c
fs/nfsd/nfsctl.c

diff --combined fs/nfsd/nfs4callback.c
index a9d24d5a967c0b5ff2fdb333dae4ab28a610027c,9b38dab1c21ba3547592fb6d955aabe853ca3353..d219159b98afc54bda6d2efee824b41487db17c0
@@@ -60,6 -60,16 +60,6 @@@ struct nfs4_cb_compound_hdr 
        int             status;
  };
  
 -/*
 - * Handle decode buffer overflows out-of-line.
 - */
 -static void print_overflow_msg(const char *func, const struct xdr_stream *xdr)
 -{
 -      dprintk("NFS: %s prematurely hit the end of our receive buffer. "
 -              "Remaining buffer length is %tu words.\n",
 -              func, xdr->end - xdr->p);
 -}
 -
  static __be32 *xdr_encode_empty_array(__be32 *p)
  {
        *p++ = xdr_zero;
@@@ -230,6 -240,7 +230,6 @@@ static int decode_cb_op_status(struct x
        *status = nfs_cb_stat_to_errno(be32_to_cpup(p));
        return 0;
  out_overflow:
 -      print_overflow_msg(__func__, xdr);
        return -EIO;
  out_unexpected:
        dprintk("NFSD: Callback server returned operation %d but "
@@@ -298,6 -309,7 +298,6 @@@ static int decode_cb_compound4res(struc
        hdr->nops = be32_to_cpup(p);
        return 0;
  out_overflow:
 -      print_overflow_msg(__func__, xdr);
        return -EIO;
  }
  
@@@ -425,6 -437,7 +425,6 @@@ out
        cb->cb_seq_status = status;
        return status;
  out_overflow:
 -      print_overflow_msg(__func__, xdr);
        status = -EIO;
        goto out;
  }
@@@ -900,9 -913,9 +900,9 @@@ static int setup_callback_client(struc
                return PTR_ERR(client);
        }
        cred = get_backchannel_cred(clp, client, ses);
-       if (IS_ERR(cred)) {
+       if (!cred) {
                rpc_shutdown_client(client);
-               return PTR_ERR(cred);
+               return -ENOMEM;
        }
        clp->cl_cb_client = client;
        clp->cl_cb_cred = cred;
diff --combined fs/nfsd/nfsctl.c
index 72a7681f404699b89d502102a9c290078900647b,ff14c29d01e9d9e7b0dd96b2f007810bcea8f334..f2feb2d11baefaeb3de3ce0559f5d5690af6f2a2
@@@ -1126,7 -1126,7 +1126,7 @@@ static ssize_t write_v4_end_grace(struc
                case 'Y':
                case 'y':
                case '1':
-                       if (nn->nfsd_serv)
+                       if (!nn->nfsd_serv)
                                return -EBUSY;
                        nfsd4_end_grace(nn);
                        break;
@@@ -1239,8 -1239,8 +1239,8 @@@ static __net_init int nfsd_init_net(str
        retval = nfsd_idmap_init(net);
        if (retval)
                goto out_idmap_error;
 -      nn->nfsd4_lease = 45;   /* default lease time */
 -      nn->nfsd4_grace = 45;
 +      nn->nfsd4_lease = 90;   /* default lease time */
 +      nn->nfsd4_grace = 90;
        nn->somebody_reclaimed = false;
        nn->clverifier_counter = prandom_u32();
        nn->clientid_counter = prandom_u32();