Commit 7449f86b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull NFS client updates from Anna Schumaker:
 "New Features:
   - Use an LRU list for returning unused delegations
   - Introduce a KConfig option to disable NFS v4.0 and make NFS v4.1
     the default

  Bugfixes:
   - NFS/localio:
       - Handle short writes by retrying
       - Prevent direct reclaim recursion into NFS via nfs_writepages
       - Use GFP_NOIO and non-memreclaim workqueue in nfs_local_commit
       - Remove -EAGAIN handling in nfs_local_doio()
   - pNFS: fix a missing wake up while waiting on NFS_LAYOUT_DRAIN
   - fs/nfs: Fix a readdir slow-start regression
   - SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

  Other cleanups and improvements:
   - A few other NFS/localio cleanups
   - Various other delegation handling cleanups from Christoph
   - Unify security_inode_listsecurity() calls
   - Improvements to NFSv4 lease handling
   - Clean up SUNRPC *_debug fields when CONFIG_SUNRPC_DEBUG is not set"

* tag 'nfs-for-7.0-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (60 commits)
  SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path
  nfs: nfs4proc: Convert comma to semicolon
  SUNRPC: Change list definition method
  sunrpc: rpc_debug and others are defined even if CONFIG_SUNRPC_DEBUG unset
  NFSv4: limit lease period in nfs4_set_lease_period()
  NFSv4: pass lease period in seconds to nfs4_set_lease_period()
  nfs: unify security_inode_listsecurity() calls
  fs/nfs: Fix readdir slow-start regression
  pNFS: fix a missing wake up while waiting on NFS_LAYOUT_DRAIN
  NFS: fix delayed delegation return handling
  NFS: simplify error handling in nfs_end_delegation_return
  NFS: fold nfs_abort_delegation_return into nfs_end_delegation_return
  NFS: remove the delegation == NULL check in nfs_end_delegation_return
  NFS: use bool for the issync argument to nfs_end_delegation_return
  NFS: return void from ->return_delegation
  NFS: return void from nfs4_inode_make_writeable
  NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4
  NFS: Add a way to disable NFS v4.0 via KConfig
  NFS: Move sequence slot operations into minorversion operations
  NFS: Pass a struct nfs_client to nfs4_init_sequence()
  ...
parents 8429538c dd2fdc35
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -78,9 +78,10 @@ config NFS_V4
	tristate "NFS client support for NFS version 4"
	depends on NFS_FS
	select KEYS
	select SUNRPC_BACKCHANNEL
	help
	  This option enables support for version 4 of the NFS protocol
	  (RFC 3530) in the kernel's NFS client.
	  This option enables support for version 4.1 of the NFS protocol
	  (RFC 5661) in the kernel's NFS client.

	  To mount NFS servers using NFSv4, you also need to install user
	  space programs which can be found in the Linux nfs-utils package,
@@ -96,19 +97,18 @@ config NFS_SWAP
	help
	  This option enables swapon to work on files located on NFS mounts.

config NFS_V4_1
	bool "NFS client support for NFSv4.1"
config NFS_V4_0
	bool "NFS client support for NFSv4.0"
	depends on NFS_V4
	select SUNRPC_BACKCHANNEL
	help
	  This option enables support for minor version 1 of the NFSv4 protocol
	  (RFC 5661) in the kernel's NFS client.
	  This option enables support for minor version 0 of the NFSv4 protocol
	  (RFC 3530) in the kernel's NFS client.

	  If unsure, say N.

config NFS_V4_2
	bool "NFS client support for NFSv4.2"
	depends on NFS_V4_1
	depends on NFS_V4
	help
	  This option enables support for minor version 2 of the NFSv4 protocol
	  in the kernel's NFS client.
@@ -117,22 +117,22 @@ config NFS_V4_2

config PNFS_FILE_LAYOUT
	tristate
	depends on NFS_V4_1
	depends on NFS_V4
	default NFS_V4

config PNFS_BLOCK
	tristate
	depends on NFS_V4_1 && BLK_DEV_DM
	depends on NFS_V4 && BLK_DEV_DM
	default NFS_V4

config PNFS_FLEXFILE_LAYOUT
	tristate
	depends on NFS_V4_1
	depends on NFS_V4
	default NFS_V4

config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
	string "NFSv4.1 Implementation ID Domain"
	depends on NFS_V4_1
	depends on NFS_V4
	default "kernel.org"
	help
	  This option defines the domain portion of the implementation ID that
@@ -144,7 +144,7 @@ config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN

config NFS_V4_1_MIGRATION
	bool "NFSv4.1 client support for migration"
	depends on NFS_V4_1
	depends on NFS_V4
	default n
	help
	  This option makes the NFS client advertise to NFSv4.1 servers that
+2 −2
Original line number Diff line number Diff line
@@ -27,10 +27,10 @@ CFLAGS_nfs4trace.o += -I$(src)
nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o \
	  delegation.o nfs4idmap.o callback.o callback_xdr.o callback_proc.o \
	  nfs4namespace.o nfs4getroot.o nfs4client.o nfs4session.o \
	  dns_resolve.o nfs4trace.o
	  dns_resolve.o nfs4trace.o pnfs.o pnfs_dev.o pnfs_nfs.o
nfsv4-$(CONFIG_NFS_USE_LEGACY_DNS) += cache_lib.o
nfsv4-$(CONFIG_SYSCTL)	+= nfs4sysctl.o
nfsv4-$(CONFIG_NFS_V4_1)	+= pnfs.o pnfs_dev.o pnfs_nfs.o
nfsv4-$(CONFIG_NFS_V4_0)	+= nfs40client.o nfs40proc.o
nfsv4-$(CONFIG_NFS_V4_2)	+= nfs42proc.o nfs42xattr.o

obj-$(CONFIG_PNFS_FILE_LAYOUT) += filelayout/
+1 −12
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ nfs4_callback_svc(void *vrqstp)
	return 0;
}

#if defined(CONFIG_NFS_V4_1)
static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
		struct svc_serv *serv)
{
@@ -98,12 +97,6 @@ static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
		 */
		xprt->bc_serv = serv;
}
#else
static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
		struct svc_serv *serv)
{
}
#endif /* CONFIG_NFS_V4_1 */

static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
				  struct svc_serv *serv)
@@ -157,7 +150,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
	}

	ret = 0;
	if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0)
	if (minorversion == 0)
		ret = nfs4_callback_up_net(serv, net);
	else if (xprt->ops->bc_setup)
		set_bc_enabled(serv);
@@ -198,10 +191,6 @@ static struct svc_serv *nfs_callback_create_svc(int minorversion)
			cb_info->users);

	threadfn = nfs4_callback_svc;
#if !defined(CONFIG_NFS_V4_1)
	if (minorversion)
		return ERR_PTR(-ENOTSUPP);
#endif
	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
			  threadfn);
	if (!serv) {
+0 −3
Original line number Diff line number Diff line
@@ -65,8 +65,6 @@ struct cb_recallargs {
	uint32_t truncate;
};

#if defined(CONFIG_NFS_V4_1)

struct referring_call {
	uint32_t			rc_sequenceid;
	uint32_t			rc_slotid;
@@ -168,7 +166,6 @@ struct cb_notify_lock_args {

extern __be32 nfs4_callback_notify_lock(void *argp, void *resp,
					 struct cb_process_state *cps);
#endif /* CONFIG_NFS_V4_1 */
#ifdef CONFIG_NFS_V4_2
struct cb_offloadargs {
	struct nfs_fh		coa_fh;
+9 −7
Original line number Diff line number Diff line
@@ -51,12 +51,18 @@ __be32 nfs4_callback_getattr(void *argp, void *resp,
				-ntohl(res->status));
		goto out;
	}
	rcu_read_lock();

	delegation = nfs4_get_valid_delegation(inode);
	if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
	if (!delegation)
		goto out_iput;
	res->size = i_size_read(inode);
	if ((delegation->type & FMODE_WRITE) == 0) {
		nfs_put_delegation(delegation);
		goto out_iput;
	}
	res->change_attr = delegation->change_attr;
	nfs_put_delegation(delegation);

	res->size = i_size_read(inode);
	if (nfs_have_writebacks(inode))
		res->change_attr++;
	res->atime = inode_get_atime(inode);
@@ -71,7 +77,6 @@ __be32 nfs4_callback_getattr(void *argp, void *resp,
			  FATTR4_WORD2_TIME_DELEG_MODIFY) & args->bitmap[2];
	res->status = 0;
out_iput:
	rcu_read_unlock();
	trace_nfs4_cb_getattr(cps->clp, &args->fh, inode, -ntohl(res->status));
	nfs_iput_and_deactive(inode);
out:
@@ -121,8 +126,6 @@ __be32 nfs4_callback_recall(void *argp, void *resp,
	return res;
}

#if defined(CONFIG_NFS_V4_1)

/*
 * Lookup a layout inode by stateid
 *
@@ -693,7 +696,6 @@ __be32 nfs4_callback_notify_lock(void *argp, void *resp,

	return htonl(NFS4_OK);
}
#endif /* CONFIG_NFS_V4_1 */
#ifdef CONFIG_NFS_V4_2
static void nfs4_copy_cb_args(struct nfs4_copy_state *cp_state,
				struct cb_offloadargs *args)
Loading