History

Merge tag 'nfs-for-5.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client updates from Trond Myklebust: "Highlights include: Stable fixes: - Fixes for NFS I/O request leakages - Fix error handling paths in the NFS I/O recoalescing code - Reinitialise NFSv4.1 sequence results before retransmitting a request - Fix a soft lockup in the delegation recovery code - Bulk destroy of layouts needs to be safe w.r.t. umount - Prevent thundering herd issues when the SUNRPC socket is not connected - Respect RPC call timeouts when retrying transmission Features: - Convert rpc auth layer to use xdr_streams - Config option to disable insecure RPCSEC_GSS crypto types - Reduce size of RPC receive buffers - Readdirplus optimization by cache mechanism - Convert SUNRPC socket send code to use iov_iter() - SUNRPC micro-optimisations to avoid indirect calls - Add support for the pNFS LAYOUTERROR operation and use it with the pNFS/flexfiles driver - Add trace events to report non-zero NFS status codes - Various removals of unnecessary dprintks Bugfixes and cleanups: - Fix a number of sparse warnings and documentation format warnings - Fix nfs_parse_devname to not modify it's argument - Fix potential corruption of page being written through pNFS/blocks - fix xfstest generic/099 failures on nfsv3 - Avoid NFSv4.1 "false retries" when RPC calls are interrupted - Abort I/O early if the pNFS/flexfiles layout segment was invalidated - Avoid unnecessary pNFS/flexfiles layout invalidations" * tag 'nfs-for-5.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (90 commits) SUNRPC: Take the transport send lock before binding+connecting SUNRPC: Micro-optimise when the task is known not to be sleeping SUNRPC: Check whether the task was transmitted before rebind/reconnect SUNRPC: Remove redundant calls to RPC_IS_QUEUED() SUNRPC: Clean up SUNRPC: Respect RPC call timeouts when retrying transmission SUNRPC: Fix up RPC back channel transmission SUNRPC: Prevent thundering herd when the socket is not connected SUNRPC: Allow dynamic allocation of back channel slots NFSv4.1: Bump the default callback session slot count to 16 SUNRPC: Convert remaining GFP_NOIO, and GFP_NOWAIT sites in sunrpc NFS/flexfiles: Clean up mirror DS initialisation NFS/flexfiles: Remove dead code in ff_layout_mirror_valid() NFS/flexfile: Simplify nfs4_ff_layout_select_ds_stateid() NFS/flexfile: Simplify nfs4_ff_layout_ds_version() NFS/flexfiles: Simplify ff_layout_get_ds_cred() NFS/flexfiles: Simplify nfs4_ff_find_or_create_ds_client() NFS/flexfiles: Simplify nfs4_ff_layout_select_ds_fh() NFS/flexfiles: Speed up read failover when DSes are down NFS/flexfiles: Don't invalidate DS deviceids for being unresponsive ...

Linus Torvalds committed 7 years ago

Commit 1fbf3e42 parents f88c594 4d6c67183 files · +3366 −2203Browse files

Showing the changes to include/linux (11 of 83 files). Show all

Unified · Split

11 files
  1. include/linux/nfs4.h +1 −0
  2. include/linux/nfs_fs_sb.h +1 −0
  3. include/linux/nfs_page.h +10 −0
  4. include/linux/nfs_xdr.h +36 −1
  5. include/linux/sunrpc/auth.h +26 −18
  6. include/linux/sunrpc/clnt.h +3 −0
  7. include/linux/sunrpc/gss_krb5_enctypes.h +41 −1
  8. include/linux/sunrpc/sched.h +9 −0
  9. include/linux/sunrpc/xdr.h +19 −4
  10. include/linux/sunrpc/xprt.h +0 −7
  11. include/linux/sunrpc/xprtsock.h +1 −0
include/linux/nfs4.h+1−0
@@ -538,6 +538,7 @@ enum { · 537 unmodified lines
538538 NFSPROC4_CLNT_OFFLOAD_CANCEL,
539539
540540 NFSPROC4_CLNT_LOOKUPP,
541+ NFSPROC4_CLNT_LAYOUTERROR,
541542 };
542543
543544 /* nfs41 types */
include/linux/nfs_fs_sb.h+1−0
@@ -261,5 +261,6 @@ struct nfs_server { · 260 unmodified lines
261261 #define NFS_CAP_CLONE (1U << 23)
262262 #define NFS_CAP_COPY (1U << 24)
263263 #define NFS_CAP_OFFLOAD_CANCEL (1U << 25)
264+#define NFS_CAP_LAYOUTERROR (1U << 26)
264265
265266 #endif
include/linux/nfs_page.h+10−0
@@ -164,6 +164,16 @@ nfs_list_add_request(struct nfs_page *req, struct list_head *head) · 163 unmodified lines
164164 list_add_tail(&req->wb_list, head);
165165 }
166166
167+/**
168+ * nfs_list_move_request - Move a request to a new list
169+ * @req: request
170+ * @head: head of list into which to insert the request.
171+ */
172+static inline void
173+nfs_list_move_request(struct nfs_page *req, struct list_head *head)
174+{
175+ list_move_tail(&req->wb_list, head);
176+}
167177
168178 /**
169179 * nfs_list_remove_request - Remove a request from its wb_list
include/linux/nfs_xdr.h+36−1
@@ -383,6 +383,41 @@ struct nfs42_layoutstat_data { · 382 unmodified lines
383383 struct nfs42_layoutstat_res res;
384384 };
385385
386+struct nfs42_device_error {
387+ struct nfs4_deviceid dev_id;
388+ int status;
389+ enum nfs_opnum4 opnum;
390+};
391+
392+struct nfs42_layout_error {
393+ __u64 offset;
394+ __u64 length;
395+ nfs4_stateid stateid;
396+ struct nfs42_device_error errors[1];
397+};
398+
399+#define NFS42_LAYOUTERROR_MAX 5
400+
401+struct nfs42_layouterror_args {
402+ struct nfs4_sequence_args seq_args;
403+ struct inode *inode;
404+ unsigned int num_errors;
405+ struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX];
406+};
407+
408+struct nfs42_layouterror_res {
409+ struct nfs4_sequence_res seq_res;
410+ unsigned int num_errors;
411+ int rpc_status;
412+};
413+
414+struct nfs42_layouterror_data {
415+ struct nfs42_layouterror_args args;
416+ struct nfs42_layouterror_res res;
417+ struct inode *inode;
418+ struct pnfs_layout_segment *lseg;
419+};
420+
386421 struct nfs42_clone_args {
387422 struct nfs4_sequence_args seq_args;
388423 struct nfs_fh *src_fh;
@@ -1549,7 +1584,7 @@ struct nfs_commit_data { · 1160 unmodified lines
15491584 };
15501585
15511586 struct nfs_pgio_completion_ops {
1552− void (*error_cleanup)(struct list_head *head);
1587+ void (*error_cleanup)(struct list_head *head, int);
15531588 void (*init_hdr)(struct nfs_pgio_header *hdr);
15541589 void (*completion)(struct nfs_pgio_header *hdr);
15551590 void (*reschedule_io)(struct nfs_pgio_header *hdr);
include/linux/sunrpc/auth.h+26−18
@@ -74,14 +74,12 @@ struct rpc_cred_cache; · 73 unmodified lines
7474 struct rpc_authops;
7575 struct rpc_auth {
7676 unsigned int au_cslack; /* call cred size estimate */
77− /* guess at number of u32's auth adds before
78− * reply data; normally the verifier size: */
79− unsigned int au_rslack;
80− /* for gss, used to calculate au_rslack: */
81− unsigned int au_verfsize;
82−
83− unsigned int au_flags; /* various flags */
84− const struct rpc_authops *au_ops; /* operations */
77+ unsigned int au_rslack; /* reply cred size estimate */
78+ unsigned int au_verfsize; /* size of reply verifier */
79+ unsigned int au_ralign; /* words before UL header */
80+
81+ unsigned int au_flags;
82+ const struct rpc_authops *au_ops;
8583 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
8684 * differ from the flavor in
8785 * au_ops->au_flavor in gss
@@ -131,13 +129,15 @@ struct rpc_credops { · 43 unmodified lines
131129 void (*crdestroy)(struct rpc_cred *);
132130
133131 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
134− __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
132+ int (*crmarshal)(struct rpc_task *task,
133+ struct xdr_stream *xdr);
135134 int (*crrefresh)(struct rpc_task *);
136− __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
137− int (*crwrap_req)(struct rpc_task *, kxdreproc_t,
138− void *, __be32 *, void *);
139− int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,
140− void *, __be32 *, void *);
135+ int (*crvalidate)(struct rpc_task *task,
136+ struct xdr_stream *xdr);
137+ int (*crwrap_req)(struct rpc_task *task,
138+ struct xdr_stream *xdr);
139+ int (*crunwrap_resp)(struct rpc_task *task,
140+ struct xdr_stream *xdr);
141141 int (*crkey_timeout)(struct rpc_cred *);
142142 char * (*crstringify_acceptor)(struct rpc_cred *);
143143 bool (*crneed_reencode)(struct rpc_task *);
@@ -165,10 +165,18 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * · 21 unmodified lines
165165 void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
166166 struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
167167 void put_rpccred(struct rpc_cred *);
168−__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
169−__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
170−int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj);
171−int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj);
168+int rpcauth_marshcred(struct rpc_task *task,
169+ struct xdr_stream *xdr);
170+int rpcauth_checkverf(struct rpc_task *task,
171+ struct xdr_stream *xdr);
172+int rpcauth_wrap_req_encode(struct rpc_task *task,
173+ struct xdr_stream *xdr);
174+int rpcauth_wrap_req(struct rpc_task *task,
175+ struct xdr_stream *xdr);
176+int rpcauth_unwrap_resp_decode(struct rpc_task *task,
177+ struct xdr_stream *xdr);
178+int rpcauth_unwrap_resp(struct rpc_task *task,
179+ struct xdr_stream *xdr);
172180 bool rpcauth_xmit_need_reencode(struct rpc_task *task);
173181 int rpcauth_refreshcred(struct rpc_task *);
174182 void rpcauth_invalcred(struct rpc_task *);
include/linux/sunrpc/clnt.h+3−0
@@ -169,6 +169,9 @@ int rpcb_v4_register(struct net *net, const u32 program, · 168 unmodified lines
169169 const char *netid);
170170 void rpcb_getport_async(struct rpc_task *);
171171
172+void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages,
173+ unsigned int base, unsigned int len,
174+ unsigned int hdrsize);
172175 void rpc_call_start(struct rpc_task *);
173176 int rpc_call_async(struct rpc_clnt *clnt,
174177 const struct rpc_message *msg, int flags,
include/linux/sunrpc/gss_krb5_enctypes.h+41−1
@@ -1,4 +1,44 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
2− * Dumb way to share this static piece of information with nfsd
3+ * Define the string that exports the set of kernel-supported
4+ * Kerberos enctypes. This list is sent via upcall to gssd, and
5+ * is also exposed via the nfsd /proc API. The consumers generally
6+ * treat this as an ordered list, where the first item in the list
7+ * is the most preferred.
8+ */
9+
10+#ifndef _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H
11+#define _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H
12+
13+#ifdef CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES
14+
15+/*
16+ * NB: This list includes encryption types that were deprecated
17+ * by RFC 8429 (DES3_CBC_SHA1 and ARCFOUR_HMAC).
18+ *
19+ * ENCTYPE_AES256_CTS_HMAC_SHA1_96
20+ * ENCTYPE_AES128_CTS_HMAC_SHA1_96
21+ * ENCTYPE_DES3_CBC_SHA1
22+ * ENCTYPE_ARCFOUR_HMAC
23+ */
24+#define KRB5_SUPPORTED_ENCTYPES "18,17,16,23"
25+
26+#else /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */
27+
28+/*
29+ * NB: This list includes encryption types that were deprecated
30+ * by RFC 8429 and RFC 6649.
31+ *
32+ * ENCTYPE_AES256_CTS_HMAC_SHA1_96
33+ * ENCTYPE_AES128_CTS_HMAC_SHA1_96
34+ * ENCTYPE_DES3_CBC_SHA1
35+ * ENCTYPE_ARCFOUR_HMAC
36+ * ENCTYPE_DES_CBC_MD5
37+ * ENCTYPE_DES_CBC_CRC
38+ * ENCTYPE_DES_CBC_MD4
339 */
440 #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2"
41+
42+#endif /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */
43+
44+#endif /* _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H */
include/linux/sunrpc/sched.h+9−0
@@ -97,6 +97,7 @@ typedef void (*rpc_action)(struct rpc_task *); · 96 unmodified lines
9797
9898 struct rpc_call_ops {
9999 void (*rpc_call_prepare)(struct rpc_task *, void *);
100+ void (*rpc_call_prepare_transmit)(struct rpc_task *, void *);
100101 void (*rpc_call_done)(struct rpc_task *, void *);
101102 void (*rpc_count_stats)(struct rpc_task *, void *);
102103 void (*rpc_release)(void *);
@@ -303,4 +304,12 @@ rpc_clnt_swap_deactivate(struct rpc_clnt *clnt) · 200 unmodified lines
303304 }
304305 #endif /* CONFIG_SUNRPC_SWAP */
305306
307+static inline bool
308+rpc_task_need_resched(const struct rpc_task *task)
309+{
310+ if (RPC_IS_QUEUED(task) || task->tk_callback)
311+ return true;
312+ return false;
313+}
314+
306315 #endif /* _LINUX_SUNRPC_SCHED_H_ */
include/linux/sunrpc/xdr.h+19−4
@@ -87,6 +87,16 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 86 unmodified lines
8787 #define xdr_one cpu_to_be32(1)
8888 #define xdr_two cpu_to_be32(2)
8989
90+#define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL)
91+#define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX)
92+#define rpc_auth_short cpu_to_be32(RPC_AUTH_SHORT)
93+#define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS)
94+
95+#define rpc_call cpu_to_be32(RPC_CALL)
96+#define rpc_reply cpu_to_be32(RPC_REPLY)
97+
98+#define rpc_msg_accepted cpu_to_be32(RPC_MSG_ACCEPTED)
99+
90100 #define rpc_success cpu_to_be32(RPC_SUCCESS)
91101 #define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL)
92102 #define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH)
@@ -95,6 +105,9 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines
95105 #define rpc_system_err cpu_to_be32(RPC_SYSTEM_ERR)
96106 #define rpc_drop_reply cpu_to_be32(RPC_DROP_REPLY)
97107
108+#define rpc_mismatch cpu_to_be32(RPC_MISMATCH)
109+#define rpc_auth_error cpu_to_be32(RPC_AUTH_ERROR)
110+
98111 #define rpc_auth_ok cpu_to_be32(RPC_AUTH_OK)
99112 #define rpc_autherr_badcred cpu_to_be32(RPC_AUTH_BADCRED)
100113 #define rpc_autherr_rejectedcred cpu_to_be32(RPC_AUTH_REJECTEDCRED)
@@ -103,7 +116,6 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines
103116 #define rpc_autherr_tooweak cpu_to_be32(RPC_AUTH_TOOWEAK)
104117 #define rpcsec_gsserr_credproblem cpu_to_be32(RPCSEC_GSS_CREDPROBLEM)
105118 #define rpcsec_gsserr_ctxproblem cpu_to_be32(RPCSEC_GSS_CTXPROBLEM)
106−#define rpc_autherr_oldseqnum cpu_to_be32(101)
107119
108120 /*
109121 * Miscellaneous XDR helper functions
@@ -167,7 +179,6 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) · 57 unmodified lines
167179 extern void xdr_shift_buf(struct xdr_buf *, size_t);
168180 extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
169181 extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
170−extern void xdr_buf_trim(struct xdr_buf *, unsigned int);
171182 extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int);
172183 extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
173184 extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
@@ -217,6 +228,8 @@ struct xdr_stream { · 43 unmodified lines
217228 struct kvec scratch; /* Scratch buffer */
218229 struct page **page_ptr; /* pointer to the current page */
219230 unsigned int nwords; /* Remaining decode buffer length */
231+
232+ struct rpc_rqst *rqst; /* For debugging */
220233 };
221234
222235 /*
@@ -227,7 +240,8 @@ typedef void (*kxdreproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr, · 4 unmodified lines
227240 typedef int (*kxdrdproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
228241 void *obj);
229242
230−extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
243+extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf,
244+ __be32 *p, struct rpc_rqst *rqst);
231245 extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
232246 extern void xdr_commit_encode(struct xdr_stream *xdr);
233247 extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len);
@@ -235,7 +249,8 @@ extern int xdr_restrict_buflen(struct xdr_stream *xdr, int newbuflen); · 1 unmodified line
235249 extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
236250 unsigned int base, unsigned int len);
237251 extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr);
238−extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
252+extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf,
253+ __be32 *p, struct rpc_rqst *rqst);
239254 extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf,
240255 struct page **pages, unsigned int len);
241256 extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen);
include/linux/sunrpc/xprt.h+0−7
@@ -196,8 +196,6 @@ struct rpc_xprt { · 195 unmodified lines
196196
197197 size_t max_payload; /* largest RPC payload size,
198198 in bytes */
199− unsigned int tsh_size; /* size of transport specific
200− header */
201199
202200 struct rpc_wait_queue binding; /* requests waiting on rpcbind */
203201 struct rpc_wait_queue sending; /* requests waiting to send */
@@ -362,11 +360,6 @@ struct rpc_xprt * xprt_alloc(struct net *net, size_t size, · 158 unmodified lines
362360 unsigned int max_req);
363361 void xprt_free(struct rpc_xprt *);
364362
365−static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
366−{
367− return p + xprt->tsh_size;
368−}
369−
370363 static inline int
371364 xprt_enable_swap(struct rpc_xprt *xprt)
372365 {
include/linux/sunrpc/xprtsock.h+1−0
@@ -26,6 +26,7 @@ struct sock_xprt { · 25 unmodified lines
2626 */
2727 struct socket * sock;
2828 struct sock * inet;
29+ struct file * file;
2930
3031 /*
3132 * State of TCP reply receive

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t