mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
Merge tag 'nfs-for-5.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client updates from Anna Schumaker: "New Features: - Better client responsiveness when server isn't replying - Use refcount_t in sunrpc rpc_client refcount tracking - Add srcaddr and dst_port to the sunrpc sysfs info files - Add basic support for connection sharing between servers with multiple NICs` Bugfixes and Cleanups: - Sunrpc tracepoint cleanups - Disconnect after ib_post_send() errors to avoid deadlocks - Fix for tearing down rpcrdma_reps - Fix a potential pNFS layoutget livelock loop - pNFS layout barrier fixes - Fix a potential memory corruption in rpc_wake_up_queued_task_set_status() - Fix reconnection locking - Fix return value of get_srcport() - Remove rpcrdma_post_sends() - Remove pNFS dead code - Remove copy size restriction for inter-server copies - Overhaul the NFS callback service - Clean up sunrpc TCP socket shutdowns - Always provide aligned buffers to RPC read layers" * tag 'nfs-for-5.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (39 commits) NFS: Always provide aligned buffers to the RPC read layers NFSv4.1 add network transport when session trunking is detected SUNRPC enforce creation of no more than max_connect xprts NFSv4 introduce max_connect mount options SUNRPC add xps_nunique_destaddr_xprts to xprt_switch_info in sysfs SUNRPC keep track of number of transports to unique addresses NFSv3: Delete duplicate judgement in nfs3_async_handle_jukebox SUNRPC: Tweak TCP socket shutdown in the RPC client SUNRPC: Simplify socket shutdown when not reusing TCP ports NFSv4.2: remove restriction of copy size for inter-server copy. NFS: Clean up the synopsis of callback process_op() NFS: Extract the xdr_init_encode/decode() calls from decode_compound NFS: Remove unused callback void decoder NFS: Add a private local dispatcher for NFSv4 callback operations SUNRPC: Eliminate the RQ_AUTHERR flag SUNRPC: Set rq_auth_stat in the pg_authenticate() callout SUNRPC: Add svc_rqst::rq_auth_stat SUNRPC: Add dst_port to the sysfs xprt info file SUNRPC: Add srcaddr as a file in sysfs sunrpc: Fix return value of get_srcport() ...
This commit is contained in:
@@ -649,6 +649,7 @@ static int lockd_authenticate(struct svc_rqst *rqstp)
|
||||
switch (rqstp->rq_authop->flavour) {
|
||||
case RPC_AUTH_NULL:
|
||||
case RPC_AUTH_UNIX:
|
||||
rqstp->rq_auth_stat = rpc_auth_ok;
|
||||
if (rqstp->rq_proc == 0)
|
||||
return SVC_OK;
|
||||
if (is_callback(rqstp->rq_proc)) {
|
||||
@@ -659,6 +660,7 @@ static int lockd_authenticate(struct svc_rqst *rqstp)
|
||||
}
|
||||
return svc_set_client(rqstp);
|
||||
}
|
||||
rqstp->rq_auth_stat = rpc_autherr_badcred;
|
||||
return SVC_DENIED;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,6 +429,8 @@ check_gss_callback_principal(struct nfs_client *clp, struct svc_rqst *rqstp)
|
||||
*/
|
||||
static int nfs_callback_authenticate(struct svc_rqst *rqstp)
|
||||
{
|
||||
rqstp->rq_auth_stat = rpc_autherr_badcred;
|
||||
|
||||
switch (rqstp->rq_authop->flavour) {
|
||||
case RPC_AUTH_NULL:
|
||||
if (rqstp->rq_proc != CB_NULL)
|
||||
@@ -439,6 +441,8 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
|
||||
if (svc_is_backchannel(rqstp))
|
||||
return SVC_DENIED;
|
||||
}
|
||||
|
||||
rqstp->rq_auth_stat = rpc_auth_ok;
|
||||
return SVC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,11 +63,10 @@ static __be32 nfs4_callback_null(struct svc_rqst *rqstp)
|
||||
return htonl(NFS4_OK);
|
||||
}
|
||||
|
||||
static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
return xdr_argsize_check(rqstp, p);
|
||||
}
|
||||
|
||||
/*
|
||||
* svc_process_common() looks for an XDR encoder to know when
|
||||
* not to drop a Reply.
|
||||
*/
|
||||
static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
return xdr_ressize_check(rqstp, p);
|
||||
@@ -864,17 +863,16 @@ preprocess_nfs4_op(unsigned int op_nr, struct callback_op **op)
|
||||
}
|
||||
|
||||
static __be32 process_op(int nop, struct svc_rqst *rqstp,
|
||||
struct xdr_stream *xdr_in, void *argp,
|
||||
struct xdr_stream *xdr_out, void *resp,
|
||||
struct cb_process_state *cps)
|
||||
struct cb_process_state *cps)
|
||||
{
|
||||
struct xdr_stream *xdr_out = &rqstp->rq_res_stream;
|
||||
struct callback_op *op = &callback_ops[0];
|
||||
unsigned int op_nr;
|
||||
__be32 status;
|
||||
long maxlen;
|
||||
__be32 res;
|
||||
|
||||
status = decode_op_hdr(xdr_in, &op_nr);
|
||||
status = decode_op_hdr(&rqstp->rq_arg_stream, &op_nr);
|
||||
if (unlikely(status))
|
||||
return status;
|
||||
|
||||
@@ -904,9 +902,11 @@ static __be32 process_op(int nop, struct svc_rqst *rqstp,
|
||||
|
||||
maxlen = xdr_out->end - xdr_out->p;
|
||||
if (maxlen > 0 && maxlen < PAGE_SIZE) {
|
||||
status = op->decode_args(rqstp, xdr_in, argp);
|
||||
status = op->decode_args(rqstp, &rqstp->rq_arg_stream,
|
||||
rqstp->rq_argp);
|
||||
if (likely(status == 0))
|
||||
status = op->process_op(argp, resp, cps);
|
||||
status = op->process_op(rqstp->rq_argp, rqstp->rq_resp,
|
||||
cps);
|
||||
} else
|
||||
status = htonl(NFS4ERR_RESOURCE);
|
||||
|
||||
@@ -915,7 +915,7 @@ encode_hdr:
|
||||
if (unlikely(res))
|
||||
return res;
|
||||
if (op->encode_res != NULL && status == 0)
|
||||
status = op->encode_res(rqstp, xdr_out, resp);
|
||||
status = op->encode_res(rqstp, xdr_out, rqstp->rq_resp);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -926,22 +926,15 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp)
|
||||
{
|
||||
struct cb_compound_hdr_arg hdr_arg = { 0 };
|
||||
struct cb_compound_hdr_res hdr_res = { NULL };
|
||||
struct xdr_stream xdr_in, xdr_out;
|
||||
__be32 *p, status;
|
||||
struct cb_process_state cps = {
|
||||
.drc_status = 0,
|
||||
.clp = NULL,
|
||||
.net = SVC_NET(rqstp),
|
||||
};
|
||||
unsigned int nops = 0;
|
||||
__be32 status;
|
||||
|
||||
xdr_init_decode(&xdr_in, &rqstp->rq_arg,
|
||||
rqstp->rq_arg.head[0].iov_base, NULL);
|
||||
|
||||
p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
|
||||
xdr_init_encode(&xdr_out, &rqstp->rq_res, p, NULL);
|
||||
|
||||
status = decode_compound_hdr_arg(&xdr_in, &hdr_arg);
|
||||
status = decode_compound_hdr_arg(&rqstp->rq_arg_stream, &hdr_arg);
|
||||
if (status == htonl(NFS4ERR_RESOURCE))
|
||||
return rpc_garbage_args;
|
||||
|
||||
@@ -961,15 +954,13 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp)
|
||||
cps.minorversion = hdr_arg.minorversion;
|
||||
hdr_res.taglen = hdr_arg.taglen;
|
||||
hdr_res.tag = hdr_arg.tag;
|
||||
if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0) {
|
||||
if (encode_compound_hdr_res(&rqstp->rq_res_stream, &hdr_res) != 0) {
|
||||
if (cps.clp)
|
||||
nfs_put_client(cps.clp);
|
||||
return rpc_system_err;
|
||||
}
|
||||
while (status == 0 && nops != hdr_arg.nops) {
|
||||
status = process_op(nops, rqstp, &xdr_in,
|
||||
rqstp->rq_argp, &xdr_out, rqstp->rq_resp,
|
||||
&cps);
|
||||
status = process_op(nops, rqstp, &cps);
|
||||
nops++;
|
||||
}
|
||||
|
||||
@@ -988,7 +979,20 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp)
|
||||
|
||||
out_invalidcred:
|
||||
pr_warn_ratelimited("NFS: NFSv4 callback contains invalid cred\n");
|
||||
return svc_return_autherr(rqstp, rpc_autherr_badcred);
|
||||
rqstp->rq_auth_stat = rpc_autherr_badcred;
|
||||
return rpc_success;
|
||||
}
|
||||
|
||||
static int
|
||||
nfs_callback_dispatch(struct svc_rqst *rqstp, __be32 *statp)
|
||||
{
|
||||
const struct svc_procedure *procp = rqstp->rq_procinfo;
|
||||
|
||||
svcxdr_init_decode(rqstp);
|
||||
svcxdr_init_encode(rqstp);
|
||||
|
||||
*statp = procp->pc_func(rqstp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1057,7 +1061,6 @@ static struct callback_op callback_ops[] = {
|
||||
static const struct svc_procedure nfs4_callback_procedures1[] = {
|
||||
[CB_NULL] = {
|
||||
.pc_func = nfs4_callback_null,
|
||||
.pc_decode = nfs4_decode_void,
|
||||
.pc_encode = nfs4_encode_void,
|
||||
.pc_xdrressize = 1,
|
||||
.pc_name = "NULL",
|
||||
@@ -1079,7 +1082,7 @@ const struct svc_version nfs4_callback_version1 = {
|
||||
.vs_proc = nfs4_callback_procedures1,
|
||||
.vs_count = nfs4_callback_count1,
|
||||
.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
|
||||
.vs_dispatch = NULL,
|
||||
.vs_dispatch = nfs_callback_dispatch,
|
||||
.vs_hidden = true,
|
||||
.vs_need_cong_ctrl = true,
|
||||
};
|
||||
@@ -1091,7 +1094,7 @@ const struct svc_version nfs4_callback_version4 = {
|
||||
.vs_proc = nfs4_callback_procedures1,
|
||||
.vs_count = nfs4_callback_count4,
|
||||
.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
|
||||
.vs_dispatch = NULL,
|
||||
.vs_dispatch = nfs_callback_dispatch,
|
||||
.vs_hidden = true,
|
||||
.vs_need_cong_ctrl = true,
|
||||
};
|
||||
|
||||
@@ -179,6 +179,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
|
||||
|
||||
clp->cl_proto = cl_init->proto;
|
||||
clp->cl_nconnect = cl_init->nconnect;
|
||||
clp->cl_max_connect = cl_init->max_connect ? cl_init->max_connect : 1;
|
||||
clp->cl_net = get_net(cl_init->net);
|
||||
|
||||
clp->cl_principal = "*";
|
||||
@@ -540,6 +541,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
|
||||
|
||||
clnt->cl_principal = clp->cl_principal;
|
||||
clp->cl_rpcclient = clnt;
|
||||
clnt->cl_max_connect = clp->cl_max_connect;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_create_rpc_client);
|
||||
|
||||
@@ -60,6 +60,7 @@ enum nfs_param {
|
||||
Opt_mountvers,
|
||||
Opt_namelen,
|
||||
Opt_nconnect,
|
||||
Opt_max_connect,
|
||||
Opt_port,
|
||||
Opt_posix,
|
||||
Opt_proto,
|
||||
@@ -158,6 +159,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = {
|
||||
fsparam_u32 ("mountvers", Opt_mountvers),
|
||||
fsparam_u32 ("namlen", Opt_namelen),
|
||||
fsparam_u32 ("nconnect", Opt_nconnect),
|
||||
fsparam_u32 ("max_connect", Opt_max_connect),
|
||||
fsparam_string("nfsvers", Opt_vers),
|
||||
fsparam_u32 ("port", Opt_port),
|
||||
fsparam_flag_no("posix", Opt_posix),
|
||||
@@ -770,6 +772,11 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
|
||||
goto out_of_bounds;
|
||||
ctx->nfs_server.nconnect = result.uint_32;
|
||||
break;
|
||||
case Opt_max_connect:
|
||||
if (result.uint_32 < 1 || result.uint_32 > NFS_MAX_TRANSPORTS)
|
||||
goto out_of_bounds;
|
||||
ctx->nfs_server.max_connect = result.uint_32;
|
||||
break;
|
||||
case Opt_lookupcache:
|
||||
switch (result.uint_32) {
|
||||
case Opt_lookupcache_all:
|
||||
|
||||
@@ -67,6 +67,7 @@ struct nfs_client_initdata {
|
||||
int proto;
|
||||
u32 minorversion;
|
||||
unsigned int nconnect;
|
||||
unsigned int max_connect;
|
||||
struct net *net;
|
||||
const struct rpc_timeout *timeparms;
|
||||
const struct cred *cred;
|
||||
@@ -121,6 +122,7 @@ struct nfs_fs_context {
|
||||
int port;
|
||||
unsigned short protocol;
|
||||
unsigned short nconnect;
|
||||
unsigned short max_connect;
|
||||
unsigned short export_path_len;
|
||||
} nfs_server;
|
||||
|
||||
|
||||
@@ -49,8 +49,7 @@ nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode)
|
||||
{
|
||||
if (task->tk_status != -EJUKEBOX)
|
||||
return 0;
|
||||
if (task->tk_status == -EJUKEBOX)
|
||||
nfs_inc_stats(inode, NFSIOS_DELAY);
|
||||
nfs_inc_stats(inode, NFSIOS_DELAY);
|
||||
task->tk_status = 0;
|
||||
rpc_restart_call(task);
|
||||
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
|
||||
|
||||
@@ -402,6 +402,33 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp)
|
||||
return nfs4_init_callback(clp);
|
||||
}
|
||||
|
||||
static void nfs4_add_trunk(struct nfs_client *clp, struct nfs_client *old)
|
||||
{
|
||||
struct sockaddr_storage clp_addr, old_addr;
|
||||
struct sockaddr *clp_sap = (struct sockaddr *)&clp_addr;
|
||||
struct sockaddr *old_sap = (struct sockaddr *)&old_addr;
|
||||
size_t clp_salen;
|
||||
struct xprt_create xprt_args = {
|
||||
.ident = old->cl_proto,
|
||||
.net = old->cl_net,
|
||||
.servername = old->cl_hostname,
|
||||
};
|
||||
|
||||
if (clp->cl_proto != old->cl_proto)
|
||||
return;
|
||||
clp_salen = rpc_peeraddr(clp->cl_rpcclient, clp_sap, sizeof(clp_addr));
|
||||
rpc_peeraddr(old->cl_rpcclient, old_sap, sizeof(old_addr));
|
||||
|
||||
if (clp_addr.ss_family != old_addr.ss_family)
|
||||
return;
|
||||
|
||||
xprt_args.dstaddr = clp_sap;
|
||||
xprt_args.addrlen = clp_salen;
|
||||
|
||||
rpc_clnt_add_xprt(old->cl_rpcclient, &xprt_args,
|
||||
rpc_clnt_test_and_add_xprt, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* nfs4_init_client - Initialise an NFS4 client record
|
||||
*
|
||||
@@ -436,6 +463,8 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
|
||||
* won't try to use it.
|
||||
*/
|
||||
nfs_mark_client_ready(clp, -EPERM);
|
||||
if (old->cl_mvops->session_trunk)
|
||||
nfs4_add_trunk(clp, old);
|
||||
}
|
||||
clear_bit(NFS_CS_TSM_POSSIBLE, &clp->cl_flags);
|
||||
nfs_put_client(clp);
|
||||
@@ -865,6 +894,7 @@ static int nfs4_set_client(struct nfs_server *server,
|
||||
const char *ip_addr,
|
||||
int proto, const struct rpc_timeout *timeparms,
|
||||
u32 minorversion, unsigned int nconnect,
|
||||
unsigned int max_connect,
|
||||
struct net *net)
|
||||
{
|
||||
struct nfs_client_initdata cl_init = {
|
||||
@@ -883,6 +913,8 @@ static int nfs4_set_client(struct nfs_server *server,
|
||||
|
||||
if (minorversion == 0)
|
||||
__set_bit(NFS_CS_REUSEPORT, &cl_init.init_flags);
|
||||
else
|
||||
cl_init.max_connect = max_connect;
|
||||
if (proto == XPRT_TRANSPORT_TCP)
|
||||
cl_init.nconnect = nconnect;
|
||||
|
||||
@@ -952,8 +984,10 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
|
||||
return ERR_PTR(-EINVAL);
|
||||
cl_init.hostname = buf;
|
||||
|
||||
if (mds_clp->cl_nconnect > 1 && ds_proto == XPRT_TRANSPORT_TCP)
|
||||
if (mds_clp->cl_nconnect > 1 && ds_proto == XPRT_TRANSPORT_TCP) {
|
||||
cl_init.nconnect = mds_clp->cl_nconnect;
|
||||
cl_init.max_connect = NFS_MAX_TRANSPORTS;
|
||||
}
|
||||
|
||||
if (mds_srv->flags & NFS_MOUNT_NORESVPORT)
|
||||
__set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
|
||||
@@ -1122,6 +1156,7 @@ static int nfs4_init_server(struct nfs_server *server, struct fs_context *fc)
|
||||
&timeparms,
|
||||
ctx->minorversion,
|
||||
ctx->nfs_server.nconnect,
|
||||
ctx->nfs_server.max_connect,
|
||||
fc->net_ns);
|
||||
if (error < 0)
|
||||
return error;
|
||||
@@ -1211,6 +1246,7 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
|
||||
parent_server->client->cl_timeout,
|
||||
parent_client->cl_mvops->minor_version,
|
||||
parent_client->cl_nconnect,
|
||||
parent_client->cl_max_connect,
|
||||
parent_client->cl_net);
|
||||
if (!error)
|
||||
goto init_server;
|
||||
@@ -1226,6 +1262,7 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
|
||||
parent_server->client->cl_timeout,
|
||||
parent_client->cl_mvops->minor_version,
|
||||
parent_client->cl_nconnect,
|
||||
parent_client->cl_max_connect,
|
||||
parent_client->cl_net);
|
||||
if (error < 0)
|
||||
goto error;
|
||||
@@ -1323,7 +1360,7 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
|
||||
error = nfs4_set_client(server, hostname, sap, salen, buf,
|
||||
clp->cl_proto, clnt->cl_timeout,
|
||||
clp->cl_minorversion,
|
||||
clp->cl_nconnect, net);
|
||||
clp->cl_nconnect, clp->cl_max_connect, net);
|
||||
clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status);
|
||||
if (error != 0) {
|
||||
nfs_server_insert_lists(server);
|
||||
|
||||
@@ -158,13 +158,11 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
|
||||
sync = true;
|
||||
retry:
|
||||
if (!nfs42_files_from_same_server(file_in, file_out)) {
|
||||
/* for inter copy, if copy size if smaller than 12 RPC
|
||||
* payloads, fallback to traditional copy. There are
|
||||
* 14 RPCs during an NFSv4.x mount between source/dest
|
||||
* servers.
|
||||
/*
|
||||
* for inter copy, if copy size is too small
|
||||
* then fallback to generic copy.
|
||||
*/
|
||||
if (sync ||
|
||||
count <= 14 * NFS_SERVER(file_inode(file_in))->rsize)
|
||||
if (sync)
|
||||
return -EOPNOTSUPP;
|
||||
cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res),
|
||||
GFP_NOFS);
|
||||
|
||||
@@ -335,7 +335,7 @@ static bool pnfs_seqid_is_newer(u32 s1, u32 s2)
|
||||
|
||||
static void pnfs_barrier_update(struct pnfs_layout_hdr *lo, u32 newseq)
|
||||
{
|
||||
if (pnfs_seqid_is_newer(newseq, lo->plh_barrier))
|
||||
if (pnfs_seqid_is_newer(newseq, lo->plh_barrier) || !lo->plh_barrier)
|
||||
lo->plh_barrier = newseq;
|
||||
}
|
||||
|
||||
@@ -347,11 +347,15 @@ pnfs_set_plh_return_info(struct pnfs_layout_hdr *lo, enum pnfs_iomode iomode,
|
||||
iomode = IOMODE_ANY;
|
||||
lo->plh_return_iomode = iomode;
|
||||
set_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags);
|
||||
if (seq != 0) {
|
||||
WARN_ON_ONCE(lo->plh_return_seq != 0 && lo->plh_return_seq != seq);
|
||||
/*
|
||||
* We must set lo->plh_return_seq to avoid livelocks with
|
||||
* pnfs_layout_need_return()
|
||||
*/
|
||||
if (seq == 0)
|
||||
seq = be32_to_cpu(lo->plh_stateid.seqid);
|
||||
if (!lo->plh_return_seq || pnfs_seqid_is_newer(seq, lo->plh_return_seq))
|
||||
lo->plh_return_seq = seq;
|
||||
pnfs_barrier_update(lo, seq);
|
||||
}
|
||||
pnfs_barrier_update(lo, seq);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -592,10 +596,6 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg)
|
||||
inode = lo->plh_inode;
|
||||
|
||||
if (refcount_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) {
|
||||
if (test_bit(NFS_LSEG_VALID, &lseg->pls_flags)) {
|
||||
spin_unlock(&inode->i_lock);
|
||||
return;
|
||||
}
|
||||
pnfs_get_layout_hdr(lo);
|
||||
pnfs_layout_remove_lseg(lo, lseg);
|
||||
if (pnfs_cache_lseg_for_layoutreturn(lo, lseg))
|
||||
@@ -1000,7 +1000,7 @@ pnfs_layout_stateid_blocked(const struct pnfs_layout_hdr *lo,
|
||||
{
|
||||
u32 seqid = be32_to_cpu(stateid->seqid);
|
||||
|
||||
return !pnfs_seqid_is_newer(seqid, lo->plh_barrier) && lo->plh_barrier;
|
||||
return lo->plh_barrier && pnfs_seqid_is_newer(lo->plh_barrier, seqid);
|
||||
}
|
||||
|
||||
/* lget is set to 1 if called from inside send_layoutget call chain */
|
||||
|
||||
@@ -293,15 +293,19 @@ static int
|
||||
readpage_async_filler(void *data, struct page *page)
|
||||
{
|
||||
struct nfs_readdesc *desc = data;
|
||||
struct inode *inode = page_file_mapping(page)->host;
|
||||
unsigned int rsize = NFS_SERVER(inode)->rsize;
|
||||
struct nfs_page *new;
|
||||
unsigned int len;
|
||||
unsigned int len, aligned_len;
|
||||
int error;
|
||||
|
||||
len = nfs_page_length(page);
|
||||
if (len == 0)
|
||||
return nfs_return_empty_page(page);
|
||||
|
||||
new = nfs_create_request(desc->ctx, page, 0, len);
|
||||
aligned_len = min_t(unsigned int, ALIGN(len, rsize), PAGE_SIZE);
|
||||
|
||||
new = nfs_create_request(desc->ctx, page, 0, aligned_len);
|
||||
if (IS_ERR(new))
|
||||
goto out_error;
|
||||
|
||||
|
||||
@@ -480,6 +480,8 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
|
||||
if (clp->cl_nconnect > 0)
|
||||
seq_printf(m, ",nconnect=%u", clp->cl_nconnect);
|
||||
if (version == 4) {
|
||||
if (clp->cl_max_connect > 1)
|
||||
seq_printf(m, ",max_connect=%u", clp->cl_max_connect);
|
||||
if (nfss->port != NFS_PORT)
|
||||
seq_printf(m, ",port=%u", nfss->port);
|
||||
} else
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
|
||||
#include <linux/mempool.h>
|
||||
|
||||
/*
|
||||
* These are the default for number of transports to different server IPs
|
||||
*/
|
||||
#define NFS_MAX_TRANSPORTS 16
|
||||
|
||||
/*
|
||||
* These are the default flags for swap requests
|
||||
*/
|
||||
|
||||
@@ -62,6 +62,7 @@ struct nfs_client {
|
||||
|
||||
u32 cl_minorversion;/* NFSv4 minorversion */
|
||||
unsigned int cl_nconnect; /* Number of connections */
|
||||
unsigned int cl_max_connect; /* max number of xprts allowed */
|
||||
const char * cl_principal; /* used for machine cred */
|
||||
|
||||
#if IS_ENABLED(CONFIG_NFS_V4)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/socket.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
#include <linux/refcount.h>
|
||||
|
||||
#include <linux/sunrpc/msg_prot.h>
|
||||
#include <linux/sunrpc/sched.h>
|
||||
@@ -35,7 +36,7 @@ struct rpc_sysfs_client;
|
||||
* The high-level client handle
|
||||
*/
|
||||
struct rpc_clnt {
|
||||
atomic_t cl_count; /* Number of references */
|
||||
refcount_t cl_count; /* Number of references */
|
||||
unsigned int cl_clid; /* client id */
|
||||
struct list_head cl_clients; /* Global list of clients */
|
||||
struct list_head cl_tasks; /* List of tasks */
|
||||
@@ -81,6 +82,7 @@ struct rpc_clnt {
|
||||
struct work_struct cl_work;
|
||||
};
|
||||
const struct cred *cl_cred;
|
||||
unsigned int cl_max_connect; /* max number of transports not to the same IP */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -135,6 +137,7 @@ struct rpc_create_args {
|
||||
char *client_name;
|
||||
struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
|
||||
const struct cred *cred;
|
||||
unsigned int max_connect;
|
||||
};
|
||||
|
||||
struct rpc_add_xprt_test {
|
||||
|
||||
@@ -277,13 +277,13 @@ struct svc_rqst {
|
||||
#define RQ_VICTIM (5) /* about to be shut down */
|
||||
#define RQ_BUSY (6) /* request is busy */
|
||||
#define RQ_DATA (7) /* request has data */
|
||||
#define RQ_AUTHERR (8) /* Request status is auth error */
|
||||
unsigned long rq_flags; /* flags field */
|
||||
ktime_t rq_qtime; /* enqueue time */
|
||||
|
||||
void * rq_argp; /* decoded arguments */
|
||||
void * rq_resp; /* xdr'd results */
|
||||
void * rq_auth_data; /* flavor-specific data */
|
||||
__be32 rq_auth_stat; /* authentication status */
|
||||
int rq_auth_slack; /* extra space xdr code
|
||||
* should leave in head
|
||||
* for krb5i, krb5p.
|
||||
@@ -537,7 +537,6 @@ unsigned int svc_fill_write_vector(struct svc_rqst *rqstp,
|
||||
char *svc_fill_symlink_pathname(struct svc_rqst *rqstp,
|
||||
struct kvec *first, void *p,
|
||||
size_t total);
|
||||
__be32 svc_return_autherr(struct svc_rqst *rqstp, __be32 auth_err);
|
||||
__be32 svc_generic_init_request(struct svc_rqst *rqstp,
|
||||
const struct svc_program *progp,
|
||||
struct svc_process_info *procinfo);
|
||||
|
||||
@@ -127,7 +127,7 @@ struct auth_ops {
|
||||
char * name;
|
||||
struct module *owner;
|
||||
int flavour;
|
||||
int (*accept)(struct svc_rqst *rq, __be32 *authp);
|
||||
int (*accept)(struct svc_rqst *rq);
|
||||
int (*release)(struct svc_rqst *rq);
|
||||
void (*domain_release)(struct auth_domain *);
|
||||
int (*set_client)(struct svc_rqst *rq);
|
||||
@@ -149,7 +149,7 @@ struct auth_ops {
|
||||
|
||||
struct svc_xprt;
|
||||
|
||||
extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
|
||||
extern int svc_authenticate(struct svc_rqst *rqstp);
|
||||
extern int svc_authorise(struct svc_rqst *rqstp);
|
||||
extern int svc_set_client(struct svc_rqst *rqstp);
|
||||
extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops);
|
||||
|
||||
@@ -431,6 +431,7 @@ void xprt_release_write(struct rpc_xprt *, struct rpc_task *);
|
||||
#define XPRT_CONGESTED (9)
|
||||
#define XPRT_CWND_WAIT (10)
|
||||
#define XPRT_WRITE_SPACE (11)
|
||||
#define XPRT_SND_IS_COOKIE (12)
|
||||
|
||||
static inline void xprt_set_connected(struct rpc_xprt *xprt)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ struct rpc_xprt_switch {
|
||||
unsigned int xps_id;
|
||||
unsigned int xps_nxprts;
|
||||
unsigned int xps_nactive;
|
||||
unsigned int xps_nunique_destaddr_xprts;
|
||||
atomic_long_t xps_queuelen;
|
||||
struct list_head xps_xprt_list;
|
||||
|
||||
|
||||
@@ -793,6 +793,39 @@ TRACE_EVENT(xprtrdma_post_send,
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(xprtrdma_post_send_err,
|
||||
TP_PROTO(
|
||||
const struct rpcrdma_xprt *r_xprt,
|
||||
const struct rpcrdma_req *req,
|
||||
int rc
|
||||
),
|
||||
|
||||
TP_ARGS(r_xprt, req, rc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, cq_id)
|
||||
__field(unsigned int, task_id)
|
||||
__field(unsigned int, client_id)
|
||||
__field(int, rc)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
const struct rpc_rqst *rqst = &req->rl_slot;
|
||||
const struct rpcrdma_ep *ep = r_xprt->rx_ep;
|
||||
|
||||
__entry->cq_id = ep ? ep->re_attr.recv_cq->res.id : 0;
|
||||
__entry->task_id = rqst->rq_task->tk_pid;
|
||||
__entry->client_id = rqst->rq_task->tk_client ?
|
||||
rqst->rq_task->tk_client->cl_clid : -1;
|
||||
__entry->rc = rc;
|
||||
),
|
||||
|
||||
TP_printk("task:%u@%u cq.id=%u rc=%d",
|
||||
__entry->task_id, __entry->client_id,
|
||||
__entry->cq_id, __entry->rc
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(xprtrdma_post_recv,
|
||||
TP_PROTO(
|
||||
const struct rpcrdma_rep *rep
|
||||
@@ -818,16 +851,14 @@ TRACE_EVENT(xprtrdma_post_recv,
|
||||
TRACE_EVENT(xprtrdma_post_recvs,
|
||||
TP_PROTO(
|
||||
const struct rpcrdma_xprt *r_xprt,
|
||||
unsigned int count,
|
||||
int status
|
||||
unsigned int count
|
||||
),
|
||||
|
||||
TP_ARGS(r_xprt, count, status),
|
||||
TP_ARGS(r_xprt, count),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, cq_id)
|
||||
__field(unsigned int, count)
|
||||
__field(int, status)
|
||||
__field(int, posted)
|
||||
__string(addr, rpcrdma_addrstr(r_xprt))
|
||||
__string(port, rpcrdma_portstr(r_xprt))
|
||||
@@ -838,15 +869,44 @@ TRACE_EVENT(xprtrdma_post_recvs,
|
||||
|
||||
__entry->cq_id = ep->re_attr.recv_cq->res.id;
|
||||
__entry->count = count;
|
||||
__entry->status = status;
|
||||
__entry->posted = ep->re_receive_count;
|
||||
__assign_str(addr, rpcrdma_addrstr(r_xprt));
|
||||
__assign_str(port, rpcrdma_portstr(r_xprt));
|
||||
),
|
||||
|
||||
TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active (rc %d)",
|
||||
TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active",
|
||||
__get_str(addr), __get_str(port), __entry->cq_id,
|
||||
__entry->count, __entry->posted, __entry->status
|
||||
__entry->count, __entry->posted
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(xprtrdma_post_recvs_err,
|
||||
TP_PROTO(
|
||||
const struct rpcrdma_xprt *r_xprt,
|
||||
int status
|
||||
),
|
||||
|
||||
TP_ARGS(r_xprt, status),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, cq_id)
|
||||
__field(int, status)
|
||||
__string(addr, rpcrdma_addrstr(r_xprt))
|
||||
__string(port, rpcrdma_portstr(r_xprt))
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
const struct rpcrdma_ep *ep = r_xprt->rx_ep;
|
||||
|
||||
__entry->cq_id = ep->re_attr.recv_cq->res.id;
|
||||
__entry->status = status;
|
||||
__assign_str(addr, rpcrdma_addrstr(r_xprt));
|
||||
__assign_str(port, rpcrdma_portstr(r_xprt));
|
||||
),
|
||||
|
||||
TP_printk("peer=[%s]:%s cq.id=%d rc=%d",
|
||||
__get_str(addr), __get_str(port), __entry->cq_id,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user