Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Bruce Evans
On Sun, 5 Nov 2017, Konstantin Belousov wrote: On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: E.g., --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -304,8 +304,7 @@ retry: } if (bp->b_blkno ==

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Bruce Evans
On Sun, 5 Nov 2017, Mateusz Guzik wrote: On Sun, Nov 5, 2017 at 9:15 PM, Konstantin Belousov wrote: On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: IMO, the only reason ASSERT-style macros exist is to hide the conditional-on-build-type part of the operation. That is, to avoid ha

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Mateusz Guzik
On Sun, Nov 5, 2017 at 9:15 PM, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: > > IMO, the only reason ASSERT-style macros exist is to hide the > > conditional-on-build-type part of the operation. That is, to avoid > > having #ifdef INVARIANTS scattered

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Konstantin Belousov
On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: > IMO, the only reason ASSERT-style macros exist is to hide the > conditional-on-build-type part of the operation.  That is, to avoid > having #ifdef INVARIANTS scattered everywhere. bde' point is that KASSERT() is badly designed, and I ag

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Ian Lepore
On Sun, 2017-11-05 at 11:24 -0800, Conrad Meyer wrote: > On Sun, Nov 5, 2017 at 11:13 AM, Andriy Gapon wrote: > > > > I guess (only guess) that Conrad is saying that it would be useful to have a > > macro like KASSERT but which would be always active regardless of > > INVARIANTS. > > E.g. in ill

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Conrad Meyer
On Sun, Nov 5, 2017 at 11:13 AM, Andriy Gapon wrote: > I guess (only guess) that Conrad is saying that it would be useful to have a > macro like KASSERT but which would be always active regardless of INVARIANTS. > E.g. in illumos they have ASSERT and VERIFY. Yes, exactly. There are numerous plac

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Andriy Gapon
On 05/11/2017 21:02, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: >> On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: >> >>> E.g., >>> >>> --- a/sys/ufs/ffs/ffs_alloc.c >>> +++ b/sys/ufs/ffs/ffs_alloc.c >>> @@ -304,8 +304,7 @@ retry: >>> } >

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Konstantin Belousov
On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: > On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > > > E.g., > > > > --- a/sys/ufs/ffs/ffs_alloc.c > > +++ b/sys/ufs/ffs/ffs_alloc.c > > @@ -304,8 +304,7 @@ retry: > > } > > > > if (bp->b_blkno == bp->b_lblkno) { >

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Oliver Pinter
On 11/5/17, Warner Losh wrote: > On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > >> E.g., >> >> --- a/sys/ufs/ffs/ffs_alloc.c >> +++ b/sys/ufs/ffs/ffs_alloc.c >> @@ -304,8 +304,7 @@ retry: >> } >> >> if (bp->b_blkno == bp->b_lblkno) { >> - if (lbprev >= UFS_ND

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Warner Losh
On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > E.g., > > --- a/sys/ufs/ffs/ffs_alloc.c > +++ b/sys/ufs/ffs/ffs_alloc.c > @@ -304,8 +304,7 @@ retry: > } > > if (bp->b_blkno == bp->b_lblkno) { > - if (lbprev >= UFS_NDADDR) > - panic("ffs_r

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Conrad Meyer
E.g., --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -304,8 +304,7 @@ retry: } if (bp->b_blkno == bp->b_lblkno) { - if (lbprev >= UFS_NDADDR) - panic("ffs_realloccg: lbprev out of range"); + ASSERT(lbprev < UFS_NDAD

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Konstantin Belousov
On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote: > On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov > wrote: > > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: > >> This is a functional change, because MPASS (via KASSERT) is only > >> enabled on DEBUG kernels. Idea

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Conrad Meyer
On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov wrote: > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: >> This is a functional change, because MPASS (via KASSERT) is only >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that >> worked on NODEBUG kernels. > W

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Konstantin Belousov
On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: > This is a functional change, because MPASS (via KASSERT) is only > enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that > worked on NODEBUG kernels. Why would we need such thing ? Our conventions are clear: consisten

Re: svn commit: r325386 - head/sys/kern

2017-11-04 Thread Conrad Meyer
This is a functional change, because MPASS (via KASSERT) is only enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that worked on NODEBUG kernels. Best, Conrad On Sat, Nov 4, 2017 at 3:49 AM, Konstantin Belousov wrote: > Author: kib > Date: Sat Nov 4 10:49:34 2017 > New Revision

svn commit: r325386 - head/sys/kern

2017-11-04 Thread Konstantin Belousov
Author: kib Date: Sat Nov 4 10:49:34 2017 New Revision: 325386 URL: https://svnweb.freebsd.org/changeset/base/325386 Log: Convert explicit panic() call to assert. Based on github pull request: #113 Submitted by: pmarillo@github MFC after:1 week Modified: head/sys/kern/kern_umtx.