rpms/kernel/devel nfs41-v2.6.31-rc7.patch, NONE, 1.1.2.1 kernel.spec, 1.1740, 1.1740.2.1
Steve Dickson
steved at fedoraproject.org
Wed Aug 26 17:22:47 UTC 2009
- Previous message (by thread): rpms/cups/F-11 cups-str3308.patch,NONE,1.1 cups.spec,1.511,1.512
- Next message (by thread): rpms/acpi/F-11 .cvsignore, 1.3, 1.4 acpi.spec, 1.7, 1.8 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: steved
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv951
Modified Files:
Tag: kernel-2_6_31-nfs41_rc7
kernel.spec
Added Files:
Tag: kernel-2_6_31-nfs41_rc7
nfs41-v2.6.31-rc7.patch
Log Message:
Update to latest nfs41 release: v2.6.31-rc7
nfs41-v2.6.31-rc7.patch:
fs/nfs/client.c | 10
fs/nfs/nfs4proc.c | 16
fs/nfs/nfs4state.c | 2
fs/nfs/nfs4xdr.c | 1376 ++++++++++++++++++-------------
fs/nfsd/nfs4callback.c | 216 ++++
fs/nfsd/nfs4proc.c | 82 -
fs/nfsd/nfs4state.c | 461 ++++------
fs/nfsd/nfs4xdr.c | 16
fs/nfsd/nfsctl.c | 5
fs/nfsd/nfssvc.c | 29
include/linux/nfs4.h | 2
include/linux/nfsd/nfsd.h | 3
include/linux/nfsd/state.h | 61 -
include/linux/nfsd/xdr4.h | 26
include/linux/sunrpc/clnt.h | 1
include/linux/sunrpc/svc.h | 2
include/linux/sunrpc/svcsock.h | 1
include/linux/sunrpc/xdr.h | 10
include/linux/sunrpc/xprt.h | 7
net/sunrpc/backchannel_rqst.c | 2
net/sunrpc/cache.c | 66 -
net/sunrpc/clnt.c | 1
net/sunrpc/sched.c | 7
net/sunrpc/sunrpc.h | 14
net/sunrpc/svcauth_unix.c | 1
net/sunrpc/svcsock.c | 335 +++++--
net/sunrpc/xdr.c | 12
net/sunrpc/xprt.c | 16
net/sunrpc/xprtrdma/svc_rdma_transport.c | 4
net/sunrpc/xprtsock.c | 199 ++++
30 files changed, 1906 insertions(+), 1077 deletions(-)
--- NEW FILE nfs41-v2.6.31-rc7.patch ---
diff -up linux-2.6.30.noarch/fs/nfs/client.c.orig linux-2.6.30.noarch/fs/nfs/client.c
--- linux-2.6.30.noarch/fs/nfs/client.c.orig 2009-08-26 10:40:03.695433000 -0400
+++ linux-2.6.30.noarch/fs/nfs/client.c 2009-08-26 13:13:01.538401000 -0400
@@ -149,6 +149,7 @@ static struct nfs_client *nfs_alloc_clie
clp->cl_boot_time = CURRENT_TIME;
clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED;
clp->cl_minorversion = cl_init->minorversion;
+ clp->cl_lease_time = 0;
#endif
cred = rpc_lookup_machine_cred();
if (!IS_ERR(cred))
@@ -535,16 +536,11 @@ void nfs_mark_client_ready(struct nfs_cl
/*
* With sessions, the client is not marked ready until after a
* successful EXCHANGE_ID and CREATE_SESSION.
- *
- * Map errors cl_cons_state errors to EPROTONOSUPPORT to indicate
- * other versions of NFS can be tried.
*/
int nfs4_check_client_ready(struct nfs_client *clp)
{
- if (!nfs4_has_session(clp))
- return 0;
- if (clp->cl_cons_state < NFS_CS_READY)
- return -EPROTONOSUPPORT;
+ if (clp->cl_cons_state < 0)
+ return clp->cl_cons_state;
return 0;
}
diff -up linux-2.6.30.noarch/fs/nfsd/nfs4callback.c.orig linux-2.6.30.noarch/fs/nfsd/nfs4callback.c
--- linux-2.6.30.noarch/fs/nfsd/nfs4callback.c.orig 2009-08-26 10:40:03.777437000 -0400
+++ linux-2.6.30.noarch/fs/nfsd/nfs4callback.c 2009-08-26 13:13:01.571402000 -0400
@@ -43,6 +43,7 @@
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/clnt.h>
+#include <linux/sunrpc/svcsock.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/state.h>
#include <linux/sunrpc/sched.h>
@@ -52,16 +53,19 @@
#define NFSPROC4_CB_NULL 0
#define NFSPROC4_CB_COMPOUND 1
+#define NFS4_STATEID_SIZE 16
/* Index of predefined Linux callback client operations */
enum {
- NFSPROC4_CLNT_CB_NULL = 0,
+ NFSPROC4_CLNT_CB_NULL = 0,
NFSPROC4_CLNT_CB_RECALL,
+ NFSPROC4_CLNT_CB_SEQUENCE,
};
enum nfs_cb_opnum4 {
OP_CB_RECALL = 4,
+ OP_CB_SEQUENCE = 11,
};
#define NFS4_MAXTAGLEN 20
@@ -70,17 +74,29 @@ enum nfs_cb_opnum4 {
#define NFS4_dec_cb_null_sz 0
#define cb_compound_enc_hdr_sz 4
#define cb_compound_dec_hdr_sz (3 + (NFS4_MAXTAGLEN >> 2))
+#define sessionid_sz (NFS4_MAX_SESSIONID_LEN >> 2)
+#define cb_sequence_enc_sz (sessionid_sz + 4 + \
+ 1 /* no referring calls list yet */)
+#define cb_sequence_dec_sz (op_dec_sz + sessionid_sz + 4)
+
#define op_enc_sz 1
#define op_dec_sz 2
#define enc_nfs4_fh_sz (1 + (NFS4_FHSIZE >> 2))
#define enc_stateid_sz (NFS4_STATEID_SIZE >> 2)
#define NFS4_enc_cb_recall_sz (cb_compound_enc_hdr_sz + \
+ cb_sequence_enc_sz + \
1 + enc_stateid_sz + \
enc_nfs4_fh_sz)
#define NFS4_dec_cb_recall_sz (cb_compound_dec_hdr_sz + \
+ cb_sequence_dec_sz + \
op_dec_sz)
+struct nfs4_rpc_args {
+ void *args_op;
+ struct nfsd4_cb_sequence args_seq;
+};
+
/*
* Generic encode routines from fs/nfs/nfs4xdr.c
*/
@@ -137,11 +153,13 @@ xdr_error:
} while (0)
struct nfs4_cb_compound_hdr {
- int status;
- u32 ident;
+ /* args */
+ u32 ident; /* minorversion 0 only */
u32 nops;
__be32 *nops_p;
u32 minorversion;
+ /* res */
+ int status;
u32 taglen;
char *tag;
};
@@ -238,6 +256,27 @@ encode_cb_recall(struct xdr_stream *xdr,
hdr->nops++;
}
+static void
+encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_cb_sequence *args,
+ struct nfs4_cb_compound_hdr *hdr)
+{
+ __be32 *p;
+
+ if (hdr->minorversion == 0)
+ return;
+
+ RESERVE_SPACE(1 + NFS4_MAX_SESSIONID_LEN + 20);
+
+ WRITE32(OP_CB_SEQUENCE);
+ WRITEMEM(args->cbs_clp->cl_sessionid.data, NFS4_MAX_SESSIONID_LEN);
+ WRITE32(args->cbs_clp->cl_cb_seq_nr);
+ WRITE32(0); /* slotid, always 0 */
+ WRITE32(0); /* highest slotid always 0 */
+ WRITE32(0); /* cachethis always 0 */
+ WRITE32(0); /* FIXME: support referring_call_lists */
+ hdr->nops++;
+}
+
static int
nfs4_xdr_enc_cb_null(struct rpc_rqst *req, __be32 *p)
{
@@ -249,15 +288,19 @@ nfs4_xdr_enc_cb_null(struct rpc_rqst *re
}
static int
-nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, __be32 *p, struct nfs4_delegation *args)
+nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, __be32 *p,
+ struct nfs4_rpc_args *rpc_args)
{
struct xdr_stream xdr;
+ struct nfs4_delegation *args = rpc_args->args_op;
struct nfs4_cb_compound_hdr hdr = {
.ident = args->dl_ident,
+ .minorversion = rpc_args->args_seq.cbs_minorversion,
};
xdr_init_encode(&xdr, &req->rq_snd_buf, p);
encode_cb_compound_hdr(&xdr, &hdr);
+ encode_cb_sequence(&xdr, &rpc_args->args_seq, &hdr);
encode_cb_recall(&xdr, args, &hdr);
encode_cb_nops(&hdr);
return 0;
@@ -299,6 +342,57 @@ decode_cb_op_hdr(struct xdr_stream *xdr,
return 0;
}
+/*
+ * Our current back channel implmentation supports a single backchannel
+ * with a single slot.
+ */
+static int
+decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_cb_sequence *res,
+ struct rpc_rqst *rqstp)
+{
+ struct nfs4_sessionid id;
+ int status;
+ u32 dummy;
+ __be32 *p;
+
+ if (res->cbs_minorversion == 0)
+ return 0;
+
+ status = decode_cb_op_hdr(xdr, OP_CB_SEQUENCE);
+ if (status)
+ return status;
+
+ /*
+ * If the server returns different values for sessionID, slotID or
+ * sequence number, the server is looney tunes.
+ */
+ status = -ESERVERFAULT;
+
+ READ_BUF(NFS4_MAX_SESSIONID_LEN + 16);
+ memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
+ p += XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN);
+ if (memcmp(id.data, res->cbs_clp->cl_sessionid.data,
+ NFS4_MAX_SESSIONID_LEN)) {
+ dprintk("%s Invalid session id\n", __func__);
+ goto out;
+ }
+ READ32(dummy);
+ if (dummy != res->cbs_clp->cl_cb_seq_nr) {
+ dprintk("%s Invalid sequence number\n", __func__);
+ goto out;
[...5030 lines suppressed...]
+
+/*
+ * Use the svc_sock to send the callback. Must be called with svsk->sk_mutex
+ * held. Borrows heavily from svc_tcp_sendto and xs_tcp_semd_request.
+ */
+static int bc_sendto(struct rpc_rqst *req)
+{
+ int len;
+ struct xdr_buf *xbufp = &req->rq_snd_buf;
+ struct rpc_xprt *xprt = req->rq_xprt;
+ struct sock_xprt *transport =
+ container_of(xprt, struct sock_xprt, xprt);
+ struct socket *sock = transport->sock;
+ unsigned long headoff;
+ unsigned long tailoff;
+
+ /*
+ * Set up the rpc header and record marker stuff
+ */
+ xs_encode_tcp_record_marker(xbufp);
+
+ tailoff = (unsigned long)xbufp->tail[0].iov_base & ~PAGE_MASK;
+ headoff = (unsigned long)xbufp->head[0].iov_base & ~PAGE_MASK;
+ len = svc_send_common(sock, xbufp,
+ virt_to_page(xbufp->head[0].iov_base), headoff,
+ xbufp->tail[0].iov_base, tailoff);
+
+ if (len != xbufp->len) {
+ printk(KERN_NOTICE "Error sending entire callback!\n");
+ len = -EAGAIN;
+ }
+
+ return len;
+}
+
+/*
+ * The send routine. Borrows from svc_send
+ */
+static int bc_send_request(struct rpc_task *task)
+{
+ struct rpc_rqst *req = task->tk_rqstp;
+ struct svc_xprt *xprt;
+ struct svc_sock *svsk;
+ u32 len;
+
+ dprintk("sending request with xid: %08x\n", ntohl(req->rq_xid));
+ /*
+ * Get the server socket associated with this callback xprt
+ */
+ xprt = req->rq_xprt->bc_xprt;
+ svsk = container_of(xprt, struct svc_sock, sk_xprt);
+
+ /*
+ * Grab the mutex to serialize data as the connection is shared
+ * with the fore channel
+ */
+ mutex_lock(&xprt->xpt_mutex);
+ if (test_bit(XPT_DEAD, &xprt->xpt_flags))
+ len = -ENOTCONN;
+ else
+ len = bc_sendto(req);
+ mutex_unlock(&xprt->xpt_mutex);
+
+ if (len > 0)
+ len = 0;
+
+ return len;
+}
+
+/*
+ * The close routine. Since this is client initiated, we do nothing
+ */
+
+static void bc_close(struct rpc_xprt *xprt)
+{
+ return;
+}
+
+/*
+ * The xprt destroy routine. Again, because this connection is client
+ * initiated, we do nothing
+ */
+
+static void bc_destroy(struct rpc_xprt *xprt)
+{
+ return;
+}
+
static struct rpc_xprt_ops xs_udp_ops = {
.set_buffer_size = xs_udp_set_buffer_size,
.reserve_xprt = xprt_reserve_xprt_cong,
@@ -2192,6 +2317,22 @@ static struct rpc_xprt_ops xs_tcp_ops =
.print_stats = xs_tcp_print_stats,
};
+/*
+ * The rpc_xprt_ops for the server backchannel
+ */
+
+static struct rpc_xprt_ops bc_tcp_ops = {
+ .reserve_xprt = xprt_reserve_xprt,
+ .release_xprt = xprt_release_xprt,
+ .buf_alloc = bc_malloc,
+ .buf_free = bc_free,
+ .send_request = bc_send_request,
+ .set_retrans_timeout = xprt_set_retrans_timeout_def,
+ .close = bc_close,
+ .destroy = bc_destroy,
+ .print_stats = xs_tcp_print_stats,
+};
+
static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
unsigned int slot_table_size)
{
@@ -2323,14 +2464,46 @@ static struct rpc_xprt *xs_setup_tcp(str
xprt->prot = IPPROTO_TCP;
xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32);
xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
+ xprt->timeout = &xs_tcp_default_timeout;
- xprt->bind_timeout = XS_BIND_TO;
- xprt->connect_timeout = XS_TCP_CONN_TO;
- xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
- xprt->idle_timeout = XS_IDLE_DISC_TO;
+ if (args->bc_xprt) {
+ struct svc_sock *bc_sock;
- xprt->ops = &xs_tcp_ops;
- xprt->timeout = &xs_tcp_default_timeout;
+ /* backchannel */
+ xprt_set_bound(xprt);
+ xprt->bind_timeout = 0;
+ xprt->connect_timeout = 0;
+ xprt->reestablish_timeout = 0;
+ xprt->idle_timeout = (~0);
+
+ /*
+ * The backchannel uses the same socket connection as the
+ * forechannel
+ */
+ xprt->bc_xprt = args->bc_xprt;
+ bc_sock = container_of(args->bc_xprt, struct svc_sock, sk_xprt);
+ bc_sock->sk_bc_xprt = xprt;
+ transport->sock = bc_sock->sk_sock;
+ transport->inet = bc_sock->sk_sk;
+
+ xprt->ops = &bc_tcp_ops;
+
+ switch (addr->sa_family) {
+ case AF_INET:
+ xs_format_ipv4_peer_addresses(xprt, "tcp",
+ RPCBIND_NETID_TCP);
+ break;
+ case AF_INET6:
+ xs_format_ipv6_peer_addresses(xprt, "tcp",
+ RPCBIND_NETID_TCP6);
+ break;
+ default:
+ kfree(xprt);
+ return ERR_PTR(-EAFNOSUPPORT);
+ }
+
+ goto out;
+ }
switch (addr->sa_family) {
case AF_INET:
@@ -2338,20 +2511,30 @@ static struct rpc_xprt *xs_setup_tcp(str
xprt_set_bound(xprt);
INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker4);
- xs_format_ipv4_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP);
+ xs_format_ipv4_peer_addresses(xprt, "tcp",
+ RPCBIND_NETID_TCP);
break;
case AF_INET6:
if (((struct sockaddr_in6 *)addr)->sin6_port != htons(0))
xprt_set_bound(xprt);
INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker6);
- xs_format_ipv6_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP6);
+ xs_format_ipv6_peer_addresses(xprt, "tcp",
+ RPCBIND_NETID_TCP);
break;
default:
kfree(xprt);
return ERR_PTR(-EAFNOSUPPORT);
}
+ xprt->bind_timeout = XS_BIND_TO;
+ xprt->connect_timeout = XS_TCP_CONN_TO;
+ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
+ xprt->idle_timeout = XS_IDLE_DISC_TO;
+
+ xprt->ops = &xs_tcp_ops;
+
+out:
dprintk("RPC: set up transport to address %s\n",
xprt->address_strings[RPC_DISPLAY_ALL]);
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1740
retrieving revision 1.1740.2.1
diff -u -p -r1.1740 -r1.1740.2.1
--- kernel.spec 26 Aug 2009 13:58:24 -0000 1.1740
+++ kernel.spec 26 Aug 2009 17:22:47 -0000 1.1740.2.1
@@ -15,7 +15,7 @@ Summary: The Linux kernel
# that the kernel isn't the stock distribution kernel, for example,
# by setting the define to ".local" or ".bz123456"
#
-# % define buildid .local
+%define buildid .nfs41
# fedora_build defines which build revision of this kernel version we're
# building. Rather than incrementing forever, as with the prior versioning
@@ -89,7 +89,8 @@ Summary: The Linux kernel
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
# kernel-firmware
-%define with_firmware %{?_with_firmware: 1} %{?!_with_firmware: 0}
+#%define with_firmware %{?_with_firmware: 1} %{?!_with_firmware: 0}
+%define with_firmware 1
# tools/perf
%define with_perftool %{?_without_perftool: 0} %{?!_without_perftool: 1}
# perf noarch subpkg
@@ -715,6 +716,7 @@ Patch2903: linux-2.6-revert-dvb-net-kabi
# NFSv4
Patch3050: linux-2.6-nfsd4-proots.patch
+Patch3060: nfs41-v2.6.31-rc7.patch
# VIA Nano / VX8xx updates
Patch11010: via-hwmon-temp-sensor.patch
@@ -1200,6 +1202,7 @@ ApplyPatch linux-2.6-execshield.patch
# NFSv4
ApplyPatch linux-2.6-nfsd4-proots.patch
+ApplyPatch nfs41-v2.6.31-rc7.patch
# USB
ApplyPatch linux-2.6-driver-level-usb-autosuspend.diff
@@ -2015,6 +2018,9 @@ fi
# and build.
%changelog
+* Wed Aug 26 2009 Steve Dickson <steved at redhat.com>
+- Update to latest nfs41 release: v2.6.31-rc7
+
* Wed Aug 26 2009 Adam Jackson <ajax at redhat.com>
- drm-intel-next.patch: Update, various output setup fixes.
- Previous message (by thread): rpms/cups/F-11 cups-str3308.patch,NONE,1.1 cups.spec,1.511,1.512
- Next message (by thread): rpms/acpi/F-11 .cvsignore, 1.3, 1.4 acpi.spec, 1.7, 1.8 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list