Skip to contentSkip to conversation

sunrpc unaligned access

DISCUSSION Meelis Roos 2 participants 5 messages Mar 13, 2007 – Apr 13, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Tried todays git (2.6.21-rc3-g8b9909de) on Ultra 5 and got this during NFS server startup:

Kernel unaligned access at TPC[100b8b98] svc_udp_recvfrom+0x180/0x420 [sunrpc]

Other than that it seems to work fine.

Signature · 1 line
Meelis Roos ([email protected])
maintainer
#1 lore raw

From: Meelis Roos <[email protected]>
Date: Tue, 13 Mar 2007 10:48:22 +0200 (EET)

Quoted 6 lines

Tried todays git (2.6.21-rc3-g8b9909de) on Ultra 5 and got this during NFS server startup:

Kernel unaligned access at TPC[100b8b98] svc_udp_recvfrom+0x180/0x420 [sunrpc]

Other than that it seems to work fine.

Thanks for the report, I'll have a look tomorrow.

maintainer
#2 lore raw
In reply to Meelis Roos

From: Meelis Roos <[email protected]>
Date: Tue, 13 Mar 2007 10:48:22 +0200 (EET)

Quoted 6 lines

Tried todays git (2.6.21-rc3-g8b9909de) on Ultra 5 and got this during NFS server startup:

Kernel unaligned access at TPC[100b8b98] svc_udp_recvfrom+0x180/0x420 [sunrpc]

Other than that it seems to work fine.

Does this patch make the problem go away? If not, please send me the new kernel log message and a copy of the net/sunrpc/svcsock.o object file from the build.

Thanks!

net/sunrpc/svcsock.c +12 -4
index 593f62f..2772fee 100644
@@ -452,6 +452,8 @@ union svc_pktinfo_u {
 	struct in_pktinfo pkti;
 	struct in6_pktinfo pkti6;
 };
+#define SVC_PKTINFO_SPACE \
+	CMSG_SPACE(sizeof(union svc_pktinfo_u))
 
 static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
 {
@@ -491,8 +493,11 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
 	struct svc_sock	*svsk = rqstp->rq_sock;
 	struct socket	*sock = svsk->sk_sock;
 	int		slen;
-	char 		buffer[CMSG_SPACE(sizeof(union svc_pktinfo_u))];
-	struct cmsghdr *cmh = (struct cmsghdr *)buffer;
+	union {
+		struct cmsghdr	hdr;
+		long		all[SVC_PKTINFO_SPACE / sizeof(long)];
+	} buffer;
+	struct cmsghdr *cmh = &buffer.hdr;
 	int		len = 0;
 	int		result;
 	int		size;
@@ -745,8 +750,11 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
 	struct svc_sock	*svsk = rqstp->rq_sock;
 	struct svc_serv	*serv = svsk->sk_server;
 	struct sk_buff	*skb;
-	char		buffer[CMSG_SPACE(sizeof(union svc_pktinfo_u))];
-	struct cmsghdr *cmh = (struct cmsghdr *)buffer;
+	union {
+		struct cmsghdr	hdr;
+		long		all[SVC_PKTINFO_SPACE / sizeof(long)];
+	} buffer;
+	struct cmsghdr *cmh = &buffer.hdr;
 	int		err, len;
 	struct msghdr msg = {
 		.msg_name = svc_addr(rqstp),
#3 lore raw
In reply to Meelis Roos
Quoted 3 lines

Does this patch make the problem go away? If not, please send me the new kernel log message and a copy of the net/sunrpc/svcsock.o object file from the build.

Fixed the messages for me, thanks!

Signature · 1 line
Meelis Roos ([email protected])
maintainer
#4 lore raw
In reply to Meelis Roos

From: Meelis Roos <[email protected]>
Date: Fri, 13 Apr 2007 17:27:18 +0300 (EEST)

Quoted 5 lines
Quoted 3 lines

Does this patch make the problem go away? If not, please send me the new kernel log message and a copy of the net/sunrpc/svcsock.o object file from the build.

Fixed the messages for me, thanks!

Thanks a lot for testing.