Skip to content

Commit 6f83e5b

Browse files
committed
Merge tag 'nfs-for-3.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights incluse: Features: - Removing the forced serialisation of open()/close() calls in NFSv4.x (x>0) makes for a significant performance improvement in metadata intensive workloads. - Full support for the pNFS "flexible files" layout type - Further RPC/RDMA client improvements from Chuck Bugfixes: - Stable fix: NFSv4.1 backchannel calls blocking operations with !TASK_RUNNING - Stable fix: pnfs_generic_pg_init_read/write can be called with lseg == NULL - Stable fix: Fix an Oopsable condition when nsm_mon_unmon is called as part of the namespace cleanup, - Stable fix: Ensure we reference the inode for return-on-close in delegreturn - Use SO_REUSEPORT to ensure that NFSv3 TCP connections can rebind to the same source address/port combination during a disconnect/ reconnect event. This is a requirement imposed by most NFSv3 server duplicate reply cache implementations. Optimisations: - Ask for no NFSv4.1 delegations on OPEN if using O_DIRECT Other: - Add Anna Schumaker as co-maintainer for the NFS client" * tag 'nfs-for-3.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (119 commits) SUNRPC: Cleanup to remove xs_tcp_close() pnfs: delete an unintended goto pnfs/flexfiles: Do not dprintk after the free SUNRPC: Fix stupid typo in xs_sock_set_reuseport SUNRPC: Define xs_tcp_fin_timeout only if CONFIG_SUNRPC_DEBUG SUNRPC: Handle connection reset more efficiently. SUNRPC: Remove the redundant XPRT_CONNECTION_CLOSE flag SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release SUNRPC: Ensure xs_tcp_shutdown() requests a full close of the connection SUNRPC: Cleanup to remove remaining uses of XPRT_CONNECTION_ABORT SUNRPC: Remove TCP socket linger code SUNRPC: Remove TCP client connection reset hack SUNRPC: TCP/UDP always close the old socket before reconnecting SUNRPC: Add helpers to prevent socket create from racing SUNRPC: Ensure xs_reset_transport() resets the close connection flags SUNRPC: Do not clear the source port in xs_reset_transport SUNRPC: Handle EADDRINUSE on connect SUNRPC: Set SO_REUSEPORT socket option for TCP connections NFSv4.1: Fix pnfs_put_lseg races NFSv4.1: pnfs_send_layoutreturn should use GFP_NOFS ...
2 parents 73b4f63 + c627d31 commit 6f83e5b

60 files changed

Lines changed: 5236 additions & 1729 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/nfs/pnfs.txt‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ bit is set, preventing any new lsegs from being added.
5757
layout drivers
5858
--------------
5959

60-
PNFS utilizes what is called layout drivers. The STD defines 3 basic
61-
layout types: "files" "objects" and "blocks". For each of these types
62-
there is a layout-driver with a common function-vectors table which
63-
are called by the nfs-client pnfs-core to implement the different layout
64-
types.
60+
PNFS utilizes what is called layout drivers. The STD defines 4 basic
61+
layout types: "files", "objects", "blocks", and "flexfiles". For each
62+
of these types there is a layout-driver with a common function-vectors
63+
table which are called by the nfs-client pnfs-core to implement the
64+
different layout types.
6565

66-
Files-layout-driver code is in: fs/nfs/nfs4filelayout.c && nfs4filelayoutdev.c
66+
Files-layout-driver code is in: fs/nfs/filelayout/.. directory
6767
Objects-layout-deriver code is in: fs/nfs/objlayout/.. directory
6868
Blocks-layout-deriver code is in: fs/nfs/blocklayout/.. directory
69+
Flexfiles-layout-driver code is in: fs/nfs/flexfilelayout/.. directory
6970

7071
objects-layout setup
7172
--------------------

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6777,6 +6777,7 @@ F: Documentation/devicetree/bindings/net/nfc/
67776777

67786778
NFS, SUNRPC, AND LOCKD CLIENTS
67796779
M: Trond Myklebust <trond.myklebust@primarydata.com>
6780+
M: Anna Schumaker <anna.schumaker@netapp.com>
67806781
L: linux-nfs@vger.kernel.org
67816782
W: http://client.linux-nfs.org
67826783
T: git git://git.linux-nfs.org/projects/trondmy/linux-nfs.git

‎fs/lockd/mon.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
6565
return (struct sockaddr *)&nsm->sm_addr;
6666
}
6767

68-
static struct rpc_clnt *nsm_create(struct net *net)
68+
static struct rpc_clnt *nsm_create(struct net *net, const char *nodename)
6969
{
7070
struct sockaddr_in sin = {
7171
.sin_family = AF_INET,
@@ -77,6 +77,7 @@ static struct rpc_clnt *nsm_create(struct net *net)
7777
.address = (struct sockaddr *)&sin,
7878
.addrsize = sizeof(sin),
7979
.servername = "rpc.statd",
80+
.nodename = nodename,
8081
.program = &nsm_program,
8182
.version = NSM_VERSION,
8283
.authflavor = RPC_AUTH_NULL,
@@ -102,7 +103,7 @@ static struct rpc_clnt *nsm_client_set(struct lockd_net *ln,
102103
return clnt;
103104
}
104105

105-
static struct rpc_clnt *nsm_client_get(struct net *net)
106+
static struct rpc_clnt *nsm_client_get(struct net *net, const char *nodename)
106107
{
107108
struct rpc_clnt *clnt, *new;
108109
struct lockd_net *ln = net_generic(net, lockd_net_id);
@@ -111,7 +112,7 @@ static struct rpc_clnt *nsm_client_get(struct net *net)
111112
if (clnt != NULL)
112113
goto out;
113114

114-
clnt = new = nsm_create(net);
115+
clnt = new = nsm_create(net, nodename);
115116
if (IS_ERR(clnt))
116117
goto out;
117118

@@ -190,19 +191,23 @@ int nsm_monitor(const struct nlm_host *host)
190191
struct nsm_res res;
191192
int status;
192193
struct rpc_clnt *clnt;
194+
const char *nodename = NULL;
193195

194196
dprintk("lockd: nsm_monitor(%s)\n", nsm->sm_name);
195197

196198
if (nsm->sm_monitored)
197199
return 0;
198200

201+
if (host->h_rpcclnt)
202+
nodename = host->h_rpcclnt->cl_nodename;
203+
199204
/*
200205
* Choose whether to record the caller_name or IP address of
201206
* this peer in the local rpc.statd's database.
202207
*/
203208
nsm->sm_mon_name = nsm_use_hostnames ? nsm->sm_name : nsm->sm_addrbuf;
204209

205-
clnt = nsm_client_get(host->net);
210+
clnt = nsm_client_get(host->net, nodename);
206211
if (IS_ERR(clnt)) {
207212
status = PTR_ERR(clnt);
208213
dprintk("lockd: failed to create NSM upcall transport, "

‎fs/nfs/Kconfig‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ config PNFS_OBJLAYOUT
128128
depends on NFS_V4_1 && SCSI_OSD_ULD
129129
default NFS_V4
130130

131+
config PNFS_FLEXFILE_LAYOUT
132+
tristate
133+
depends on NFS_V4_1 && NFS_V3
134+
default m
135+
131136
config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
132137
string "NFSv4.1 Implementation ID Domain"
133138
depends on NFS_V4_1

‎fs/nfs/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o
2727
dns_resolve.o nfs4trace.o
2828
nfsv4-$(CONFIG_NFS_USE_LEGACY_DNS) += cache_lib.o
2929
nfsv4-$(CONFIG_SYSCTL) += nfs4sysctl.o
30-
nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o
30+
nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o pnfs_nfs.o
3131
nfsv4-$(CONFIG_NFS_V4_2) += nfs42proc.o
3232

3333
obj-$(CONFIG_PNFS_FILE_LAYOUT) += filelayout/
3434
obj-$(CONFIG_PNFS_OBJLAYOUT) += objlayout/
3535
obj-$(CONFIG_PNFS_BLOCK) += blocklayout/
36+
obj-$(CONFIG_PNFS_FLEXFILE_LAYOUT) += flexfilelayout/

‎fs/nfs/blocklayout/blocklayout.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,12 +860,14 @@ static const struct nfs_pageio_ops bl_pg_read_ops = {
860860
.pg_init = bl_pg_init_read,
861861
.pg_test = bl_pg_test_read,
862862
.pg_doio = pnfs_generic_pg_readpages,
863+
.pg_cleanup = pnfs_generic_pg_cleanup,
863864
};
864865

865866
static const struct nfs_pageio_ops bl_pg_write_ops = {
866867
.pg_init = bl_pg_init_write,
867868
.pg_test = bl_pg_test_write,
868869
.pg_doio = pnfs_generic_pg_writepages,
870+
.pg_cleanup = pnfs_generic_pg_cleanup,
869871
};
870872

871873
static struct pnfs_layoutdriver_type blocklayout_type = {

‎fs/nfs/callback.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,24 @@ nfs41_callback_svc(void *vrqstp)
128128
if (try_to_freeze())
129129
continue;
130130

131-
prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE);
131+
prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_UNINTERRUPTIBLE);
132132
spin_lock_bh(&serv->sv_cb_lock);
133133
if (!list_empty(&serv->sv_cb_list)) {
134134
req = list_first_entry(&serv->sv_cb_list,
135135
struct rpc_rqst, rq_bc_list);
136136
list_del(&req->rq_bc_list);
137137
spin_unlock_bh(&serv->sv_cb_lock);
138+
finish_wait(&serv->sv_cb_waitq, &wq);
138139
dprintk("Invoking bc_svc_process()\n");
139140
error = bc_svc_process(serv, req, rqstp);
140141
dprintk("bc_svc_process() returned w/ error code= %d\n",
141142
error);
142143
} else {
143144
spin_unlock_bh(&serv->sv_cb_lock);
144-
schedule();
145+
/* schedule_timeout to game the hung task watchdog */
146+
schedule_timeout(60 * HZ);
147+
finish_wait(&serv->sv_cb_waitq, &wq);
145148
}
146-
finish_wait(&serv->sv_cb_waitq, &wq);
147149
}
148150
return 0;
149151
}

‎fs/nfs/delegation.c‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,17 @@ nfs_inode_detach_delegation(struct inode *inode)
306306
return nfs_detach_delegation(nfsi, delegation, server);
307307
}
308308

309+
static void
310+
nfs_update_inplace_delegation(struct nfs_delegation *delegation,
311+
const struct nfs_delegation *update)
312+
{
313+
if (nfs4_stateid_is_newer(&update->stateid, &delegation->stateid)) {
314+
delegation->stateid.seqid = update->stateid.seqid;
315+
smp_wmb();
316+
delegation->type = update->type;
317+
}
318+
}
319+
309320
/**
310321
* nfs_inode_set_delegation - set up a delegation on an inode
311322
* @inode: inode to which delegation applies
@@ -339,9 +350,12 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
339350
old_delegation = rcu_dereference_protected(nfsi->delegation,
340351
lockdep_is_held(&clp->cl_lock));
341352
if (old_delegation != NULL) {
342-
if (nfs4_stateid_match(&delegation->stateid,
343-
&old_delegation->stateid) &&
344-
delegation->type == old_delegation->type) {
353+
/* Is this an update of the existing delegation? */
354+
if (nfs4_stateid_match_other(&old_delegation->stateid,
355+
&delegation->stateid)) {
356+
nfs_update_inplace_delegation(old_delegation,
357+
delegation);
358+
nfsi->delegation_state = old_delegation->type;
345359
goto out;
346360
}
347361
/*

0 commit comments

Comments
 (0)