Re: CVS commit: src/sys/kern

2018-05-01 Thread maya
hey, thanks for all the fixes!

I'm trying to import a driver (while being very new to
networking/driver stuff), and updating to -current fixed an issue I've
had, most likely from this commit.

Now my ported driver is close to working :-)

On Sat, Apr 28, 2018 at 08:16:15AM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Sat Apr 28 08:16:15 UTC 2018
> 
> Modified Files:
>   src/sys/kern: uipc_mbuf.c
> 
> Log Message:
> Modify m_defrag, so that it never frees the first mbuf of the chain. While
> here use the given 'flags' argument, and not M_DONTWAIT.
> 
> We have a problem with several drivers: they poll an mbuf chain from their
> queues and call m_defrag on them, but m_defrag could update the mbuf
> pointer, so the mbuf in the queue is no longer valid. It is not easy to
> fix each driver, because doing pop+push will reorder the queue, and we
> don't really want that to happen.
> 
> This problem was independently spotted by me, Kengo, Masanobu, and other
> people too it seems (perhaps PR/53218).
> 
> Now m_defrag leaves the first mbuf in place, and compresses the chain
> only starting from the second mbuf in the chain.
> 
> It is important not to compress the first mbuf with hacks, because the
> storage of this first mbuf may be shared with other mbufs.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.210 -r1.211 src/sys/kern/uipc_mbuf.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

> Modified files:
> 
> Index: src/sys/kern/uipc_mbuf.c
> diff -u src/sys/kern/uipc_mbuf.c:1.210 src/sys/kern/uipc_mbuf.c:1.211
> --- src/sys/kern/uipc_mbuf.c:1.210Fri Apr 27 19:06:48 2018
> +++ src/sys/kern/uipc_mbuf.c  Sat Apr 28 08:16:15 2018
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: uipc_mbuf.c,v 1.210 2018/04/27 19:06:48 maxv Exp $ */
> +/*   $NetBSD: uipc_mbuf.c,v 1.211 2018/04/28 08:16:15 maxv Exp $ */
>  
>  /*
>   * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
> @@ -62,7 +62,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.210 2018/04/27 19:06:48 maxv Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.211 2018/04/28 08:16:15 maxv Exp 
> $");
>  
>  #ifdef _KERNEL_OPT
>  #include "opt_mbuftrace.h"
> @@ -1475,27 +1475,32 @@ enobufs:
>  }
>  
>  /*
> - * Copy the mbuf chain to a new mbuf chain that is as short as possible.
> - * Return the new mbuf chain on success, NULL on failure.  On success,
> - * free the old mbuf chain.
> + * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
> + * failure. The first mbuf is preserved, and on success the pointer returned
> + * is the same as the one passed.
>   */
>  struct mbuf *
>  m_defrag(struct mbuf *mold, int flags)
>  {
>   struct mbuf *m0, *mn, *n;
> - size_t sz = mold->m_pkthdr.len;
> + int sz;
>  
>   KASSERT((mold->m_flags & M_PKTHDR) != 0);
>  
> - m0 = m_gethdr(flags, MT_DATA);
> + if (mold->m_next == NULL)
> + return mold;
> +
> + m0 = m_get(flags, MT_DATA);
>   if (m0 == NULL)
>   return NULL;
> - M_COPY_PKTHDR(m0, mold);
>   mn = m0;
>  
> + sz = mold->m_pkthdr.len - mold->m_len;
> + KASSERT(sz >= 0);
> +
>   do {
> - if (sz > MHLEN) {
> - MCLGET(mn, M_DONTWAIT);
> + if (sz > MLEN) {
> + MCLGET(mn, flags);
>   if ((mn->m_flags & M_EXT) == 0) {
>   m_freem(m0);
>   return NULL;
> @@ -1511,7 +1516,7 @@ m_defrag(struct mbuf *mold, int flags)
>  
>   if (sz > 0) {
>   /* need more mbufs */
> - n = m_get(M_NOWAIT, MT_DATA);
> + n = m_get(flags, MT_DATA);
>   if (n == NULL) {
>   m_freem(m0);
>   return NULL;
> @@ -1522,9 +1527,10 @@ m_defrag(struct mbuf *mold, int flags)
>   }
>   } while (sz > 0);
>  
> - m_freem(mold);
> + m_freem(mold->m_next);
> + mold->m_next = m0;
>  
> - return m0;
> + return mold;
>  }
>  
>  void
> 



Re: CVS commit: src/lib

2018-05-01 Thread Christos Zoulas
On May 1,  9:42pm, ventur...@geeklan.co.uk (Sevan Janiyan) wrote:
-- Subject: Re: CVS commit: src/lib

| Thank you for fixing the build, Christos.
| Apologies if I set anyone back the past couple of days.

No problem, I was debating what the best way was to handle it :-)

christos


Re: CVS commit: src/lib

2018-05-01 Thread Sevan Janiyan


On 05/01/18 20:50, Christos Zoulas wrote:
> Log Message:
> Add the netpgp lua bindings so that the compat build can build them.
> 

Thank you for fixing the build, Christos.
Apologies if I set anyone back the past couple of days.

Sevan


Re: CVS commit: src

2018-05-01 Thread Christos Zoulas
In article <04620e94-2acb-4492-bb53-5423e2516...@eis.cs.tu-bs.de>,
J. Hannken-Illjes  wrote:
>
>
>> On 29. Apr 2018, at 21:47, Sevan Janiyan  wrote:
>> 
>> Module Name: src
>> Committed By:sevan
>> Date:Sun Apr 29 19:47:35 UTC 2018
>> 
>> Modified Files:
>>  src/crypto/external/bsd/netpgp: Makefile
>>  src/distrib/sets/lists/base: shl.mi
>> Added Files:
>>  src/crypto/external/bsd/netpgp/bindings: Makefile
>>  src/crypto/external/bsd/netpgp/bindings/lua: Makefile
>> 
>> Log Message:
>> Hello netpgp(3lua)
>
>This breaks at least amd64:

I've fixed it and I am testing a build.

christos



Re: CVS commit: src

2018-05-01 Thread J. Hannken-Illjes


> On 29. Apr 2018, at 21:47, Sevan Janiyan  wrote:
> 
> Module Name:  src
> Committed By: sevan
> Date: Sun Apr 29 19:47:35 UTC 2018
> 
> Modified Files:
>   src/crypto/external/bsd/netpgp: Makefile
>   src/distrib/sets/lists/base: shl.mi
> Added Files:
>   src/crypto/external/bsd/netpgp/bindings: Makefile
>   src/crypto/external/bsd/netpgp/bindings/lua: Makefile
> 
> Log Message:
> Hello netpgp(3lua)

This breaks at least amd64:

checkflist ===> distrib/sets
==  1 missing files in DESTDIR  
Files in flist but missing from DESTDIR.
File wasn't installed ?
--
./usr/lib/i386/lua/5.3/netpgp.so
  end of 1 missing files  ==

--
J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)



Re: CVS commit: src/external/gpl2/gmake/dist

2018-05-01 Thread Kamil Rytarowski
On 28.04.2018 14:20, NONAKA Kimihiro wrote:
> Module Name:  src
> Committed By: nonaka
> Date: Sat Apr 28 12:20:41 UTC 2018
> 
> Modified Files:
>   src/external/gpl2/gmake/dist: configure configure.in
> 
> Log Message:
> gmake: Apply patch to support GLIBC glob interface v2
> 
> http://git.savannah.gnu.org/cgit/make.git/commit/?id=48c8a116
> 
> Fix a build failure on Ubuntu 18.04.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/gmake/dist/configure \
> src/external/gpl2/gmake/dist/configure.in
> 

This is polling GPLv3 code into GPLv2 gmake - these licenses are
incompatible.

I think we should either upgrade it to GPLv3 now or remove it.



signature.asc
Description: OpenPGP digital signature