NFS client updates for Linux 4.17
Stable bugfixes: - xprtrdma: Fix corner cases when handling device removal # v4.12+ - xprtrdma: Fix latency regression on NUMA NFS/RDMA clients # v4.15+ Features: - New sunrpc tracepoint for RPC pings - Finer grained NFSv4 attribute checking - Don't unnecessarily return NFS v4 delegations Other bugfixes and cleanups: - Several other small NFSoRDMA cleanups - Improvements to the sunrpc RTT measurements - A few sunrpc tracepoint cleanups - Various fixes for NFS v4 lock notifications - Various sunrpc and NFS v4 XDR encoding cleanups - Switch to the ida_simple API - Fix NFSv4.1 exclusive create - Forget acl cache after setattr operation - Don't advance the nfs_entry readdir cookie if xdr decoding fails -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEnZ5MQTpR7cLU7KEp18tUv7ClQOsFAlrNG1IACgkQ18tUv7Cl QOvotw//fQoUgQ/AOJGlZo/4ws2mGJN3dfwwKM8xYOnHaxppOYubZRHwvswK8d22 +XR/Q6IVbUxI3mJluv1L0d9CJT06s3c9CO90McIJbk4CWihGP19bNIY4JiPlzrbv 4FDiyOvMBej2UXbHX5EzKj0srxyBoEVf3iUAIa6DaHi3c6EIUo6fP3d2eRNJStqd WMyZs+nqr2W9biyClxntT7l/Sk+o+4I7M3Oo9pjjS+PiePYdaMrL5T1kPeHaJshF GMGXkbvVdqpDRiXX84R9+2/nuSiA15eEnaR94UNvs84oLR3qob3ZhxhudqFdSPrX RS6E7m34gY/EaQm/wbB26PZm+3jHd4Pqm5SKLbyFfoCmG6oMwBvXNRJZas1DFaHM CMOECvfAr6kixVLkAN0MNQ2Ku/FuJ52OLP1dRLmxsblocnhEPujc6RSz6Ju/v3a0 adbpmJMA2IoSGgXMu3g1VGnjHfMj7ZmjtpigXVvlcUqQGCL7t4ngh23cpeTQeJ76 bMwSHUQu18NbmtJjBTE+PIm7mdCrpQD7ZuOPWpK62zxLYUnnv7nm75m84DrDru7d XAmrCmdUJNrVWQs6BAtCXgO4PZ6xNGLosb0xTQXTAQYftc+DRJ9SW/VGc0Mp1L9m 0G0iz++b8cy4Pih5UCDJcCkpjCIvHLcn72zn1kbufWqG3xr2koc= =IlWo -----END PGP SIGNATURE----- Merge tag 'nfs-for-4.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "Stable bugfixes: - xprtrdma: Fix corner cases when handling device removal # v4.12+ - xprtrdma: Fix latency regression on NUMA NFS/RDMA clients # v4.15+ Features: - New sunrpc tracepoint for RPC pings - Finer grained NFSv4 attribute checking - Don't unnecessarily return NFS v4 delegations Other bugfixes and cleanups: - Several other small NFSoRDMA cleanups - Improvements to the sunrpc RTT measurements - A few sunrpc tracepoint cleanups - Various fixes for NFS v4 lock notifications - Various sunrpc and NFS v4 XDR encoding cleanups - Switch to the ida_simple API - Fix NFSv4.1 exclusive create - Forget acl cache after setattr operation - Don't advance the nfs_entry readdir cookie if xdr decoding fails" * tag 'nfs-for-4.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (47 commits) NFS: advance nfs_entry cookie only after decoding completes successfully NFSv3/acl: forget acl cache after setattr NFSv4.1: Fix exclusive create NFSv4: Declare the size up to date after it was set. nfs: Use ida_simple API NFSv4: Fix the nfs_inode_set_delegation() arguments NFSv4: Clean up CB_GETATTR encoding NFSv4: Don't ask for attributes when ACCESS is protected by a delegation NFSv4: Add a helper to encode/decode struct timespec NFSv4: Clean up encode_attrs NFSv4; Clean up XDR encoding of type bitmap4 NFSv4: Allow GFP_NOIO sleeps in decode_attr_owner/decode_attr_group SUNRPC: Add a helper for encoding opaque data inline SUNRPC: Add helpers for decoding opaque and string types NFSv4: Ignore change attribute invalidations if we hold a delegation NFS: More fine grained attribute tracking NFS: Don't force unnecessary cache invalidation in nfs_update_inode() NFS: Don't redirty the attribute cache in nfs_wcc_update_inode() NFS: Don't force a revalidation of all attributes if change is missing NFS: Convert NFS_INO_INVALID flags to unsigned long ...
This commit is contained in:
commit
a1bf4c7da6
33 changed files with 866 additions and 493 deletions
|
|
@ -217,5 +217,12 @@ void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *);
|
|||
bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
|
||||
const struct sockaddr *sap);
|
||||
void rpc_cleanup_clids(void);
|
||||
|
||||
static inline int rpc_reply_expected(struct rpc_task *task)
|
||||
{
|
||||
return (task->tk_msg.rpc_proc != NULL) &&
|
||||
(task->tk_msg.rpc_proc->p_decode != NULL);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_SUNRPC_CLNT_H */
|
||||
|
|
|
|||
|
|
@ -253,6 +253,12 @@ xdr_stream_remaining(const struct xdr_stream *xdr)
|
|||
return xdr->nwords << 2;
|
||||
}
|
||||
|
||||
ssize_t xdr_stream_decode_opaque(struct xdr_stream *xdr, void *ptr,
|
||||
size_t size);
|
||||
ssize_t xdr_stream_decode_opaque_dup(struct xdr_stream *xdr, void **ptr,
|
||||
size_t maxlen, gfp_t gfp_flags);
|
||||
ssize_t xdr_stream_decode_string(struct xdr_stream *xdr, char *str,
|
||||
size_t size);
|
||||
ssize_t xdr_stream_decode_string_dup(struct xdr_stream *xdr, char **str,
|
||||
size_t maxlen, gfp_t gfp_flags);
|
||||
/**
|
||||
|
|
@ -312,6 +318,31 @@ xdr_stream_encode_u64(struct xdr_stream *xdr, __u64 n)
|
|||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* xdr_stream_encode_opaque_inline - Encode opaque xdr data
|
||||
* @xdr: pointer to xdr_stream
|
||||
* @ptr: pointer to void pointer
|
||||
* @len: size of object
|
||||
*
|
||||
* Return values:
|
||||
* On success, returns length in bytes of XDR buffer consumed
|
||||
* %-EMSGSIZE on XDR buffer overflow
|
||||
*/
|
||||
static inline ssize_t
|
||||
xdr_stream_encode_opaque_inline(struct xdr_stream *xdr, void **ptr, size_t len)
|
||||
{
|
||||
size_t count = sizeof(__u32) + xdr_align_size(len);
|
||||
__be32 *p = xdr_reserve_space(xdr, count);
|
||||
|
||||
if (unlikely(!p)) {
|
||||
*ptr = NULL;
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
xdr_encode_opaque(p, NULL, len);
|
||||
*ptr = ++p;
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* xdr_stream_encode_opaque_fixed - Encode fixed length opaque xdr data
|
||||
* @xdr: pointer to xdr_stream
|
||||
|
|
@ -355,6 +386,31 @@ xdr_stream_encode_opaque(struct xdr_stream *xdr, const void *ptr, size_t len)
|
|||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* xdr_stream_encode_uint32_array - Encode variable length array of integers
|
||||
* @xdr: pointer to xdr_stream
|
||||
* @array: array of integers
|
||||
* @array_size: number of elements in @array
|
||||
*
|
||||
* Return values:
|
||||
* On success, returns length in bytes of XDR buffer consumed
|
||||
* %-EMSGSIZE on XDR buffer overflow
|
||||
*/
|
||||
static inline ssize_t
|
||||
xdr_stream_encode_uint32_array(struct xdr_stream *xdr,
|
||||
const __u32 *array, size_t array_size)
|
||||
{
|
||||
ssize_t ret = (array_size+1) * sizeof(__u32);
|
||||
__be32 *p = xdr_reserve_space(xdr, ret);
|
||||
|
||||
if (unlikely(!p))
|
||||
return -EMSGSIZE;
|
||||
*p++ = cpu_to_be32(array_size);
|
||||
for (; array_size > 0; p++, array++, array_size--)
|
||||
*p = cpu_to_be32p(array);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* xdr_stream_decode_u32 - Decode a 32-bit integer
|
||||
* @xdr: pointer to xdr_stream
|
||||
|
|
@ -432,6 +488,44 @@ xdr_stream_decode_opaque_inline(struct xdr_stream *xdr, void **ptr, size_t maxle
|
|||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* xdr_stream_decode_uint32_array - Decode variable length array of integers
|
||||
* @xdr: pointer to xdr_stream
|
||||
* @array: location to store the integer array or NULL
|
||||
* @array_size: number of elements to store
|
||||
*
|
||||
* Return values:
|
||||
* On success, returns number of elements stored in @array
|
||||
* %-EBADMSG on XDR buffer overflow
|
||||
* %-EMSGSIZE if the size of the array exceeds @array_size
|
||||
*/
|
||||
static inline ssize_t
|
||||
xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
|
||||
__u32 *array, size_t array_size)
|
||||
{
|
||||
__be32 *p;
|
||||
__u32 len;
|
||||
ssize_t retval;
|
||||
|
||||
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
|
||||
return -EBADMSG;
|
||||
p = xdr_inline_decode(xdr, len * sizeof(*p));
|
||||
if (unlikely(!p))
|
||||
return -EBADMSG;
|
||||
if (array == NULL)
|
||||
return len;
|
||||
if (len <= array_size) {
|
||||
if (len < array_size)
|
||||
memset(array+len, 0, (array_size-len)*sizeof(*array));
|
||||
array_size = len;
|
||||
retval = len;
|
||||
} else
|
||||
retval = -EMSGSIZE;
|
||||
for (; array_size > 0; p++, array++, array_size--)
|
||||
*array = be32_to_cpup(p);
|
||||
return retval;
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _SUNRPC_XDR_H_ */
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ struct rpc_xprt {
|
|||
struct list_head free; /* free slots */
|
||||
unsigned int max_reqs; /* max number of slots */
|
||||
unsigned int min_reqs; /* min number of slots */
|
||||
atomic_t num_reqs; /* total slots */
|
||||
unsigned int num_reqs; /* total slots */
|
||||
unsigned long state; /* transport state */
|
||||
unsigned char resvport : 1; /* use a reserved port */
|
||||
atomic_t swapper; /* we're swapping over this
|
||||
|
|
@ -373,6 +373,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action);
|
|||
void xprt_write_space(struct rpc_xprt *xprt);
|
||||
void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result);
|
||||
struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
|
||||
void xprt_update_rtt(struct rpc_task *task);
|
||||
void xprt_complete_rqst(struct rpc_task *task, int copied);
|
||||
void xprt_pin_rqst(struct rpc_rqst *req);
|
||||
void xprt_unpin_rqst(struct rpc_rqst *req);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue