Re: linux-next: manual merge of the net-next tree with the vfs tree

2018-05-17 Thread Christoph Hellwig
> + /* Create a new file under /proc/net/ipconfig */
> + static int ipconfig_proc_net_create(const char *name,
> + const struct file_operations *fops)
> + {
> + char *pname;
> + struct proc_dir_entry *p;
> + 
> + if (!ipconfig_dir)
> + return -ENOMEM;
> + 
> + pname = kasprintf(GFP_KERNEL, "%s%s", "ipconfig/", name);
> + if (!pname)
> + return -ENOMEM;
> + 
> + p = proc_create(pname, 0444, init_net.proc_net, fops);
> + kfree(pname);
> + if (!p)
> + return -ENOMEM;
> + 
> + return 0;

This code doesn't exist in the above mentioned commit.  But event
without knowing the details of the /proc/net code this looks somewhat
bogus.  For one I thought all the /proc/net files should be per-net
namespace.  Second the ntp file really should be using proc_create_net,
to handle all that under the hood - with the merge of the VFS
tree it will take a seq_ops, which is what this code really wants
anyway.


linux-next: manual merge of the net-next tree with the vfs tree

2018-05-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/ipv4/ipconfig.c

between commits:

  3f3942aca6da ("proc: introduce proc_create_single{,_data}")
  c04d2cb2009f ("ipconfig: Write NTP server IPs to 
/proc/net/ipconfig/ntp_servers")

from the vfs tree and commit:

  4d019b3f80dc ("ipconfig: Create /proc/net/ipconfig directory")

from the net-next tree.

I fixed it up (see below - there may be more to do) and can carry the
fix as necessary. This is now fixed as far as linux-next is concerned,
but any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging.  You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv4/ipconfig.c
index bbcbcc113d19,86c9f755de3d..
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@@ -1282,6 -1317,74 +1317,61 @@@ static int pnp_seq_show(struct seq_fil
   _servaddr);
return 0;
  }
 -
 -static int pnp_seq_open(struct inode *indoe, struct file *file)
 -{
 -  return single_open(file, pnp_seq_show, NULL);
 -}
 -
 -static const struct file_operations pnp_seq_fops = {
 -  .open   = pnp_seq_open,
 -  .read   = seq_read,
 -  .llseek = seq_lseek,
 -  .release= single_release,
 -};
 -
+ /* Create the /proc/net/ipconfig directory */
+ static int __init ipconfig_proc_net_init(void)
+ {
+   ipconfig_dir = proc_net_mkdir(_net, "ipconfig", init_net.proc_net);
+   if (!ipconfig_dir)
+   return -ENOMEM;
+ 
+   return 0;
+ }
+ 
+ /* Create a new file under /proc/net/ipconfig */
+ static int ipconfig_proc_net_create(const char *name,
+   const struct file_operations *fops)
+ {
+   char *pname;
+   struct proc_dir_entry *p;
+ 
+   if (!ipconfig_dir)
+   return -ENOMEM;
+ 
+   pname = kasprintf(GFP_KERNEL, "%s%s", "ipconfig/", name);
+   if (!pname)
+   return -ENOMEM;
+ 
+   p = proc_create(pname, 0444, init_net.proc_net, fops);
+   kfree(pname);
+   if (!p)
+   return -ENOMEM;
+ 
+   return 0;
+ }
+ 
+ /* Write NTP server IP addresses to /proc/net/ipconfig/ntp_servers */
+ static int ntp_servers_seq_show(struct seq_file *seq, void *v)
+ {
+   int i;
+ 
+   for (i = 0; i < CONF_NTP_SERVERS_MAX; i++) {
+   if (ic_ntp_servers[i] != NONE)
+   seq_printf(seq, "%pI4\n", _ntp_servers[i]);
+   }
+   return 0;
+ }
+ 
+ static int ntp_servers_seq_open(struct inode *inode, struct file *file)
+ {
+   return single_open(file, ntp_servers_seq_show, NULL);
+ }
+ 
+ static const struct file_operations ntp_servers_seq_fops = {
+   .open   = ntp_servers_seq_open,
+   .read   = seq_read,
+   .llseek = seq_lseek,
+   .release= single_release,
+ };
  #endif /* CONFIG_PROC_FS */
  
  /*
@@@ -1356,8 -1459,20 +1446,20 @@@ static int __init ip_auto_config(void
int err;
unsigned int i;
  
+   /* Initialise all name servers and NTP servers to NONE (but only if the
+* "ip=" or "nfsaddrs=" kernel command line parameters weren't decoded,
+* otherwise we'll overwrite the IP addresses specified there)
+*/
+   if (ic_set_manually == 0) {
+   ic_nameservers_predef();
+   ic_ntp_servers_predef();
+   }
+ 
  #ifdef CONFIG_PROC_FS
 -  proc_create("pnp", 0444, init_net.proc_net, _seq_fops);
 +  proc_create_single("pnp", 0444, init_net.proc_net, pnp_seq_show);
+ 
+   if (ipconfig_proc_net_init() == 0)
+   ipconfig_proc_net_create("ntp_servers", _servers_seq_fops);
  #endif /* CONFIG_PROC_FS */
  
if (!ic_enable)


pgp6lRKBz8avo.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the net-next tree with the vfs tree

2018-01-24 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/tipc/socket.c

between commit:

  ade994f4f6c8 ("net: annotate ->poll() instances")

from the vfs tree and commit:

  60c253069632 ("tipc: fix race between poll() and setsockopt()")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/tipc/socket.c
index 2aa46e8cd8fe,473a096b6fba..
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@@ -715,8 -716,7 +716,7 @@@ static __poll_t tipc_poll(struct file *
  {
struct sock *sk = sock->sk;
struct tipc_sock *tsk = tipc_sk(sk);
-   struct tipc_group *grp = tsk->group;
 -  u32 revents = 0;
 +  __poll_t revents = 0;
  
sock_poll_wait(file, sk_sleep(sk), wait);
  


linux-next: manual merge of the net-next tree with the vfs tree

2018-01-09 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/tipc/socket.c

between commit:

  ade994f4f6c8 ("net: annotate ->poll() instances")

from the vfs tree and commit:

  eb929a91b213 ("tipc: improve poll() for group member socket")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/tipc/socket.c
index 2aa46e8cd8fe,1f236271766c..
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@@ -715,8 -715,8 +715,8 @@@ static __poll_t tipc_poll(struct file *
  {
struct sock *sk = sock->sk;
struct tipc_sock *tsk = tipc_sk(sk);
-   struct tipc_group *grp = tsk->group;
+   struct tipc_group *grp;
 -  u32 revents = 0;
 +  __poll_t revents = 0;
  
sock_poll_wait(file, sk_sleep(sk), wait);
  


linux-next: manual merge of the net-next tree with the vfs tree

2017-12-07 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/smc/smc_clc.c

between commit:

  d63d271ce2b5 ("smc: switch to sock_recvmsg()")

from the vfs tree and commit:

  e7b7a64a8493 ("smc: support variable CLC proposal messages")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/smc/smc_clc.c
index 511548085d16,abf7ceb6690b..
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@@ -86,12 -129,13 +132,12 @@@ int smc_clc_wait_msg(struct smc_sock *s
}
  
/* receive the complete CLC message */
 -  vec.iov_base = buf;
 -  vec.iov_len = buflen;
memset(, 0, sizeof(struct msghdr));
 +  iov_iter_kvec(_iter, READ | ITER_KVEC, , 1, buflen);
krflags = MSG_WAITALL;
smc->clcsock->sk->sk_rcvtimeo = CLC_WAIT_TIME;
 -  len = kernel_recvmsg(smc->clcsock, , , 1, datlen, krflags);
 +  len = sock_recvmsg(smc->clcsock, , krflags);
-   if (len < datlen) {
+   if (len < datlen || !smc_clc_msg_hdr_valid(clcm)) {
smc->sk.sk_err = EPROTO;
reason_code = -EPROTO;
goto out;


linux-next: manual merge of the net-next tree with the vfs tree

2017-04-06 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  drivers/net/ethernet/ibm/ibmvnic.c

between commit:

  98998345a579 ("ibmvnic: fix kstrtoul, copy_from_user and copy_to_user misuse")

from the vfs tree and commit:

  e704f0434ea6 ("ibmvnic: Remove debugfs support")

from the net-next tree.

I fixed it up (the latter removed all the code modified by the former,
so I just did that) and can carry the fix as necessary. This is now fixed
as far as linux-next is concerned, but any non trivial conflicts should
be mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell