Thread (3 messages) 3 messages, 2 authors, 2017-02-22

linux-next: build failure after merge of the net-next tree

From: Stephen Rothwell <hidden>
Date: 2017-01-09 23:59:33
Also in: linux-next, lkml
Subsystem: networking [general], shared memory communications (smc) sockets, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, D. Wythe, Dust Li, Sidraya Jayagond, Wenjia Zhang, Linus Torvalds

Hi all,

After merging the net-next tree, today's linux-next build (x86_64
allmodconfig) failed like this:

net/smc/af_smc.c: In function 'smc_splice_read':
net/smc/af_smc.c:1258:39: error: passing argument 1 of 'smc->clcsock->ops->splice_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
   rc = smc->clcsock->ops->splice_read(smc->clcsock, ppos,
                                       ^
net/smc/af_smc.c:1258:39: note: expected 'struct file *' but argument is of type 'struct socket *'
net/smc/af_smc.c: At top level:
net/smc/af_smc.c:1288:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .splice_read = smc_splice_read,   
                 ^
net/smc/af_smc.c:1288:17: note: (near initialization for 'smc_sock_ops.splice_read')

Caused by commit

  ac7138746e14 ("smc: establish new socket family")

interacting with commit

  15a8f657c71d ("switch socket ->splice_read() to struct file *")

from the vfs tree.

I applied the following merge fix patch which could well be incorrect ...

From: Stephen Rothwell <redacted>
Date: Tue, 10 Jan 2017 10:52:38 +1100
Subject: [PATCH] smc: merge fix for "switch socket ->splice_read() to struct file *"

Signed-off-by: Stephen Rothwell <redacted>
---
 net/smc/af_smc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 5d4208ad029e..4875e65f0c4a 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1242,10 +1242,11 @@ static ssize_t smc_sendpage(struct socket *sock, struct page *page,
 	return rc;
 }
 
-static ssize_t smc_splice_read(struct socket *sock, loff_t *ppos,
+static ssize_t smc_splice_read(struct file *file, loff_t *ppos,
 			       struct pipe_inode_info *pipe, size_t len,
 				    unsigned int flags)
 {
+	struct socket *sock = file->private_data;
 	struct sock *sk = sock->sk;
 	struct smc_sock *smc;
 	int rc = -ENOTCONN;
@@ -1255,7 +1256,7 @@ static ssize_t smc_splice_read(struct socket *sock, loff_t *ppos,
 	if ((sk->sk_state != SMC_ACTIVE) && (sk->sk_state != SMC_CLOSED))
 		goto out;
 	if (smc->use_fallback) {
-		rc = smc->clcsock->ops->splice_read(smc->clcsock, ppos,
+		rc = smc->clcsock->ops->splice_read(file, ppos,
 						    pipe, len, flags);
 	} else {
 		rc = -EOPNOTSUPP;
-- 
2.10.2

-- 
Cheers,
Stephen Rothwell
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help