Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dd3c2e5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'nfsd-4.15' of git://linux-nfs.org/~bfields/linux

Pull nfsd updates from Bruce Fields:
 "Lots of good bugfixes, including:

   -  fix a number of races in the NFSv4+ state code

   -  fix some shutdown crashes in multiple-network-namespace cases

   -  relax our 4.1 session limits; if you've an artificially low limit
      to the number of 4.1 clients that can mount simultaneously, try
      upgrading"

* tag 'nfsd-4.15' of git://linux-nfs.org/~bfields/linux: (22 commits)
  SUNRPC: Improve ordering of transport processing
  nfsd: deal with revoked delegations appropriately
  svcrdma: Enqueue after setting XPT_CLOSE in completion handlers
  nfsd: use nfs->ns.inum as net ID
  rpc: remove some BUG()s
  svcrdma: Preserve CB send buffer across retransmits
  nfds: avoid gettimeofday for nfssvc_boot time
  fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t
  fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t
  fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t
  lockd: double unregister of inetaddr notifiers
  nfsd4: catch some false session retries
  nfsd4: fix cached replies to solo SEQUENCE compounds
  sunrcp: make function _svc_create_xprt static
  SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
  nfsd: use ARRAY_SIZE
  nfsd: give out fewer session slots as limit approaches
  nfsd: increase DRC cache limit
  nfsd: remove unnecessary nofilehandle checks
  nfs_common: convert int to bool
  ...
parents 07c455ee 22700f3c
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -369,6 +369,7 @@ static int lockd_start_svc(struct svc_serv *serv)
		printk(KERN_WARNING
			"lockd_up: svc_rqst allocation failed, error=%d\n",
			error);
		lockd_unregister_notifiers();
		goto out_rqst;
	}

@@ -459,13 +460,16 @@ int lockd_up(struct net *net)
	}

	error = lockd_up_net(serv, net);
	if (error < 0)
		goto err_net;
	if (error < 0) {
		lockd_unregister_notifiers();
		goto err_put;
	}

	error = lockd_start_svc(serv);
	if (error < 0)
		goto err_start;

	if (error < 0) {
		lockd_down_net(serv, net);
		goto err_put;
	}
	nlmsvc_users++;
	/*
	 * Note: svc_serv structures have an initial use count of 1,
@@ -476,12 +480,6 @@ int lockd_up(struct net *net)
err_create:
	mutex_unlock(&nlmsvc_mutex);
	return error;

err_start:
	lockd_down_net(serv, net);
err_net:
	lockd_unregister_notifiers();
	goto err_put;
}
EXPORT_SYMBOL_GPL(lockd_up);

+12 −12
Original line number Diff line number Diff line
@@ -55,14 +55,7 @@ locks_end_grace(struct lock_manager *lm)
}
EXPORT_SYMBOL_GPL(locks_end_grace);

/**
 * locks_in_grace
 *
 * Lock managers call this function to determine when it is OK for them
 * to answer ordinary lock requests, and when they should accept only
 * lock reclaims.
 */
int
static bool
__state_in_grace(struct net *net, bool open)
{
	struct list_head *grace_list = net_generic(net, grace_net_id);
@@ -78,15 +71,22 @@ __state_in_grace(struct net *net, bool open)
	return false;
}

int locks_in_grace(struct net *net)
/**
 * locks_in_grace
 *
 * Lock managers call this function to determine when it is OK for them
 * to answer ordinary lock requests, and when they should accept only
 * lock reclaims.
 */
bool locks_in_grace(struct net *net)
{
	return __state_in_grace(net, 0);
	return __state_in_grace(net, false);
}
EXPORT_SYMBOL_GPL(locks_in_grace);

int opens_in_grace(struct net *net)
bool opens_in_grace(struct net *net)
{
	return __state_in_grace(net, 1);
	return __state_in_grace(net, true);
}
EXPORT_SYMBOL_GPL(opens_in_grace);

+2 −3
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/nsproxy.h>
#include <linux/sunrpc/addr.h>
#include <linux/uaccess.h>
#include <linux/kernel.h>

#include "state.h"
#include "netns.h"
@@ -126,8 +127,6 @@ static struct nfsd_fault_inject_op inject_ops[] = {
	},
};

#define NUM_INJECT_OPS (sizeof(inject_ops)/sizeof(struct nfsd_fault_inject_op))

int nfsd_fault_inject_init(void)
{
	unsigned int i;
@@ -138,7 +137,7 @@ int nfsd_fault_inject_init(void)
	if (!debug_dir)
		goto fail;

	for (i = 0; i < NUM_INJECT_OPS; i++) {
	for (i = 0; i < ARRAY_SIZE(inject_ops); i++) {
		op = &inject_ops[i];
		if (!debugfs_create_file(op->file, mode, debug_dir, op, &fops_nfsd))
			goto fail;
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ struct nfsd_net {
	bool lockd_up;

	/* Time of server startup */
	struct timeval nfssvc_boot;
	struct timespec64 nfssvc_boot;

	/*
	 * Max number of connections this nfsd container will allow. Defaults
+6 −4
Original line number Diff line number Diff line
@@ -748,8 +748,9 @@ nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p)
	if (resp->status == 0) {
		*p++ = htonl(resp->count);
		*p++ = htonl(resp->committed);
		*p++ = htonl(nn->nfssvc_boot.tv_sec);
		*p++ = htonl(nn->nfssvc_boot.tv_usec);
		/* unique identifier, y2038 overflow can be ignored */
		*p++ = htonl((u32)nn->nfssvc_boot.tv_sec);
		*p++ = htonl(nn->nfssvc_boot.tv_nsec);
	}
	return xdr_ressize_check(rqstp, p);
}
@@ -1119,8 +1120,9 @@ nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p)
	p = encode_wcc_data(rqstp, p, &resp->fh);
	/* Write verifier */
	if (resp->status == 0) {
		*p++ = htonl(nn->nfssvc_boot.tv_sec);
		*p++ = htonl(nn->nfssvc_boot.tv_usec);
		/* unique identifier, y2038 overflow can be ignored */
		*p++ = htonl((u32)nn->nfssvc_boot.tv_sec);
		*p++ = htonl(nn->nfssvc_boot.tv_nsec);
	}
	return xdr_ressize_check(rqstp, p);
}
Loading