Commit 61ea647e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull nfsd updates from Chuck Lever:
 "This is a light release containing mostly optimizations, code clean-
  ups, and minor bug fixes. This development cycle has focused on non-
  upstream kernel work:

   1. Continuing to build upstream CI for NFSD, based on kdevops

   2. Backporting NFSD filecache-related fixes to selected LTS kernels

  One notable new feature in v6.10 NFSD is the addition of a new netlink
  protocol dedicated to configuring NFSD. A new user space tool,
  nfsdctl, is to be added to nfs-utils. Lots more to come here.

  As always I am very grateful to NFSD contributors, reviewers, testers,
  and bug reporters who participated during this cycle"

* tag 'nfsd-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (29 commits)
  NFSD: Force all NFSv4.2 COPY requests to be synchronous
  SUNRPC: Fix gss_free_in_token_pages()
  NFS/knfsd: Remove the invalid NFS error 'NFSERR_OPNOTSUPP'
  knfsd: LOOKUP can return an illegal error value
  nfsd: set security label during create operations
  NFSD: Add COPY status code to OFFLOAD_STATUS response
  NFSD: Record status of async copy operation in struct nfsd4_copy
  SUNRPC: Remove comment for sp_lock
  NFSD: add listener-{set,get} netlink command
  SUNRPC: add a new svc_find_listener helper
  SUNRPC: introduce svc_xprt_create_from_sa utility routine
  NFSD: add write_version to netlink command
  NFSD: convert write_threads to netlink command
  NFSD: allow callers to pass in scope string to nfsd_svc
  NFSD: move nfsd_mutex handling into nfsd_svc callers
  lockd: host: Remove unnecessary statements'host = NULL;'
  nfsd: don't create nfsv4recoverydir in nfsdfs when not used.
  nfsd: optimise recalculate_deny_mode() for a common case
  nfsd: add tracepoint in mark_client_expired_locked
  nfsd: new tracepoint for check_slot_seqid
  ...
parents 25f48746 8d915bbf
Loading
Loading
Loading
Loading
+110 −0
Original line number Diff line number Diff line
@@ -62,6 +62,59 @@ attribute-sets:
        name: compound-ops
        type: u32
        multi-attr: true
  -
    name: server
    attributes:
      -
        name: threads
        type: u32
        multi-attr: true
      -
        name: gracetime
        type: u32
      -
        name: leasetime
        type: u32
      -
        name: scope
        type: string
  -
    name: version
    attributes:
      -
        name: major
        type: u32
      -
        name: minor
        type: u32
      -
        name: enabled
        type: flag
  -
    name: server-proto
    attributes:
      -
        name: version
        type: nest
        nested-attributes: version
        multi-attr: true
  -
    name: sock
    attributes:
      -
        name: addr
        type: binary
      -
        name: transport-name
        type: string
  -
    name: server-sock
    attributes:
      -
        name: addr
        type: nest
        nested-attributes: sock
        multi-attr: true

operations:
  list:
@@ -87,3 +140,60 @@ operations:
            - sport
            - dport
            - compound-ops
    -
      name: threads-set
      doc: set the number of running threads
      attribute-set: server
      flags: [ admin-perm ]
      do:
        request:
          attributes:
            - threads
            - gracetime
            - leasetime
            - scope
    -
      name: threads-get
      doc: get the number of running threads
      attribute-set: server
      do:
        reply:
          attributes:
            - threads
            - gracetime
            - leasetime
            - scope
    -
      name: version-set
      doc: set nfs enabled versions
      attribute-set: server-proto
      flags: [ admin-perm ]
      do:
        request:
          attributes:
            - version
    -
      name: version-get
      doc: get nfs enabled versions
      attribute-set: server-proto
      do:
        reply:
          attributes:
            - version
    -
      name: listener-set
      doc: set nfs running sockets
      attribute-set: server-sock
      flags: [ admin-perm ]
      do:
        request:
          attributes:
            - addr
    -
      name: listener-get
      doc: get nfs running listeners
      attribute-set: server-sock
      do:
        reply:
          attributes:
            - addr
+0 −1
Original line number Diff line number Diff line
@@ -117,7 +117,6 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
	if (nsm != NULL)
		refcount_inc(&nsm->sm_count);
	else {
		host = NULL;
		nsm = nsm_get_handle(ni->net, ni->sap, ni->salen,
					ni->hostname, ni->hostname_len);
		if (unlikely(nsm == NULL)) {
+10 −6
Original line number Diff line number Diff line
@@ -334,20 +334,24 @@ static void nfsd4_fslocs_free(struct nfsd4_fs_locations *fsloc)
static int export_stats_init(struct export_stats *stats)
{
	stats->start_time = ktime_get_seconds();
	return nfsd_percpu_counters_init(stats->counter, EXP_STATS_COUNTERS_NUM);
	return percpu_counter_init_many(stats->counter, 0, GFP_KERNEL,
					EXP_STATS_COUNTERS_NUM);
}

static void export_stats_reset(struct export_stats *stats)
{
	if (stats)
		nfsd_percpu_counters_reset(stats->counter,
					   EXP_STATS_COUNTERS_NUM);
	if (stats) {
		int i;

		for (i = 0; i < EXP_STATS_COUNTERS_NUM; i++)
			percpu_counter_set(&stats->counter[i], 0);
	}
}

static void export_stats_destroy(struct export_stats *stats)
{
	if (stats)
		nfsd_percpu_counters_destroy(stats->counter,
		percpu_counter_destroy_many(stats->counter,
					    EXP_STATS_COUNTERS_NUM);
}

+66 −0
Original line number Diff line number Diff line
@@ -10,6 +10,36 @@

#include <uapi/linux/nfsd_netlink.h>

/* Common nested types */
const struct nla_policy nfsd_sock_nl_policy[NFSD_A_SOCK_TRANSPORT_NAME + 1] = {
	[NFSD_A_SOCK_ADDR] = { .type = NLA_BINARY, },
	[NFSD_A_SOCK_TRANSPORT_NAME] = { .type = NLA_NUL_STRING, },
};

const struct nla_policy nfsd_version_nl_policy[NFSD_A_VERSION_ENABLED + 1] = {
	[NFSD_A_VERSION_MAJOR] = { .type = NLA_U32, },
	[NFSD_A_VERSION_MINOR] = { .type = NLA_U32, },
	[NFSD_A_VERSION_ENABLED] = { .type = NLA_FLAG, },
};

/* NFSD_CMD_THREADS_SET - do */
static const struct nla_policy nfsd_threads_set_nl_policy[NFSD_A_SERVER_SCOPE + 1] = {
	[NFSD_A_SERVER_THREADS] = { .type = NLA_U32, },
	[NFSD_A_SERVER_GRACETIME] = { .type = NLA_U32, },
	[NFSD_A_SERVER_LEASETIME] = { .type = NLA_U32, },
	[NFSD_A_SERVER_SCOPE] = { .type = NLA_NUL_STRING, },
};

/* NFSD_CMD_VERSION_SET - do */
static const struct nla_policy nfsd_version_set_nl_policy[NFSD_A_SERVER_PROTO_VERSION + 1] = {
	[NFSD_A_SERVER_PROTO_VERSION] = NLA_POLICY_NESTED(nfsd_version_nl_policy),
};

/* NFSD_CMD_LISTENER_SET - do */
static const struct nla_policy nfsd_listener_set_nl_policy[NFSD_A_SERVER_SOCK_ADDR + 1] = {
	[NFSD_A_SERVER_SOCK_ADDR] = NLA_POLICY_NESTED(nfsd_sock_nl_policy),
};

/* Ops table for nfsd */
static const struct genl_split_ops nfsd_nl_ops[] = {
	{
@@ -19,6 +49,42 @@ static const struct genl_split_ops nfsd_nl_ops[] = {
		.done	= nfsd_nl_rpc_status_get_done,
		.flags	= GENL_CMD_CAP_DUMP,
	},
	{
		.cmd		= NFSD_CMD_THREADS_SET,
		.doit		= nfsd_nl_threads_set_doit,
		.policy		= nfsd_threads_set_nl_policy,
		.maxattr	= NFSD_A_SERVER_SCOPE,
		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
	},
	{
		.cmd	= NFSD_CMD_THREADS_GET,
		.doit	= nfsd_nl_threads_get_doit,
		.flags	= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= NFSD_CMD_VERSION_SET,
		.doit		= nfsd_nl_version_set_doit,
		.policy		= nfsd_version_set_nl_policy,
		.maxattr	= NFSD_A_SERVER_PROTO_VERSION,
		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
	},
	{
		.cmd	= NFSD_CMD_VERSION_GET,
		.doit	= nfsd_nl_version_get_doit,
		.flags	= GENL_CMD_CAP_DO,
	},
	{
		.cmd		= NFSD_CMD_LISTENER_SET,
		.doit		= nfsd_nl_listener_set_doit,
		.policy		= nfsd_listener_set_nl_policy,
		.maxattr	= NFSD_A_SERVER_SOCK_ADDR,
		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
	},
	{
		.cmd	= NFSD_CMD_LISTENER_GET,
		.doit	= nfsd_nl_listener_get_doit,
		.flags	= GENL_CMD_CAP_DO,
	},
};

struct genl_family nfsd_nl_family __ro_after_init = {
+10 −0
Original line number Diff line number Diff line
@@ -11,11 +11,21 @@

#include <uapi/linux/nfsd_netlink.h>

/* Common nested types */
extern const struct nla_policy nfsd_sock_nl_policy[NFSD_A_SOCK_TRANSPORT_NAME + 1];
extern const struct nla_policy nfsd_version_nl_policy[NFSD_A_VERSION_ENABLED + 1];

int nfsd_nl_rpc_status_get_start(struct netlink_callback *cb);
int nfsd_nl_rpc_status_get_done(struct netlink_callback *cb);

int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
				  struct netlink_callback *cb);
int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info);
int nfsd_nl_threads_get_doit(struct sk_buff *skb, struct genl_info *info);
int nfsd_nl_version_set_doit(struct sk_buff *skb, struct genl_info *info);
int nfsd_nl_version_get_doit(struct sk_buff *skb, struct genl_info *info);
int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info);
int nfsd_nl_listener_get_doit(struct sk_buff *skb, struct genl_info *info);

extern struct genl_family nfsd_nl_family;

Loading