svn commit: r318516 - head/cddl/contrib/opensolaris/lib/libzpool/common

2017-05-18 Thread Alexander Motin
Author: mav
Date: Fri May 19 05:12:58 2017
New Revision: 318516
URL: https://svnweb.freebsd.org/changeset/base/318516

Log:
  Fix time handling in cv_timedwait_hires().
  
  pthread_cond_timedwait() receives absolute time, not relative.  Passing
  wrong time there caused two threads of zdb to spin in a tight loop.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==
--- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c  Fri May 19 
04:59:12 2017(r318515)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c  Fri May 19 
05:12:58 2017(r318516)
@@ -368,7 +368,7 @@ cv_timedwait_hires(kcondvar_t *cv, kmute
 int flag)
 {
int error;
-   timestruc_t ts;
+   timespec_t ts;
hrtime_t delta;
 
ASSERT(flag == 0 || flag == CALLOUT_FLAG_ABSOLUTE);
@@ -381,8 +381,13 @@ top:
if (delta <= 0)
return (-1);
 
-   ts.tv_sec = delta / NANOSEC;
-   ts.tv_nsec = delta % NANOSEC;
+   clock_gettime(CLOCK_REALTIME, );
+   ts.tv_sec += delta / NANOSEC;
+   ts.tv_nsec += delta % NANOSEC;
+   if (ts.tv_nsec >= NANOSEC) {
+   ts.tv_sec++;
+   ts.tv_nsec -= NANOSEC;
+   }
 
ASSERT(mutex_owner(mp) == curthread);
mp->m_owner = NULL;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318515 - head/lib/libc/stdlib

2017-05-18 Thread Xin LI
Author: delphij
Date: Fri May 19 04:59:12 2017
New Revision: 318515
URL: https://svnweb.freebsd.org/changeset/base/318515

Log:
  The current qsort(3) implementation ignores the sizes of partitions, and
  always perform recursion on the left partition, then use a tail call to
  handle the right partition.  In the worst case this could require O(N)
  levels of recursions.
  
  Reduce the possible recursion level to log2(N) by always recursing on the
  smaller partition instead.
  
  Obtained from:PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096

Modified:
  head/lib/libc/stdlib/qsort.c

Modified: head/lib/libc/stdlib/qsort.c
==
--- head/lib/libc/stdlib/qsort.cFri May 19 04:44:14 2017
(r318514)
+++ head/lib/libc/stdlib/qsort.cFri May 19 04:59:12 2017
(r318515)
@@ -117,7 +117,7 @@ qsort(void *a, size_t n, size_t es, cmp_
 #endif
 {
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
-   size_t d, r;
+   size_t d1, d2;
int cmp_result;
int swaptype_long, swaptype_int, swap_cnt;
 
@@ -137,7 +137,8 @@ loop:   SWAPINIT(long, a, es);
pl = a;
pn = (char *)a + (n - 1) * es;
if (n > 40) {
-   d = (n / 8) * es;
+   size_t d = (n / 8) * es;
+
pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
pm = med3(pm - d, pm, pm + d, cmp, thunk);
pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
@@ -182,21 +183,43 @@ loop: SWAPINIT(long, a, es);
}
 
pn = (char *)a + n * es;
-   r = MIN(pa - (char *)a, pb - pa);
-   vecswap(a, pb - r, r);
-   r = MIN(pd - pc, pn - pd - es);
-   vecswap(pb, pn - r, r);
-   if ((r = pb - pa) > es)
+   d1 = MIN(pa - (char *)a, pb - pa);
+   vecswap(a, pb - d1, d1);
+   d1 = MIN(pd - pc, pn - pd - es);
+   vecswap(pb, pn - d1, d1);
+
+   d1 = pb - pa;
+   d2 = pd - pc;
+   if (d1 <= d2) {
+   /* Recurse on left partition, then iterate on right partition */
+   if (d1 > es) {
 #ifdef I_AM_QSORT_R
-   qsort_r(a, r / es, es, thunk, cmp);
+   qsort_r(a, d1 / es, es, thunk, cmp);
 #else
-   qsort(a, r / es, es, cmp);
+   qsort(a, d1 / es, es, cmp);
 #endif
-   if ((r = pd - pc) > es) {
-   /* Iterate rather than recurse to save stack space */
-   a = pn - r;
-   n = r / es;
-   goto loop;
+   }
+   if (d2 > es) {
+   /* Iterate rather than recurse to save stack space */
+   /* qsort(pn - d2, d2 / es, es, cmp); */
+   a = pn - d2;
+   n = d2 / es;
+   goto loop;
+   }
+   } else {
+   /* Recurse on right partition, then iterate on left partition */
+   if (d2 > es) {
+#ifdef I_AM_QSORT_R
+   qsort_r(pn - d2, d2 / es, es, thunk, cmp);
+#else
+   qsort(pn - d2, d2 / es, es, cmp);
+#endif
+   }
+   if (d1 > es) {
+   /* Iterate rather than recurse to save stack space */
+   /* qsort(a, d1 / es, es, cmp); */
+   n = d1 / es;
+   goto loop;
+   }
}
-/* qsort(pn - r, r / es, es, cmp);*/
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318514 - head/lib/libc/stdlib

2017-05-18 Thread Xin LI
Author: delphij
Date: Fri May 19 04:44:14 2017
New Revision: 318514
URL: https://svnweb.freebsd.org/changeset/base/318514

Log:
  Use size_t.
  
  Inspired by:  OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11

Modified:
  head/lib/libc/stdlib/qsort.c

Modified: head/lib/libc/stdlib/qsort.c
==
--- head/lib/libc/stdlib/qsort.cFri May 19 02:12:10 2017
(r318513)
+++ head/lib/libc/stdlib/qsort.cFri May 19 04:44:14 2017
(r318514)
@@ -41,7 +41,7 @@ typedef intcmp_t(void *, const void *
 typedef int cmp_t(const void *, const void *);
 #endif
 static inline char *med3(char *, char *, char *, cmp_t *, void *);
-static inline void  swapfunc(char *, char *, int, int, int);
+static inline void  swapfunc(char *, char *, size_t, int, int);
 
 #defineMIN(a, b)   ((a) < (b) ? a : b)
 
@@ -49,7 +49,7 @@ static inline void swapfunc(char *, cha
  * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
  */
 #defineswapcode(TYPE, parmi, parmj, n) {   \
-   long i = (n) / sizeof (TYPE);   \
+   size_t i = (n) / sizeof (TYPE); \
TYPE *pi = (TYPE *) (parmi);\
TYPE *pj = (TYPE *) (parmj);\
do {\
@@ -64,7 +64,7 @@ static inline void swapfunc(char *, cha
es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1;
 
 static inline void
-swapfunc( char *a, char *b, int n, int swaptype_long, int swaptype_int)
+swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int)
 {
if (swaptype_long <= 1)
swapcode(long, a, b, n)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318512 - head/sys/net

2017-05-18 Thread Sepherosa Ziehau
Author: sephe
Date: Fri May 19 01:42:31 2017
New Revision: 318512
URL: https://svnweb.freebsd.org/changeset/base/318512

Log:
  net/vlan: Revert 305177
  
  Miss read the parentheses.
  
  Reported by:  oleg@
  Reviewed by:  hps@
  MFC after:3 days
  Sponsored by: Microsoft

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Fri May 19 01:23:06 2017(r318511)
+++ head/sys/net/ethernet.h Fri May 19 01:42:31 2017(r318512)
@@ -92,7 +92,7 @@ struct ether_vlan_header {
 #defineEVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
 #defineEVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
 #defineEVL_MAKETAG(vlid, pri, cfi) 
\
-   ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
+   ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
 
 /*
  *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318511 - head/sys/netpfil/ipfw

2017-05-18 Thread Don Lewis
Author: truckman
Date: Fri May 19 01:23:06 2017
New Revision: 318511
URL: https://svnweb.freebsd.org/changeset/base/318511

Log:
  The result of right shifting a negative signed value is implementation
  defined.  On machines without arithmetic shift instructions, zero bits
  may be shifted in from the left, giving a large positive result instead
  of the desired divide-by power-of-2.  Fix this by operating on the
  absolute value and compensating for the possible negation later.
  
  Reverse the order of the underflow/overflow tests and the exponential
  decay calculation to avoid the possibility of an erroneous overflow
  detection if p is a sufficiently small non-negative value.  Also
  check for negative values of prob before doing the exponential decay
  to avoid another instance of of right shifting a negative value.
  
  Tested by:Rasool Al-Saadi 
  MFC after:1 week

Modified:
  head/sys/netpfil/ipfw/dn_aqm_pie.c
  head/sys/netpfil/ipfw/dn_sched_fq_pie.c

Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c
==
--- head/sys/netpfil/ipfw/dn_aqm_pie.c  Fri May 19 00:43:49 2017
(r318510)
+++ head/sys/netpfil/ipfw/dn_aqm_pie.c  Fri May 19 01:23:06 2017
(r318511)
@@ -206,6 +206,7 @@ calculate_drop_prob(void *x)
int64_t p, prob, oldprob;
struct dn_aqm_pie_parms *pprms;
struct pie_status *pst = (struct pie_status *) x;
+   int p_isneg;
 
pprms = pst->parms;
prob = pst->drop_prob;
@@ -221,6 +222,12 @@ calculate_drop_prob(void *x)
((int64_t)pst->current_qdelay - (int64_t)pprms->qdelay_ref); 
p +=(int64_t) pprms->beta * 
((int64_t)pst->current_qdelay - (int64_t)pst->qdelay_old); 
+
+   /* take absolute value so right shift result is well defined */
+   p_isneg = p < 0;
+   if (p_isneg) {
+   p = -p;
+   }

/* We PIE_MAX_PROB shift by 12-bits to increase the division precision 
*/
p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S;
@@ -243,37 +250,47 @@ calculate_drop_prob(void *x)
 
oldprob = prob;
 
-   /* Cap Drop adjustment */
-   if ((pprms->flags & PIE_CAPDROP_ENABLED) && prob >= PIE_MAX_PROB / 10
-   && p > PIE_MAX_PROB / 50 ) 
-   p = PIE_MAX_PROB / 50;
+   if (p_isneg) {
+   prob = prob - p;
 
-   prob = prob + p;
-
-   /* decay the drop probability exponentially */
-   if (pst->current_qdelay == 0 && pst->qdelay_old == 0)
-   /* 0.98 ~= 1- 1/64 */
-   prob = prob - (prob >> 6); 
+   /* check for multiplication underflow */
+   if (prob > oldprob) {
+   prob= 0;
+   D("underflow");
+   }
+   } else {
+   /* Cap Drop adjustment */
+   if ((pprms->flags & PIE_CAPDROP_ENABLED) &&
+   prob >= PIE_MAX_PROB / 10 &&
+   p > PIE_MAX_PROB / 50 ) {
+   p = PIE_MAX_PROB / 50;
+   }
 
+   prob = prob + p;
 
-   /* check for multiplication overflow/underflow */
-   if (p>0) {
+   /* check for multiplication overflow */
if (proboldprob) {
-   prob= 0;
-   D("underflow");
-   }
 
-   /* make drop probability between 0 and PIE_MAX_PROB*/
-   if (prob < 0)
+   /*
+* decay the drop probability exponentially
+* and restrict it to range 0 to PIE_MAX_PROB
+*/
+   if (prob < 0) {
prob = 0;
-   else if (prob > PIE_MAX_PROB)
-   prob = PIE_MAX_PROB;
+   } else {
+   if (pst->current_qdelay == 0 && pst->qdelay_old == 0) {
+   /* 0.98 ~= 1- 1/64 */
+   prob = prob - (prob >> 6); 
+   }
+
+   if (prob > PIE_MAX_PROB) {
+   prob = PIE_MAX_PROB;
+   }
+   }
 
pst->drop_prob = prob;


Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c
==
--- head/sys/netpfil/ipfw/dn_sched_fq_pie.c Fri May 19 00:43:49 2017
(r318510)
+++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c Fri May 19 01:23:06 2017
(r318511)
@@ -377,6 +377,7 @@ fq_calculate_drop_prob(void *x)
struct dn_aqm_pie_parms *pprms; 
int64_t p, prob, oldprob;
aqm_time_t now;
+   int p_isneg;
 
now = AQM_UNOW;
pprms = pst->parms;
@@ -393,6 +394,12 @@ fq_calculate_drop_prob(void *x)
((int64_t)pst->current_qdelay - (int64_t)pprms->qdelay_ref); 
p +=(int64_t) 

Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Sepherosa Ziehau
Oh, my fault.  I will revert it.

On Thu, May 18, 2017 at 11:11 PM, Hans Petter Selasky  wrote:
> On 05/18/17 17:00, Oleg Bulyzhin wrote:
>>
>> On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
>>>
>>> On 05/18/17 16:04, Oleg Bulyzhin wrote:

 On Thu, Sep 01, 2016 at 06:32:35AM +, Sepherosa Ziehau wrote:
>
> Author: sephe
> Date: Thu Sep  1 06:32:35 2016
> New Revision: 305177
> URL: https://svnweb.freebsd.org/changeset/base/305177
>
> Log:
> net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
> Reviewed by:araujo, hps
> MFC after:  1 week
> Sponsored by:   Microsoft
> Differential Revision:  https://reviews.freebsd.org/D7710
>
> Modified:
> head/sys/net/ethernet.h
>
> Modified: head/sys/net/ethernet.h
>
> ==
> --- head/sys/net/ethernet.h Thu Sep  1 06:05:08 2016
> (r305176)
> +++ head/sys/net/ethernet.h Thu Sep  1 06:32:35 2016
> (r305177)
> @@ -92,7 +92,7 @@ struct ether_vlan_header {
>#define  EVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
>#define  EVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
>#define  EVL_MAKETAG(vlid, pri, cfi)
> \
> -   ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) &
> EVL_VLID_MASK))
> +   ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) &
> EVL_VLID_MASK))
>   /*
> *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length
> fields.


 Please revert this one. It's just plain wrong and previous one was ok.

>>>
>>> Hi,
>>>
>>> Can you explain a bit more what is wrong?
>>>
 If you care about readability it should be:
 pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
>>>
>>>
>>> Isn't this exactly what the patch is doing? -R ???
>>
>>
>> Current version is shifting pri out of uint16. If you examine parentheses:
>> pri is shifted left 13, then 12.
>> Original version did it right (shift 1, then 12 (total 13)).
>>
>
> Hi Oleg,
>
> I see. The VLAN priority is then always zero after this change.
>
> I'll let Sepherosa handle the revert and/or readability update.
>
> --HPS



-- 
Tomorrow Will Never Die
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318508 - head/cddl/usr.sbin/dtrace/tests/tools

2017-05-18 Thread Mark Johnston
Author: markj
Date: Fri May 19 00:25:09 2017
New Revision: 318508
URL: https://svnweb.freebsd.org/changeset/base/318508

Log:
  Remove the EXFAIL annotation for tests which pass as of r309596.
  
  Reported by:  bdrewery
  Sponsored by: Dell EMC Isilon

Modified:
  head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh

Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
==
--- head/cddl/usr.sbin/dtrace/tests/tools/exclude.shFri May 19 00:00:38 
2017(r318507)
+++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.shFri May 19 00:25:09 
2017(r318508)
@@ -139,11 +139,6 @@ exclude EXFAIL common/pid/tst.newprobes.
 exclude EXFAIL common/pid/tst.provregex2.ksh
 exclude EXFAIL common/pid/tst.provregex4.ksh
 
-# libproc doesn't properly handle probe sites that correspond to multiple
-# symbols.
-exclude EXFAIL common/pid/tst.weak1.d
-exclude EXFAIL common/pid/tst.weak2.d
-
 # This test checks for a leading tab on a line before #define. That is illegal
 # on Solaris, but the clang pre-processor on FreeBSD is happy with code like
 # that.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318502 - head/bin/sh

2017-05-18 Thread Jilles Tjoelker
Author: jilles
Date: Thu May 18 22:10:04 2017
New Revision: 318502
URL: https://svnweb.freebsd.org/changeset/base/318502

Log:
  sh: Keep output buffer across builtins.
  
  Allocating and deallocating repeatedly the 1024-byte buffer for stdout from
  builtins costs CPU time for little or no benefit.
  
  A simple loop containing builtins that write to a file descriptor, such as
i=0; while [ "$i" -lt 100 ]; do printf .; i=$((i+1)); done >/dev/null
  is over 10% faster in a simple benchmark on an amd64 virtual machine.

Modified:
  head/bin/sh/output.c

Modified: head/bin/sh/output.c
==
--- head/bin/sh/output.cThu May 18 21:44:14 2017(r318501)
+++ head/bin/sh/output.cThu May 18 22:10:04 2017(r318502)
@@ -254,14 +254,7 @@ flushout(struct output *dest)
 void
 freestdout(void)
 {
-   INTOFF;
-   if (output.buf) {
-   ckfree(output.buf);
-   output.nextc = NULL;
-   output.buf = NULL;
-   output.bufend = NULL;
-   }
-   INTON;
+   output.nextc = output.buf;
 }
 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318501 - head/bin/sh

2017-05-18 Thread Jilles Tjoelker
Author: jilles
Date: Thu May 18 21:44:14 2017
New Revision: 318501
URL: https://svnweb.freebsd.org/changeset/base/318501

Log:
  sh: Ensure memout.bufsize matches allocated buffer, if it exists.

Modified:
  head/bin/sh/eval.c
  head/bin/sh/output.c

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Thu May 18 21:23:39 2017(r318500)
+++ head/bin/sh/eval.c  Thu May 18 21:44:14 2017(r318501)
@@ -1081,8 +1081,6 @@ evalcommand(union node *cmd, int flags, 
mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
if (flags == EV_BACKCMD) {
memout.nextc = memout.buf;
-   memout.bufend = memout.buf;
-   memout.bufsize = 64;
mode |= REDIR_BACKQ;
}
savecmdname = commandname;
@@ -1139,6 +1137,7 @@ cmddone:
memout.buf = NULL;
memout.nextc = NULL;
memout.bufend = NULL;
+   memout.bufsize = 64;
}
if (cmdentry.u.index != EXECCMD)
popredir();

Modified: head/bin/sh/output.c
==
--- head/bin/sh/output.cThu May 18 21:23:39 2017(r318500)
+++ head/bin/sh/output.cThu May 18 21:44:14 2017(r318501)
@@ -73,7 +73,7 @@ static int doformat_wr(void *, const cha
 
 struct output output = {NULL, NULL, NULL, OUTBUFSIZ, 1, 0};
 struct output errout = {NULL, NULL, NULL, 256, 2, 0};
-struct output memout = {NULL, NULL, NULL, 0, MEM_OUT, 0};
+struct output memout = {NULL, NULL, NULL, 64, MEM_OUT, 0};
 struct output *out1 = 
 struct output *out2 = 
 
@@ -208,7 +208,7 @@ outbin(const void *data, size_t len, str
 void
 emptyoutbuf(struct output *dest)
 {
-   int offset;
+   int offset, newsize;
 
if (dest->buf == NULL) {
INTOFF;
@@ -218,10 +218,11 @@ emptyoutbuf(struct output *dest)
INTON;
} else if (dest->fd == MEM_OUT) {
offset = dest->nextc - dest->buf;
+   newsize = dest->bufsize << 1;
INTOFF;
-   dest->bufsize <<= 1;
-   dest->buf = ckrealloc(dest->buf, dest->bufsize);
-   dest->bufend = dest->buf + dest->bufsize;
+   dest->buf = ckrealloc(dest->buf, newsize);
+   dest->bufsize = newsize;
+   dest->bufend = dest->buf + newsize;
dest->nextc = dest->buf + offset;
INTON;
} else {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Eric van Gyzen
On 05/18/2017 16:34, Ian Lepore wrote:
> On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
>> On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
>>>
>>> On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:

 On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
>
>
> On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
>>
>>
>> On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
>> wrote:
>>>
>>>



>> [...]
> The support for broken out files has long been there, but the
> base
> system has
> not used them previously for default config shipped during a
> release.  That
> is in fact a new trend.
>
> However, the current approach seems to be the absolute worst
> way to
> do this.
> If someone wants to use the existing base system image and
> modify
> it with
> config management, they now have to use a mix of styles (for
> some
> services
> edit a global config file for certain settings, but use a
> dedicated
> file for
> other settings for the same service, or for the same settings
> but a
> different
> service).  It's also the worst case for humans trying to work
> with
> our system
> as the division between which services are broken out vs global
> is
> inconsistent and arbitrary.
>
> Once you split up the files you make a merge conflict for
> anyone
> trying to do
> an upgrade.  If we do this piecemail then we create N merge
> conflicts for users
> to deal with as opposed to if you split it up all at once.
>
> Also, there wasn't a clear consensus (a mail to arch@ with
> "hey, we
> should
> switch to splitting up config files for reasons A and B and
> let's
> do this for
> 12.0 but not merge to stable so there is a clear flag day /
> sign
> post for users
> to manage upgrades".  Instead there have been a couple of
> commits
> and any
> not-in-100%-agreement opinions are ignored.
>
 That's true, another thing is the way it is done, there is no
 simple
 way to
 disable the at cron from an admin point of view  rather than rm
 /etc/cron.d/at
 for an end user which an upgrade will bring back.

 Bapt
>>> Would you not just comment out or delete the line, exactly as you
>>> would
>>> do in the main /etc/crontab?
>> Right but with a .d directory I would expect to just remove/add
>> files/symlinks
>> rather than editing it, which defeat the point of the .d
>>
>> Bapt
> 
> Hrm, I don't see any conflict between "this fine-grained file holds
> config for just one component" and "edit the file if you want to change
> the config".  That is, making the file fine-grained is to make editing
> it EASIER (for a human or a program), not to eliminate editing it.
> 
> I do see how thinking that deleting the file (or renaming it to file.no
> or something) would seem like the right thing to do.  How can we fix
> that?

How would an upgrade bring back /etc/cron.d/at if the end-user deleted it?

Eric
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Baptiste Daroussin
On Thu, May 18, 2017 at 03:34:38PM -0600, Ian Lepore wrote:
> On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
> > On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
> > > 
> > > On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
> > > > 
> > > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > > > > 
> > > > > 
> > > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > > > > 
> > > > > > 
> > > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
> > > > > > wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > [...]
> > > > > The support for broken out files has long been there, but the
> > > > > base
> > > > > system has
> > > > > not used them previously for default config shipped during a
> > > > > release.  That
> > > > > is in fact a new trend.
> > > > > 
> > > > > However, the current approach seems to be the absolute worst
> > > > > way to
> > > > > do this.
> > > > > If someone wants to use the existing base system image and
> > > > > modify
> > > > > it with
> > > > > config management, they now have to use a mix of styles (for
> > > > > some
> > > > > services
> > > > > edit a global config file for certain settings, but use a
> > > > > dedicated
> > > > > file for
> > > > > other settings for the same service, or for the same settings
> > > > > but a
> > > > > different
> > > > > service).  It's also the worst case for humans trying to work
> > > > > with
> > > > > our system
> > > > > as the division between which services are broken out vs global
> > > > > is
> > > > > inconsistent and arbitrary.
> > > > > 
> > > > > Once you split up the files you make a merge conflict for
> > > > > anyone
> > > > > trying to do
> > > > > an upgrade.  If we do this piecemail then we create N merge
> > > > > conflicts for users
> > > > > to deal with as opposed to if you split it up all at once.
> > > > > 
> > > > > Also, there wasn't a clear consensus (a mail to arch@ with
> > > > > "hey, we
> > > > > should
> > > > > switch to splitting up config files for reasons A and B and
> > > > > let's
> > > > > do this for
> > > > > 12.0 but not merge to stable so there is a clear flag day /
> > > > > sign
> > > > > post for users
> > > > > to manage upgrades".  Instead there have been a couple of
> > > > > commits
> > > > > and any
> > > > > not-in-100%-agreement opinions are ignored.
> > > > > 
> > > > That's true, another thing is the way it is done, there is no
> > > > simple
> > > > way to
> > > > disable the at cron from an admin point of view  rather than rm
> > > > /etc/cron.d/at
> > > > for an end user which an upgrade will bring back.
> > > > 
> > > > Bapt
> > > Would you not just comment out or delete the line, exactly as you
> > > would
> > > do in the main /etc/crontab?
> > Right but with a .d directory I would expect to just remove/add
> > files/symlinks
> > rather than editing it, which defeat the point of the .d
> > 
> > Bapt
> 
> Hrm, I don't see any conflict between "this fine-grained file holds
> config for just one component" and "edit the file if you want to change
> the config".  That is, making the file fine-grained is to make editing
> it EASIER (for a human or a program), not to eliminate editing it.
> 
> I do see how thinking that deleting the file (or renaming it to file.no
> or something) would seem like the right thing to do.  How can we fix
> that?
> 

For now I don't know :) I'm thinking about it

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Ian Lepore
On Thu, 2017-05-18 at 23:29 +0200, Baptiste Daroussin wrote:
> On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
> > 
> > On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
> > > 
> > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > > > 
> > > > 
> > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > > > 
> > > > > 
> > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes
> > > > > wrote:
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > [...]
> > > > The support for broken out files has long been there, but the
> > > > base
> > > > system has
> > > > not used them previously for default config shipped during a
> > > > release.  That
> > > > is in fact a new trend.
> > > > 
> > > > However, the current approach seems to be the absolute worst
> > > > way to
> > > > do this.
> > > > If someone wants to use the existing base system image and
> > > > modify
> > > > it with
> > > > config management, they now have to use a mix of styles (for
> > > > some
> > > > services
> > > > edit a global config file for certain settings, but use a
> > > > dedicated
> > > > file for
> > > > other settings for the same service, or for the same settings
> > > > but a
> > > > different
> > > > service).  It's also the worst case for humans trying to work
> > > > with
> > > > our system
> > > > as the division between which services are broken out vs global
> > > > is
> > > > inconsistent and arbitrary.
> > > > 
> > > > Once you split up the files you make a merge conflict for
> > > > anyone
> > > > trying to do
> > > > an upgrade.  If we do this piecemail then we create N merge
> > > > conflicts for users
> > > > to deal with as opposed to if you split it up all at once.
> > > > 
> > > > Also, there wasn't a clear consensus (a mail to arch@ with
> > > > "hey, we
> > > > should
> > > > switch to splitting up config files for reasons A and B and
> > > > let's
> > > > do this for
> > > > 12.0 but not merge to stable so there is a clear flag day /
> > > > sign
> > > > post for users
> > > > to manage upgrades".  Instead there have been a couple of
> > > > commits
> > > > and any
> > > > not-in-100%-agreement opinions are ignored.
> > > > 
> > > That's true, another thing is the way it is done, there is no
> > > simple
> > > way to
> > > disable the at cron from an admin point of view  rather than rm
> > > /etc/cron.d/at
> > > for an end user which an upgrade will bring back.
> > > 
> > > Bapt
> > Would you not just comment out or delete the line, exactly as you
> > would
> > do in the main /etc/crontab?
> Right but with a .d directory I would expect to just remove/add
> files/symlinks
> rather than editing it, which defeat the point of the .d
> 
> Bapt

Hrm, I don't see any conflict between "this fine-grained file holds
config for just one component" and "edit the file if you want to change
the config".  That is, making the file fine-grained is to make editing
it EASIER (for a human or a program), not to eliminate editing it.

I do see how thinking that deleting the file (or renaming it to file.no
or something) would seem like the right thing to do.  How can we fix
that?

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Baptiste Daroussin
On Thu, May 18, 2017 at 03:27:49PM -0600, Ian Lepore wrote:
> On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
> > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > > 
> > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > > 
> > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > > > 
> > > > > > 
> > > > > > 
> > > > [...]
> > > The support for broken out files has long been there, but the base
> > > system has
> > > not used them previously for default config shipped during a
> > > release.  That
> > > is in fact a new trend.
> > > 
> > > However, the current approach seems to be the absolute worst way to
> > > do this.
> > > If someone wants to use the existing base system image and modify
> > > it with
> > > config management, they now have to use a mix of styles (for some
> > > services
> > > edit a global config file for certain settings, but use a dedicated
> > > file for
> > > other settings for the same service, or for the same settings but a
> > > different
> > > service).  It's also the worst case for humans trying to work with
> > > our system
> > > as the division between which services are broken out vs global is
> > > inconsistent and arbitrary.
> > > 
> > > Once you split up the files you make a merge conflict for anyone
> > > trying to do
> > > an upgrade.  If we do this piecemail then we create N merge
> > > conflicts for users
> > > to deal with as opposed to if you split it up all at once.
> > > 
> > > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we
> > > should
> > > switch to splitting up config files for reasons A and B and let's
> > > do this for
> > > 12.0 but not merge to stable so there is a clear flag day / sign
> > > post for users
> > > to manage upgrades".  Instead there have been a couple of commits
> > > and any
> > > not-in-100%-agreement opinions are ignored.
> > > 
> > That's true, another thing is the way it is done, there is no simple
> > way to
> > disable the at cron from an admin point of view  rather than rm
> > /etc/cron.d/at
> > for an end user which an upgrade will bring back.
> > 
> > Bapt
> 
> Would you not just comment out or delete the line, exactly as you would
> do in the main /etc/crontab?

Right but with a .d directory I would expect to just remove/add files/symlinks
rather than editing it, which defeat the point of the .d

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Ian Lepore
On Thu, 2017-05-18 at 23:24 +0200, Baptiste Daroussin wrote:
> On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > 
> > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > 
> > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > > 
> > > > > 
> > > > > 
> > > [...]
> > The support for broken out files has long been there, but the base
> > system has
> > not used them previously for default config shipped during a
> > release.  That
> > is in fact a new trend.
> > 
> > However, the current approach seems to be the absolute worst way to
> > do this.
> > If someone wants to use the existing base system image and modify
> > it with
> > config management, they now have to use a mix of styles (for some
> > services
> > edit a global config file for certain settings, but use a dedicated
> > file for
> > other settings for the same service, or for the same settings but a
> > different
> > service).  It's also the worst case for humans trying to work with
> > our system
> > as the division between which services are broken out vs global is
> > inconsistent and arbitrary.
> > 
> > Once you split up the files you make a merge conflict for anyone
> > trying to do
> > an upgrade.  If we do this piecemail then we create N merge
> > conflicts for users
> > to deal with as opposed to if you split it up all at once.
> > 
> > Also, there wasn't a clear consensus (a mail to arch@ with "hey, we
> > should
> > switch to splitting up config files for reasons A and B and let's
> > do this for
> > 12.0 but not merge to stable so there is a clear flag day / sign
> > post for users
> > to manage upgrades".  Instead there have been a couple of commits
> > and any
> > not-in-100%-agreement opinions are ignored.
> > 
> That's true, another thing is the way it is done, there is no simple
> way to
> disable the at cron from an admin point of view  rather than rm
> /etc/cron.d/at
> for an end user which an upgrade will bring back.
> 
> Bapt

Would you not just comment out or delete the line, exactly as you would
do in the main /etc/crontab?

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Baptiste Daroussin
On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > > Author: ngie
> > > > Date: Thu May 18 06:25:39 2017
> > > > New Revision: 318441
> > > > URL: https://svnweb.freebsd.org/changeset/base/318441
> > > > 
> > > > Log:
> > > >   Handle the cron.d entry for MK_AT in cron conditionally
> > > >   
> > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
> > > >   to run a non-existent program via cron(8) every 5 minutes with the
> > > >   default /etc/crontab, prior to this commit.
> > > >   
> > > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
> > > >   because atrun(8) executes programs, which may rely on environment
> > > >   currently set via /etc/crontab.
> > > >   
> > > >   Noted by: bdrewery (in an internal review)
> > > >   MFC after:2 months
> > > >   Relnotes: yes (may need to add environmental modifications to
> > > >  /etc/cron.d/at)
> > > >   Sponsored by: Dell EMC Isilon
> > > > 
> > > > Added:
> > > >   head/etc/cron.d/
> > > >   head/etc/cron.d/Makefile   (contents, props changed)
> > > >   head/etc/cron.d/at   (contents, props changed)
> > > > Modified:
> > > >   head/etc/Makefile
> > > >   head/etc/crontab
> > > > 
> > > > Modified: head/etc/Makefile
> > > > ==
> > > > --- head/etc/Makefile   Thu May 18 06:15:42 2017(r318440)
> > > > +++ head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
> > > > @@ -8,6 +8,7 @@ FILESGROUPS=FILES
> > > >  # No need as it is empty and just causes rebuilds since this file does 
> > > > so much.
> > > >  UPDATE_DEPENDFILE= no
> > > >  SUBDIR=\
> > > > +   cron.d \
> > > > newsyslog.conf.d \
> > > > syslog.d
> > > 
> > > The thread on the newsyslog clearly shows that this is a contriversial 
> > > change.
> > > 
> > > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO 
> > > files
> > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> > > desires of others.
> > 
> > Has multiple people has stated, on the newsyslog thread. this is not a
> > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
> > 1. Consistency
> >   as a project we do support building WITHOUT_FOO there is no reason to 
> > install
> >   syslog, cron configuration for FOO if the system was built without foo
> 
> Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
> because it looks nice.
> 
> > 2. Packaging base
> >   if one does not install at there is no need for the at crontab to be 
> > installed
> >   (same reason as 1.)
> 
> This is a viable reason except that it isn't fully baked yet.
> 
> > 3. Large deployment of freebsd farms
> >   Being able to administrate thousands of FreeBSD machines, one often ends 
> > up
> >   using tools like puppet, chef, ansible, cfengine. When programmatically
> >   handling configuration management it is way easier and safer to simple
> >   add/removes files in a directory rather than mangling^Winplace editing 
> > files.
> 
> There's nothing preventing you now from deploying split files and an empty
> global configuration file since the daemons support foo.d.  You don't require
> that to change in upstream since you should be using some sort of VCS to
> manage your configuration as it is.
> 
> > 4. Ports/packages
> >   On can provide easily sample configuration for cron, syslog (not only) 
> > and the
> >   admin can decide to use it or not easily (ususally this is done by making
> >   symlinks from the said file which would live in share/* into the .d 
> > directory.
> > 
> > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
> 
> The support for broken out files has long been there, but the base system has
> not used them previously for default config shipped during a release.  That
> is in fact a new trend.
> 
> However, the current approach seems to be the absolute worst way to do this.
> If someone wants to use the existing base system image and modify it with
> config management, they now have to use a mix of styles (for some services
> edit a global config file for certain settings, but use a dedicated file for
> other settings for the same service, or for the same settings but a different
> service).  It's also the worst case for humans trying to work with our system
> as the division between which services are broken out vs global is
> inconsistent and arbitrary.
> 
> Once you split up the files you make a merge conflict for anyone trying to do
> an upgrade.  If we do this piecemail then we create N merge conflicts for 
> users
> to deal with as opposed to if you split it up all at once.
> 
> Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should
> switch to 

svn commit: r318481 - head/usr.bin/resizewin

2017-05-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 18 19:42:19 2017
New Revision: 318481
URL: https://svnweb.freebsd.org/changeset/base/318481

Log:
  Language fixes.
  
  Submitted by: wblock
  MFC after:2 weeks

Modified:
  head/usr.bin/resizewin/resizewin.1

Modified: head/usr.bin/resizewin/resizewin.1
==
--- head/usr.bin/resizewin/resizewin.1  Thu May 18 18:39:23 2017
(r318480)
+++ head/usr.bin/resizewin/resizewin.1  Thu May 18 19:42:19 2017
(r318481)
@@ -49,7 +49,7 @@ The following options are available:
 .Bl -tag -width ".Fl z"
 .It Fl z
 Do nothing unless the current kernel terminal size is zero.
-This is useful when run from user's profile (shell startup) scripts:
+This is useful when run from a user's profile (shell startup) scripts:
 querying the window size is required for serial lines, but not when
 logging in over the network, as protocols like TELNET or SSH already
 handle the terminal size by themselves.
@@ -72,7 +72,7 @@ commands to set environment variables.
 .Pp
 The terminal is assumed to be VT100/ANSI compatible.
 The VT100/ANSI escape sequences are supported by virtually all modern
-terminals; this include xterm, konsole, gnome-terminal, iTerm,
+terminals, including xterm, konsole, gnome-terminal, iTerm,
 Terminal.app, and PuTTY.
 .Sh SEE ALSO
 .Xr stty 1 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318474 - head/usr.sbin/makefs

2017-05-18 Thread Ed Maste
On 18 May 2017 at 13:55, Ed Maste  wrote:
> Author: emaste
> Date: Thu May 18 17:55:33 2017
> New Revision: 318474
> URL: https://svnweb.freebsd.org/changeset/base/318474
>
> Log:
>   makefs: drop WARNS back to 2
>
>   GCC warns about additional signed comparision issues compared to Clang.
>   Drop WARNS for now until the underlying issue is fixed.

FYI the GCC warning came from the same blksize macro, but from the
conditional expression this time.

#define blksize(fs, ip, lbn) \
(((lbn) >= UFS_NDADDR || (ip)->i_size >= \
(uint64_t)smalllblktosize(fs, (lbn) + 1)) \
? (fs)->fs_bsize \
: (fragroundup(fs, blkoff(fs, (ip)->i_size

(fs)->fs_bsize is a signed int, while fragroundup is unsigned (from i_size).

>
> Modified:
>   head/usr.sbin/makefs/Makefile
>
> Modified: head/usr.sbin/makefs/Makefile
> ==
> --- head/usr.sbin/makefs/Makefile   Thu May 18 17:44:45 2017
> (r318473)
> +++ head/usr.sbin/makefs/Makefile   Thu May 18 17:55:33 2017
> (r318474)
> @@ -14,7 +14,7 @@ SRCS= cd9660.c ffs.c \
> walk.c
>  MAN=   makefs.8
>
> -WARNS?=3
> +WARNS?=2
>
>  .include "${SRCDIR}/cd9660/Makefile.inc"
>  .include "${SRCDIR}/ffs/Makefile.inc"
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318479 - head/sys/dev/drm2/ttm

2017-05-18 Thread Mark Johnston
Author: markj
Date: Thu May 18 18:37:19 2017
New Revision: 318479
URL: https://svnweb.freebsd.org/changeset/base/318479

Log:
  Don't bother enqueuing a page immediately before freeing it.
  
  No functional change intended.
  
  MFC after:1 week

Modified:
  head/sys/dev/drm2/ttm/ttm_page_alloc.c

Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c
==
--- head/sys/dev/drm2/ttm/ttm_page_alloc.c  Thu May 18 18:35:14 2017
(r318478)
+++ head/sys/dev/drm2/ttm/ttm_page_alloc.c  Thu May 18 18:37:19 2017
(r318479)
@@ -136,7 +136,7 @@ ttm_vm_page_free(vm_page_t m)
KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
m->flags &= ~PG_FICTITIOUS;
m->oflags |= VPO_UNMANAGED;
-   vm_page_unwire(m, PQ_INACTIVE);
+   vm_page_unwire(m, PQ_NONE);
vm_page_free(m);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318478 - in head/sys: compat/linuxkpi/common/src dev/drm2/ttm

2017-05-18 Thread Mark Johnston
Author: markj
Date: Thu May 18 18:35:14 2017
New Revision: 318478
URL: https://svnweb.freebsd.org/changeset/base/318478

Log:
  Fix a few uses of kern_yield() in the TTM and the LinuxKPI.
  
  kern_yield(0) effectively causes the calling thread to be rescheduled
  immediately since it resets the thread's priority to the highest possible
  value. This can cause livelocks when the pattern
  "while (!trylock()) kern_yield(0);" is used since the thread holding the
  lock may linger on the runqueue for the CPU on which the looping thread is
  running.
  
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu May 18 18:33:33 
2017(r318477)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu May 18 18:35:14 
2017(r318478)
@@ -435,7 +435,7 @@ linux_cdev_pager_populate(vm_object_t vm
err = vmap->vm_ops->fault(vmap, );
 
while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) {
-   kern_yield(0);
+   kern_yield(PRI_USER);
err = vmap->vm_ops->fault(vmap, );
}
}

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c   Thu May 18 18:33:33 2017
(r318477)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c   Thu May 18 18:35:14 2017
(r318478)
@@ -126,7 +126,7 @@ reserve:
ret = ttm_bo_reserve(bo, false, false, false, 0);
if (unlikely(ret != 0)) {
if (ret == -EBUSY) {
-   kern_yield(0);
+   kern_yield(PRI_USER);
goto reserve;
}
}
@@ -139,7 +139,7 @@ reserve:
case -EBUSY:
case -ERESTARTSYS:
case -EINTR:
-   kern_yield(0);
+   kern_yield(PRI_USER);
goto reserve;
default:
retval = VM_PAGER_ERROR;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318476 - head/sys/kern

2017-05-18 Thread Mark Johnston
Author: markj
Date: Thu May 18 18:24:11 2017
New Revision: 318476
URL: https://svnweb.freebsd.org/changeset/base/318476

Log:
  Avoid open-coding PRI_UNCHANGED.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_fail.c

Modified: head/sys/kern/kern_fail.c
==
--- head/sys/kern/kern_fail.c   Thu May 18 18:18:39 2017(r318475)
+++ head/sys/kern/kern_fail.c   Thu May 18 18:24:11 2017(r318476)
@@ -612,7 +612,7 @@ fail_point_eval_nontrivial(struct fail_p
break;
 
case FAIL_POINT_YIELD:
-   kern_yield(-1);
+   kern_yield(PRI_UNCHANGED);
break;
 
case FAIL_POINT_DELAY:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318474 - head/usr.sbin/makefs

2017-05-18 Thread Ed Maste
Author: emaste
Date: Thu May 18 17:55:33 2017
New Revision: 318474
URL: https://svnweb.freebsd.org/changeset/base/318474

Log:
  makefs: drop WARNS back to 2
  
  GCC warns about additional signed comparision issues compared to Clang.
  Drop WARNS for now until the underlying issue is fixed.

Modified:
  head/usr.sbin/makefs/Makefile

Modified: head/usr.sbin/makefs/Makefile
==
--- head/usr.sbin/makefs/Makefile   Thu May 18 17:44:45 2017
(r318473)
+++ head/usr.sbin/makefs/Makefile   Thu May 18 17:55:33 2017
(r318474)
@@ -14,7 +14,7 @@ SRCS= cd9660.c ffs.c \
walk.c
 MAN=   makefs.8
 
-WARNS?=3
+WARNS?=2
 
 .include "${SRCDIR}/cd9660/Makefile.inc"
 .include "${SRCDIR}/ffs/Makefile.inc"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Warner Losh
On Thu, May 18, 2017 at 3:56 AM, Rodney W. Grimes
 wrote:
>> Author: ngie
>> Date: Thu May 18 06:25:39 2017
>> New Revision: 318441
>> URL: https://svnweb.freebsd.org/changeset/base/318441
>>
>> Log:
>>   Handle the cron.d entry for MK_AT in cron conditionally
>>
>>   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
>>   to run a non-existent program via cron(8) every 5 minutes with the
>>   default /etc/crontab, prior to this commit.
>>
>>   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
>>   because atrun(8) executes programs, which may rely on environment
>>   currently set via /etc/crontab.
>>
>>   Noted by:   bdrewery (in an internal review)
>>   MFC after:  2 months
>>   Relnotes:   yes (may need to add environmental modifications to
>>/etc/cron.d/at)
>>   Sponsored by:   Dell EMC Isilon
>>
>> Added:
>>   head/etc/cron.d/
>>   head/etc/cron.d/Makefile   (contents, props changed)
>>   head/etc/cron.d/at   (contents, props changed)
>> Modified:
>>   head/etc/Makefile
>>   head/etc/crontab
>>
>> Modified: head/etc/Makefile
>> ==
>> --- head/etc/Makefile Thu May 18 06:15:42 2017(r318440)
>> +++ head/etc/Makefile Thu May 18 06:25:39 2017(r318441)
>> @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
>>  # No need as it is empty and just causes rebuilds since this file does so 
>> much.
>>  UPDATE_DEPENDFILE=   no
>>  SUBDIR=  \
>> + cron.d \
>>   newsyslog.conf.d \
>>   syslog.d
>
> The thread on the newsyslog clearly shows that this is a contriversial change.
>
> I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
> to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> desires of others.
>
> I especially object to it being done on a 1 of case, either completly split
> the file or make it 1 file, but making it this miss match is just adding to
> the work load of ansible and puppet task writting.  You now have to mange
> 2 config files rather than 1 for cron, and 7 for newsyslog instead of 1.

In the vast majority of the cases so far, I'm convinced the changes
are for the better and will make things like mergemaster / etcupate /
etc easier on our users. Since the files are separate, and you almost
never touch them, it's a net win.

Consider this a strong encouragement to proceed.

Warner

>> Added: head/etc/cron.d/Makefile
>> ==
>> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
>> +++ head/etc/cron.d/Makefile  Thu May 18 06:25:39 2017(r318441)
>> @@ -0,0 +1,11 @@
>> +# $FreeBSD$
>> +
>> +.include 
>> +
>> +.if ${MK_AT} != "no"
>> +FILES+=  at
>> +.endif
>> +
>> +BINDIR=  /etc/cron.d
>> +
>> +.include 
>>
>> Added: head/etc/cron.d/at
>> ==
>> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
>> +++ head/etc/cron.d/atThu May 18 06:25:39 2017(r318441)
>> @@ -0,0 +1,7 @@
>> +# $FreeBSD$
>> +#
>> +SHELL=/bin/sh
>> +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
>> +
>> +# See crontab(5) for field format.
>> +*/5  *   *   *   *   root/usr/libexec/atrun
>>
>> Modified: head/etc/crontab
>> ==
>> --- head/etc/crontab  Thu May 18 06:15:42 2017(r318440)
>> +++ head/etc/crontab  Thu May 18 06:25:39 2017(r318441)
>> @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
>>  #
>>  #minute  hourmdaymonth   wdaywho command
>>  #
>> -*/5  *   *   *   *   root/usr/libexec/atrun
>> -#
>>  # Save some entropy so that /dev/random can re-seed on boot.
>>  */11 *   *   *   *   operator /usr/libexec/save-entropy
>>  #
>>
>>
>
> --
> Rod Grimes rgri...@freebsd.org
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318471 - in head/usr.bin/indent: . tests

2017-05-18 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Thu May 18 17:15:58 2017
New Revision: 318471
URL: https://svnweb.freebsd.org/changeset/base/318471

Log:
  indent(1): Support binary integer literals.
  This was done by Romain Tartière for PR123553. I initially thought that it 
would break code like this:
  #define b00101010 -1
  if (0 b00101010)
  ...
  
  by joining 0 and b00101010 together. However, the real problem with that 
patch was that once it saw a 0, it assumed that the number was base 2, 8 or 16, 
ignoring base 10 floating point numbers. I fixed that.
  
  I didn't copy the diagnostic part of the original patch as it seems out of 
scope of implementing binary integer literals formatting.
  
  PR:   123553
  Submitted by: romain (original version)
  Approved by:  pfg (mentor)

Added:
  head/usr.bin/indent/tests/binary.0   (contents, props changed)
  head/usr.bin/indent/tests/binary.0.stdout   (contents, props changed)
Modified:
  head/usr.bin/indent/lexi.c
  head/usr.bin/indent/tests/Makefile

Modified: head/usr.bin/indent/lexi.c
==
--- head/usr.bin/indent/lexi.c  Thu May 18 17:01:26 2017(r318470)
+++ head/usr.bin/indent/lexi.c  Thu May 18 17:15:58 2017(r318471)
@@ -169,19 +169,47 @@ lexi(void)
struct templ *p;
 
if (isdigit(*buf_ptr) || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) {
+   enum base {
+   BASE_2, BASE_8, BASE_10, BASE_16
+   };
int seendot = 0,
seenexp = 0,
seensfx = 0;
-   if (*buf_ptr == '0' &&
-   (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) {
+   enum base   in_base = BASE_10;
+
+   if (*buf_ptr == '0') {
+   if (buf_ptr[1] == 'b' || buf_ptr[1] == 'B')
+   in_base = BASE_2;
+   else if (buf_ptr[1] == 'x' || buf_ptr[1] == 'X')
+   in_base = BASE_16;
+   else if (isdigit(buf_ptr[1]))
+   in_base = BASE_8;
+   }
+   switch (in_base) {
+   case BASE_2:
+   *e_token++ = *buf_ptr++;
+   *e_token++ = *buf_ptr++;
+   while (*buf_ptr == '0' || *buf_ptr == '1') {
+   CHECK_SIZE_TOKEN;
+   *e_token++ = *buf_ptr++;
+   }
+   break;
+   case BASE_8:
+   *e_token++ = *buf_ptr++;
+   while (*buf_ptr >= '0' && *buf_ptr <= '8') {
+   CHECK_SIZE_TOKEN;
+   *e_token++ = *buf_ptr++;
+   }
+   break;
+   case BASE_16:
*e_token++ = *buf_ptr++;
*e_token++ = *buf_ptr++;
while (isxdigit(*buf_ptr)) {
CHECK_SIZE_TOKEN;
*e_token++ = *buf_ptr++;
}
-   }
-   else
+   break;
+   case BASE_10:
while (1) {
if (*buf_ptr == '.') {
if (seendot)
@@ -204,6 +232,8 @@ lexi(void)
}
}
}
+   break;
+   }
while (1) {
if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) {
CHECK_SIZE_TOKEN;

Modified: head/usr.bin/indent/tests/Makefile
==
--- head/usr.bin/indent/tests/Makefile  Thu May 18 17:01:26 2017
(r318470)
+++ head/usr.bin/indent/tests/Makefile  Thu May 18 17:15:58 2017
(r318471)
@@ -2,6 +2,8 @@
 
 PACKAGE=   tests
 
+${PACKAGE}FILES+=  binary.0
+${PACKAGE}FILES+=  binary.0.stdout
 ${PACKAGE}FILES+=  comments.0
 ${PACKAGE}FILES+=  comments.0.stdout
 ${PACKAGE}FILES+=  declarations.0

Added: head/usr.bin/indent/tests/binary.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/indent/tests/binary.0  Thu May 18 17:15:58 2017
(r318471)
@@ -0,0 +1,10 @@
+/* $FreeBSD$ */
+#define b00101010 -1
+void t(void) {
+   unsigned a[] = {0b00101010, 0x5678, 02, 17U};
+   float x[] = {.7f, 0.7f};
+   unsigned long ul[] = {0bUL, 0x01010101UL, 02UL, 17UL};
+
+   if (0 b00101010)
+   return;
+}

Added: head/usr.bin/indent/tests/binary.0.stdout
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/indent/tests/binary.0.stdout   Thu May 18 17:15:58 2017
(r318471)
@@ -0,0 +1,12 @@
+/* $FreeBSD$ */
+#define b00101010 -1
+void 
+t(void)
+{
+   unsigneda[] = {0b00101010, 0x5678, 02, 17U};
+   float   x[] = {.7f, 0.7f};
+   unsigned long   ul[] = {0bUL, 0x01010101UL, 02UL, 17UL};

Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread John Baldwin
On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > Author: ngie
> > > Date: Thu May 18 06:25:39 2017
> > > New Revision: 318441
> > > URL: https://svnweb.freebsd.org/changeset/base/318441
> > > 
> > > Log:
> > >   Handle the cron.d entry for MK_AT in cron conditionally
> > >   
> > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
> > >   to run a non-existent program via cron(8) every 5 minutes with the
> > >   default /etc/crontab, prior to this commit.
> > >   
> > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
> > >   because atrun(8) executes programs, which may rely on environment
> > >   currently set via /etc/crontab.
> > >   
> > >   Noted by:   bdrewery (in an internal review)
> > >   MFC after:  2 months
> > >   Relnotes:   yes (may need to add environmental modifications to
> > >/etc/cron.d/at)
> > >   Sponsored by:   Dell EMC Isilon
> > > 
> > > Added:
> > >   head/etc/cron.d/
> > >   head/etc/cron.d/Makefile   (contents, props changed)
> > >   head/etc/cron.d/at   (contents, props changed)
> > > Modified:
> > >   head/etc/Makefile
> > >   head/etc/crontab
> > > 
> > > Modified: head/etc/Makefile
> > > ==
> > > --- head/etc/Makefile Thu May 18 06:15:42 2017(r318440)
> > > +++ head/etc/Makefile Thu May 18 06:25:39 2017(r318441)
> > > @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
> > >  # No need as it is empty and just causes rebuilds since this file does 
> > > so much.
> > >  UPDATE_DEPENDFILE=   no
> > >  SUBDIR=  \
> > > + cron.d \
> > >   newsyslog.conf.d \
> > >   syslog.d
> > 
> > The thread on the newsyslog clearly shows that this is a contriversial 
> > change.
> > 
> > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
> > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> > desires of others.
> 
> Has multiple people has stated, on the newsyslog thread. this is not a
> DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
> 1. Consistency
>   as a project we do support building WITHOUT_FOO there is no reason to 
> install
>   syslog, cron configuration for FOO if the system was built without foo

Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
because it looks nice.

> 2. Packaging base
>   if one does not install at there is no need for the at crontab to be 
> installed
>   (same reason as 1.)

This is a viable reason except that it isn't fully baked yet.

> 3. Large deployment of freebsd farms
>   Being able to administrate thousands of FreeBSD machines, one often ends up
>   using tools like puppet, chef, ansible, cfengine. When programmatically
>   handling configuration management it is way easier and safer to simple
>   add/removes files in a directory rather than mangling^Winplace editing 
> files.

There's nothing preventing you now from deploying split files and an empty
global configuration file since the daemons support foo.d.  You don't require
that to change in upstream since you should be using some sort of VCS to
manage your configuration as it is.

> 4. Ports/packages
>   On can provide easily sample configuration for cron, syslog (not only) and 
> the
>   admin can decide to use it or not easily (ususally this is done by making
>   symlinks from the said file which would live in share/* into the .d 
> directory.
> 
> This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.

The support for broken out files has long been there, but the base system has
not used them previously for default config shipped during a release.  That
is in fact a new trend.

However, the current approach seems to be the absolute worst way to do this.
If someone wants to use the existing base system image and modify it with
config management, they now have to use a mix of styles (for some services
edit a global config file for certain settings, but use a dedicated file for
other settings for the same service, or for the same settings but a different
service).  It's also the worst case for humans trying to work with our system
as the division between which services are broken out vs global is
inconsistent and arbitrary.

Once you split up the files you make a merge conflict for anyone trying to do
an upgrade.  If we do this piecemail then we create N merge conflicts for users
to deal with as opposed to if you split it up all at once.

Also, there wasn't a clear consensus (a mail to arch@ with "hey, we should
switch to splitting up config files for reasons A and B and let's do this for
12.0 but not merge to stable so there is a clear flag day / sign post for users
to manage upgrades".  Instead there have been a couple of commits and any
not-in-100%-agreement opinions are ignored.

-- 
John Baldwin

Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Ian Lepore
On Thu, 2017-05-18 at 02:56 -0700, Rodney W. Grimes wrote:
> > 
> > Author: ngie
> > Date: Thu May 18 06:25:39 2017
> > New Revision: 318441
> > URL: https://svnweb.freebsd.org/changeset/base/318441
> > 
> > Log:
> >   Handle the cron.d entry for MK_AT in cron conditionally
> >   
> >   Install /etc/cron.d/at if MK_AT != no, always using it, which
> > tries
> >   to run a non-existent program via cron(8) every 5 minutes with
> > the
> >   default /etc/crontab, prior to this commit.
> >   
> >   SHELL and PATH are duplicated between /etc/crontab and
> > /etc/cron.d/at
> >   because atrun(8) executes programs, which may rely on environment
> >   currently set via /etc/crontab.
> >   
> >   Noted by: bdrewery (in an internal review)
> >   MFC after:2 months
> >   Relnotes: yes (may need to add environmental modifications
> > to
> >      /etc/cron.d/at)
> >   Sponsored by: Dell EMC Isilon
> > 
> > Added:
> >   head/etc/cron.d/
> >   head/etc/cron.d/Makefile   (contents, props changed)
> >   head/etc/cron.d/at   (contents, props changed)
> > Modified:
> >   head/etc/Makefile
> >   head/etc/crontab
> > 
> > Modified: head/etc/Makefile
> > ===
> > ===
> > --- head/etc/Makefile   Thu May 18 06:15:42 2017(r3184
> > 40)
> > +++ head/etc/Makefile   Thu May 18 06:25:39 2017(r3184
> > 41)
> > @@ -8,6 +8,7 @@ FILESGROUPS=FILES
> >  # No need as it is empty and just causes rebuilds since this file
> > does so much.
> >  UPDATE_DEPENDFILE= no
> >  SUBDIR=\
> > +   cron.d \
> >     newsyslog.conf.d \
> >     syslog.d
> The thread on the newsyslog clearly shows that this is a
> contriversial change.
> 
> I strongly object to further splitting of /etc/FOO into
> /etc/foo.d/FOO files
> to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs
> and
> desires of others.
> 

Actually, the newsyslog thread showed that 4 people supported Ngie's
changes, and 4 people objected to them.  Not exactly a raging
controversy.  Given how many people read this list, a pretty tepid
response really.

The objections seemed to boil down to:

 1. It's not how we've done it for years; I don't like newfangled
stuff.

 2. It's strange to have some stuff in the old monolithic file and some
in new little files in a directory.

 3. It will be hard to update existing systems.

I don't see any point in discussing #1 further (not because peoples'
opinions don't matter, but rather because there will never be universal
agreement no matter how much it's discussed).

I think #2 has some validity, but not as an argument for stopping or
undoing the changes, but more as a valid design issue to be discussed.
 Do we need an "all or nothing" rule when it comes to changing existing
config files to be fine-grained?  Or some other rule?  Right now I
infer the rule Ngie is using to be "if you can disable a component with
build/install controls, then its config should be fined-grained", and
that strikes me as a workable rule, but not the only one possible.

#3 seems like a strongly valid concern.  People following -current have
agreed to take on some pain to do so, but when 12.0-release hits the
streets there needs to be a way to upgrade existing systems without a
lot of pain.  What can we do to make it easier?

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Rodney W. Grimes
> On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > Author: ngie
> > > Date: Thu May 18 06:25:39 2017
> > > New Revision: 318441
> > > URL: https://svnweb.freebsd.org/changeset/base/318441
> > > 
> > > Log:
> > >   Handle the cron.d entry for MK_AT in cron conditionally
> > >   
> > >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
> > >   to run a non-existent program via cron(8) every 5 minutes with the
> > >   default /etc/crontab, prior to this commit.
> > >   
> > >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
> > >   because atrun(8) executes programs, which may rely on environment
> > >   currently set via /etc/crontab.
> > >   
> > >   Noted by:   bdrewery (in an internal review)
> > >   MFC after:  2 months
> > >   Relnotes:   yes (may need to add environmental modifications to
> > >/etc/cron.d/at)
> > >   Sponsored by:   Dell EMC Isilon
> > > 
> > > Added:
> > >   head/etc/cron.d/
> > >   head/etc/cron.d/Makefile   (contents, props changed)
> > >   head/etc/cron.d/at   (contents, props changed)
> > > Modified:
> > >   head/etc/Makefile
> > >   head/etc/crontab
> > > 
> > > Modified: head/etc/Makefile
> > > ==
> > > --- head/etc/Makefile Thu May 18 06:15:42 2017(r318440)
> > > +++ head/etc/Makefile Thu May 18 06:25:39 2017(r318441)
> > > @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
> > >  # No need as it is empty and just causes rebuilds since this file does 
> > > so much.
> > >  UPDATE_DEPENDFILE=   no
> > >  SUBDIR=  \
> > > + cron.d \
> > >   newsyslog.conf.d \
> > >   syslog.d
> > 
> > The thread on the newsyslog clearly shows that this is a contriversial 
> > change.
> > 
> > I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
> > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> > desires of others.
> 
> Has multiple people has stated, on the newsyslog thread. this is not a
> DELL/EMC/Isilon need, this is also a requirement for plenty of use cases

>From other mail in the newsyslog thread it was very evident that the
newsyslog changes where driven by a specific need and desire of
Dell/EMC/Isilon.  And as others pointed out that was more or less
in conflict with others needs and desires.  I did not see any conclusion
reached in that thread.

> 1. Consistency
>   as a project we do support building WITHOUT_FOO there is no reason to 
> install
>   syslog, cron configuration for FOO if the system was built without foo

And there are very clean ways to do this WITHOUT the need to make this a
bunch of seperate files.  This actually creates an inconsistent system,
do I manage crons FOO item with /etc/crontabl or /etc/cron.d/FOO?  

As I said lets do it one way or the other, but NOT a half baked some in
one file and some others split into seperate files.  Others expressed
this exact some issue, why is this issue being ignored?

I also stated that this could be done and meet the requirements of one file
with conditionalized Makefile syntax it is a trivial matter to create
a string of files to cat from the src/etc directory into the objdir with
the right lines in it based on if {${MK_FOO} knobs.

> 2. Packaging base
>   if one does not install at there is no need for the at crontab to be 
> installed
>   (same reason as 1.)

Lets cross that bridge when the package of base is done, and with a great
deal more engineering than this simple hack.The configuration management
of a packaged base is gona be a messy nightmare at best from what I am
seeing, especially if this is the road to be taken.

> 3. Large deployment of freebsd farms
>   Being able to administrate thousands of FreeBSD machines, one often ends up
>   using tools like puppet, chef, ansible, cfengine. When programmatically
>   handling configuration management it is way easier and safer to simple
>   add/removes files in a directory rather than mangling^Winplace editing 
> files.

This actually is breaking a massive deployment of both ansible and puppet
based management tools.  Again, how does splitting this into 2 files to
manage make it any easier to manage?  We now have to teach the management
tools to deal with both /etc/crontab and /etc/cron.d/at if I want it to
manage at.  And this tool has to be taught that FreeBSD < r318441 uses
one way and >=r318441 is another way.

> 4. Ports/packages
>   On can provide easily sample configuration for cron, syslog (not only) and 
> the
>   admin can decide to use it or not easily (ususally this is done by making
>   symlinks from the said file which would live in share/* into the .d 
> directory.

These files for ports/packages do not belong in /etc/cron.d but in
/usr/local/etc/cron.d, I would fully support that as an addition if it
does not exist, but that has nothing to do with /etc/crontab or /etc
cron.d, or moving of 1 single /etc/crontab 

Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Hans Petter Selasky

On 05/18/17 17:00, Oleg Bulyzhin wrote:

On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:

On 05/18/17 16:04, Oleg Bulyzhin wrote:

On Thu, Sep 01, 2016 at 06:32:35AM +, Sepherosa Ziehau wrote:

Author: sephe
Date: Thu Sep  1 06:32:35 2016
New Revision: 305177
URL: https://svnweb.freebsd.org/changeset/base/305177

Log:
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

Reviewed by:	araujo, hps

MFC after:  1 week
Sponsored by:   Microsoft
Differential Revision:  https://reviews.freebsd.org/D7710

Modified:
head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Thu Sep  1 06:05:08 2016(r305176)
+++ head/sys/net/ethernet.h Thu Sep  1 06:32:35 2016(r305177)
@@ -92,7 +92,7 @@ struct ether_vlan_header {
   #define  EVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
   #define  EVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
   #define  EVL_MAKETAG(vlid, pri, cfi) 
\
-   ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
+   ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
   
   /*

*  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.


Please revert this one. It's just plain wrong and previous one was ok.



Hi,

Can you explain a bit more what is wrong?


If you care about readability it should be:
pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))


Isn't this exactly what the patch is doing? -R ???


Current version is shifting pri out of uint16. If you examine parentheses:
pri is shifted left 13, then 12.
Original version did it right (shift 1, then 12 (total 13)).



Hi Oleg,

I see. The VLAN priority is then always zero after this change.

I'll let Sepherosa handle the revert and/or readability update.

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Benjamin Kaduk
On Thu, May 18, 2017 at 10:00 AM, Oleg Bulyzhin  wrote:

> On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
> >
> > Can you explain a bit more what is wrong?
> >
> > > If you care about readability it should be:
> > > pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
> >
> > Isn't this exactly what the patch is doing? -R ???
>
> Current version is shifting pri out of uint16. If you examine parentheses:
> pri is shifted left 13, then 12.
> Original version did it right (shift 1, then 12 (total 13)).
>

Calculations in the C abstract machine would be performed in the 'int' type
to which uint16 operands are promoted, though.

-Ben
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Oleg Bulyzhin
On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote:
> On 05/18/17 16:04, Oleg Bulyzhin wrote:
> > On Thu, Sep 01, 2016 at 06:32:35AM +, Sepherosa Ziehau wrote:
> >> Author: sephe
> >> Date: Thu Sep  1 06:32:35 2016
> >> New Revision: 305177
> >> URL: https://svnweb.freebsd.org/changeset/base/305177
> >>
> >> Log:
> >>net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
> >>
> >>Reviewed by:araujo, hps
> >>MFC after:  1 week
> >>Sponsored by:   Microsoft
> >>Differential Revision:  https://reviews.freebsd.org/D7710
> >>
> >> Modified:
> >>head/sys/net/ethernet.h
> >>
> >> Modified: head/sys/net/ethernet.h
> >> ==
> >> --- head/sys/net/ethernet.hThu Sep  1 06:05:08 2016
> >> (r305176)
> >> +++ head/sys/net/ethernet.hThu Sep  1 06:32:35 2016
> >> (r305177)
> >> @@ -92,7 +92,7 @@ struct ether_vlan_header {
> >>   #define  EVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
> >>   #define  EVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
> >>   #define  EVL_MAKETAG(vlid, pri, cfi) 
> >> \
> >> -  ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
> >> +  ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
> >>   
> >>   /*
> >>*  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.
> > 
> > Please revert this one. It's just plain wrong and previous one was ok.
> > 
> 
> Hi,
> 
> Can you explain a bit more what is wrong?
> 
> > If you care about readability it should be:
> > pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))
> 
> Isn't this exactly what the patch is doing? -R ???

Current version is shifting pri out of uint16. If you examine parentheses:
pri is shifted left 13, then 12.
Original version did it right (shift 1, then 12 (total 13)).


-- 
Oleg.


=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- o...@rinet.ru ===


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Hans Petter Selasky

On 05/18/17 16:04, Oleg Bulyzhin wrote:

On Thu, Sep 01, 2016 at 06:32:35AM +, Sepherosa Ziehau wrote:

Author: sephe
Date: Thu Sep  1 06:32:35 2016
New Revision: 305177
URL: https://svnweb.freebsd.org/changeset/base/305177

Log:
   net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
   
   Reviewed by:	araujo, hps

   MFC after:   1 week
   Sponsored by:Microsoft
   Differential Revision:   https://reviews.freebsd.org/D7710

Modified:
   head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Thu Sep  1 06:05:08 2016(r305176)
+++ head/sys/net/ethernet.h Thu Sep  1 06:32:35 2016(r305177)
@@ -92,7 +92,7 @@ struct ether_vlan_header {
  #define   EVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
  #define   EVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
  #define   EVL_MAKETAG(vlid, pri, cfi) 
\
-   ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
+   ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
  
  /*

   *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.


Please revert this one. It's just plain wrong and previous one was ok.



Hi,

Can you explain a bit more what is wrong?


If you care about readability it should be:
pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))


Isn't this exactly what the patch is doing? -R ???

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318452 - in head/usr.sbin/makefs: . ffs

2017-05-18 Thread Emmanuel Vadot
Author: manu
Date: Thu May 18 14:19:06 2017
New Revision: 318452
URL: https://svnweb.freebsd.org/changeset/base/318452

Log:
  makefs: Add soft-updates option
  
  Add the ffs option to enable soft-updates.
  The option is only processed is ufs2 has been selected.
  
  Reviewed by:  emaste, bapt (earlier version), allanjude (earlier version)
  Sponsored by: Gandi.net
  Differential Revision:https://reviews.freebsd.org/D10773

Modified:
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs.h
  head/usr.sbin/makefs/ffs/mkfs.c
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Thu May 18 14:05:29 2017(r318451)
+++ head/usr.sbin/makefs/ffs.c  Thu May 18 14:19:06 2017(r318452)
@@ -176,6 +176,8 @@ ffs_prep_opts(fsinfo_t *fsopts)
  0, 0, "Optimization (time|space)" },
{ 'l', "label", ffs_opts->label, OPT_STRARRAY,
  1, sizeof(ffs_opts->label), "UFS label" },
+   { 's', "softupdates", _opts->softupdates, OPT_INT32,
+ 0, 1, "enable softupdates" },
{ .name = NULL }
};
 
@@ -190,6 +192,7 @@ ffs_prep_opts(fsinfo_t *fsopts)
ffs_opts->avgfilesize= -1;
ffs_opts->avgfpdir= -1;
ffs_opts->version = 1;
+   ffs_opts->softupdates = 0;
 
fsopts->fs_specific = ffs_opts;
fsopts->fs_options = copy_opts(ffs_options);

Modified: head/usr.sbin/makefs/ffs.h
==
--- head/usr.sbin/makefs/ffs.h  Thu May 18 14:05:29 2017(r318451)
+++ head/usr.sbin/makefs/ffs.h  Thu May 18 14:19:06 2017(r318452)
@@ -64,6 +64,7 @@ typedef struct {
int version;/* filesystem version (1 = FFS, 2 = UFS2) */
int maxbsize;   /* maximum extent size */
int maxblkspercg;   /* max # of blocks per cylinder group */
+   int softupdates;/* soft updates */
/* XXX: support `old' file systems ? */
 } ffs_opt_t;
 

Modified: head/usr.sbin/makefs/ffs/mkfs.c
==
--- head/usr.sbin/makefs/ffs/mkfs.c Thu May 18 14:05:29 2017
(r318451)
+++ head/usr.sbin/makefs/ffs/mkfs.c Thu May 18 14:19:06 2017
(r318452)
@@ -279,6 +279,8 @@ ffs_mkfs(const char *fsys, const fsinfo_
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
sblock.fs_maxsymlinklen = ((UFS_NDADDR + UFS_NIADDR) *
sizeof (ufs2_daddr_t));
+   if (ffs_opts->softupdates == 1)
+   sblock.fs_flags |= FS_DOSOFTDEP;
}
 
sblock.fs_sblkno =

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Thu May 18 14:05:29 2017
(r318451)
+++ head/usr.sbin/makefs/makefs.8   Thu May 18 14:19:06 2017
(r318452)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 6, 2017
+.Dd May 17, 2017
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -308,6 +308,8 @@ Maximum total number of blocks in a cyli
 .It Sy version
 UFS version.
 1 for FFS (default), 2 for UFS2.
+.It Sy softupdates
+0 for disable (default), 1 for enable
 .El
 .Ss CD9660-specific options
 .Sy cd9660
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r305177 - head/sys/net

2017-05-18 Thread Oleg Bulyzhin
On Thu, Sep 01, 2016 at 06:32:35AM +, Sepherosa Ziehau wrote:
> Author: sephe
> Date: Thu Sep  1 06:32:35 2016
> New Revision: 305177
> URL: https://svnweb.freebsd.org/changeset/base/305177
> 
> Log:
>   net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
>   
>   Reviewed by:araujo, hps
>   MFC after:  1 week
>   Sponsored by:   Microsoft
>   Differential Revision:  https://reviews.freebsd.org/D7710
> 
> Modified:
>   head/sys/net/ethernet.h
> 
> Modified: head/sys/net/ethernet.h
> ==
> --- head/sys/net/ethernet.h   Thu Sep  1 06:05:08 2016(r305176)
> +++ head/sys/net/ethernet.h   Thu Sep  1 06:32:35 2016(r305177)
> @@ -92,7 +92,7 @@ struct ether_vlan_header {
>  #define  EVL_PRIOFTAG(tag)   (((tag) >> 13) & 7)
>  #define  EVL_CFIOFTAG(tag)   (((tag) >> 12) & 1)
>  #define  EVL_MAKETAG(vlid, pri, cfi) 
> \
> - ((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
> + ((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
>  
>  /*
>   *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.

Please revert this one. It's just plain wrong and previous one was ok.

If you care about readability it should be: 
pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK))

-- 
Oleg.


=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- o...@rinet.ru ===


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318451 - in head/usr.sbin/makefs: . ffs

2017-05-18 Thread Ed Maste
Author: emaste
Date: Thu May 18 14:05:29 2017
New Revision: 318451
URL: https://svnweb.freebsd.org/changeset/base/318451

Log:
  makefs: clean up signedness warnings and bump WARNS to 3
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D10650

Modified:
  head/usr.sbin/makefs/Makefile
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs/ffs_alloc.c
  head/usr.sbin/makefs/ffs/ffs_balloc.c
  head/usr.sbin/makefs/ffs/ffs_bswap.c
  head/usr.sbin/makefs/mtree.c

Modified: head/usr.sbin/makefs/Makefile
==
--- head/usr.sbin/makefs/Makefile   Thu May 18 13:49:53 2017
(r318450)
+++ head/usr.sbin/makefs/Makefile   Thu May 18 14:05:29 2017
(r318451)
@@ -14,7 +14,7 @@ SRCS= cd9660.c ffs.c \
walk.c
 MAN=   makefs.8
 
-WARNS?=2
+WARNS?=3
 
 .include "${SRCDIR}/cd9660/Makefile.inc"
 .include "${SRCDIR}/ffs/Makefile.inc"

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Thu May 18 13:49:53 2017(r318450)
+++ head/usr.sbin/makefs/ffs.c  Thu May 18 14:05:29 2017(r318451)
@@ -1065,10 +1065,11 @@ ffs_write_inode(union dinode *dp, uint32
struct ufs2_dinode *dp2, *dip;
struct cg   *cgp;
struct fs   *fs;
-   int cg, cgino, i;
+   int cg, cgino;
+   uint32_ti;
daddr_t d;
charsbbuf[FFS_MAXBSIZE];
-   int32_t initediblk;
+   uint32_tinitediblk;
ffs_opt_t   *ffs_opts = fsopts->fs_specific;
 
assert (dp != NULL);

Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c
==
--- head/usr.sbin/makefs/ffs/ffs_alloc.cThu May 18 13:49:53 2017
(r318450)
+++ head/usr.sbin/makefs/ffs/ffs_alloc.cThu May 18 14:05:29 2017
(r318451)
@@ -64,7 +64,7 @@ static int scanc(u_int, const u_char *, 
 
 static daddr_t ffs_alloccg(struct inode *, int, daddr_t, int);
 static daddr_t ffs_alloccgblk(struct inode *, struct buf *, daddr_t);
-static daddr_t ffs_hashalloc(struct inode *, int, daddr_t, int,
+static daddr_t ffs_hashalloc(struct inode *, u_int, daddr_t, int,
 daddr_t (*)(struct inode *, int, daddr_t, int));
 static int32_t ffs_mapsearch(struct fs *, struct cg *, daddr_t, int);
 
@@ -152,8 +152,8 @@ daddr_t
 ffs_blkpref_ufs1(struct inode *ip, daddr_t lbn, int indx, int32_t *bap)
 {
struct fs *fs;
-   int cg;
-   int avgbfree, startcg;
+   u_int cg, startcg;
+   int avgbfree;
 
fs = ip->i_fs;
if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
@@ -191,8 +191,8 @@ daddr_t
 ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap)
 {
struct fs *fs;
-   int cg;
-   int avgbfree, startcg;
+   u_int cg, startcg;
+   int avgbfree;
 
fs = ip->i_fs;
if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
@@ -240,12 +240,12 @@ ffs_blkpref_ufs2(struct inode *ip, daddr
  */
 /*VARARGS5*/
 static daddr_t
-ffs_hashalloc(struct inode *ip, int cg, daddr_t pref, int size,
+ffs_hashalloc(struct inode *ip, u_int cg, daddr_t pref, int size,
 daddr_t (*allocator)(struct inode *, int, daddr_t, int))
 {
struct fs *fs;
daddr_t result;
-   int i, icg = cg;
+   u_int i, icg = cg;
 
fs = ip->i_fs;
/*

Modified: head/usr.sbin/makefs/ffs/ffs_balloc.c
==
--- head/usr.sbin/makefs/ffs/ffs_balloc.c   Thu May 18 13:49:53 2017
(r318450)
+++ head/usr.sbin/makefs/ffs/ffs_balloc.c   Thu May 18 14:05:29 2017
(r318451)
@@ -123,7 +123,8 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
 
if (lbn < UFS_NDADDR) {
nb = ufs_rw32(ip->i_ffs1_db[lbn], needswap);
-   if (nb != 0 && ip->i_ffs1_size >= lblktosize(fs, lbn + 1)) {
+   if (nb != 0 && ip->i_ffs1_size >=
+   (uint64_t)lblktosize(fs, lbn + 1)) {
 
/*
 * The block is an already-allocated direct block
@@ -178,7 +179,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
 * allocate a new block or fragment.
 */
 
-   if (ip->i_ffs1_size < lblktosize(fs, lbn + 1))
+   if (ip->i_ffs1_size < (uint64_t)lblktosize(fs, lbn + 1))
nsize = fragroundup(fs, size);
else
nsize = fs->fs_bsize;
@@ -373,7 +374,8 @@ ffs_balloc_ufs2(struct inode *ip, off_t 
 
if (lbn < UFS_NDADDR) {
nb = ufs_rw64(ip->i_ffs2_db[lbn], needswap);
-   if (nb != 0 && 

svn commit: r318450 - head/lib/libc/tests/gen

2017-05-18 Thread Konstantin Belousov
Author: kib
Date: Thu May 18 13:49:53 2017
New Revision: 318450
URL: https://svnweb.freebsd.org/changeset/base/318450

Log:
  Add tests for some cases in r318298.
  
  The first test triggers the out of bounds read of the 'left' array. It
  only fails when realpath.c is compiled with '-fsanitize=address'.
  
  The other test checks for ENOENT when running into an empty
  symlink. This matches NetBSD's realpath(3) semantics. Previously,
  empty symlinks were treated like ".".
  
  Submitted by: Jan Kokemц╪ller 
  PR:   219154
  MFC after:2 weeks

Added:
  head/lib/libc/tests/gen/realpath2_test.c   (contents, props changed)
Modified:
  head/lib/libc/tests/gen/Makefile

Modified: head/lib/libc/tests/gen/Makefile
==
--- head/lib/libc/tests/gen/MakefileThu May 18 13:19:07 2017
(r318449)
+++ head/lib/libc/tests/gen/MakefileThu May 18 13:49:53 2017
(r318450)
@@ -13,6 +13,7 @@ ATF_TESTS_C+= popen_test
 ATF_TESTS_C+=  posix_spawn_test
 ATF_TESTS_C+=  wordexp_test
 ATF_TESTS_C+=  dlopen_empty_test
+ATF_TESTS_C+=  realpath2_test
 
 # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid,
 # TODO: t_siginfo (fixes require further inspection)

Added: head/lib/libc/tests/gen/realpath2_test.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/tests/gen/realpath2_test.cThu May 18 13:49:53 2017
(r318450)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2017 Jan Kokemüller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+ATF_TC(realpath_buffer_overflow);
+ATF_TC_HEAD(realpath_buffer_overflow, tc)
+{
+   atf_tc_set_md_var(tc, "descr",
+   "Test for out of bounds read from 'left' array "
+   "(compile realpath.c with '-fsanitize=address')");
+}
+
+ATF_TC_BODY(realpath_buffer_overflow, tc)
+{
+   char path[MAXPATHLEN] = { 0 };
+   char resb[MAXPATHLEN] = { 0 };
+   size_t i;
+
+   path[0] = 'a';
+   path[1] = '/';
+   for (i = 2; i < sizeof(path) - 1; ++i) {
+   path[i] = 'a';
+   }
+
+   ATF_REQUIRE(realpath(path, resb) == NULL);
+}
+
+ATF_TC(realpath_empty_symlink);
+ATF_TC_HEAD(realpath_empty_symlink, tc)
+{
+   atf_tc_set_md_var(tc, "descr",
+   "Test for correct behavior when encountering empty symlinks");
+}
+
+ATF_TC_BODY(realpath_empty_symlink, tc)
+{
+   char path[MAXPATHLEN] = { 0 };
+   char slnk[MAXPATHLEN] = { 0 };
+   char resb[MAXPATHLEN] = { 0 };
+   int fd;
+
+   (void)strlcat(slnk, "empty_symlink", sizeof(slnk));
+
+   ATF_REQUIRE(symlink("", slnk) == 0);
+
+   fd = open("aaa", O_RDONLY | O_CREAT, 0600);
+
+   ATF_REQUIRE(fd >= 0);
+   ATF_REQUIRE(close(fd) == 0);
+
+   (void)strlcat(path, "empty_symlink", sizeof(path));
+   (void)strlcat(path, "/aaa", sizeof(path));
+
+   ATF_REQUIRE_ERRNO(ENOENT, realpath(path, resb) == NULL);
+
+   ATF_REQUIRE(unlink("aaa") == 0);
+   ATF_REQUIRE(unlink(slnk) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+   ATF_TP_ADD_TC(tp, realpath_buffer_overflow);
+   ATF_TP_ADD_TC(tp, realpath_empty_symlink);
+
+   return atf_no_error();
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r318431 - head/libexec/rtld-elf

2017-05-18 Thread Jonathan Anderson



On 05/18/17 04:13, Baptiste Daroussin wrote:

On Wed, May 17, 2017 at 10:51:28PM +, Jonathan Anderson wrote:
  
+void print_usage(const char *argv0)

Style(9) bug :)


Duly noted. :)

It looks like kib@ has already sorted this out in his timezone.


Jon

--
jonat...@freebsd.org

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Baptiste Daroussin
On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > Author: ngie
> > Date: Thu May 18 06:25:39 2017
> > New Revision: 318441
> > URL: https://svnweb.freebsd.org/changeset/base/318441
> > 
> > Log:
> >   Handle the cron.d entry for MK_AT in cron conditionally
> >   
> >   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
> >   to run a non-existent program via cron(8) every 5 minutes with the
> >   default /etc/crontab, prior to this commit.
> >   
> >   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
> >   because atrun(8) executes programs, which may rely on environment
> >   currently set via /etc/crontab.
> >   
> >   Noted by: bdrewery (in an internal review)
> >   MFC after:2 months
> >   Relnotes: yes (may need to add environmental modifications to
> >  /etc/cron.d/at)
> >   Sponsored by: Dell EMC Isilon
> > 
> > Added:
> >   head/etc/cron.d/
> >   head/etc/cron.d/Makefile   (contents, props changed)
> >   head/etc/cron.d/at   (contents, props changed)
> > Modified:
> >   head/etc/Makefile
> >   head/etc/crontab
> > 
> > Modified: head/etc/Makefile
> > ==
> > --- head/etc/Makefile   Thu May 18 06:15:42 2017(r318440)
> > +++ head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
> > @@ -8,6 +8,7 @@ FILESGROUPS=FILES
> >  # No need as it is empty and just causes rebuilds since this file does so 
> > much.
> >  UPDATE_DEPENDFILE= no
> >  SUBDIR=\
> > +   cron.d \
> > newsyslog.conf.d \
> > syslog.d
> 
> The thread on the newsyslog clearly shows that this is a contriversial change.
> 
> I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
> to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> desires of others.

Has multiple people has stated, on the newsyslog thread. this is not a
DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
1. Consistency
  as a project we do support building WITHOUT_FOO there is no reason to install
  syslog, cron configuration for FOO if the system was built without foo

2. Packaging base
  if one does not install at there is no need for the at crontab to be installed
  (same reason as 1.)

3. Large deployment of freebsd farms
  Being able to administrate thousands of FreeBSD machines, one often ends up
  using tools like puppet, chef, ansible, cfengine. When programmatically
  handling configuration management it is way easier and safer to simple
  add/removes files in a directory rather than mangling^Winplace editing files.

4. Ports/packages
  On can provide easily sample configuration for cron, syslog (not only) and the
  admin can decide to use it or not easily (ususally this is done by making
  symlinks from the said file which would live in share/* into the .d directory.

This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.

Best regards,
Bapt


signature.asc
Description: PGP signature


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Nikolai Lifanov
On 05/18/2017 05:56, Rodney W. Grimes wrote:
>> Author: ngie
>> Date: Thu May 18 06:25:39 2017
>> New Revision: 318441
>> URL: https://svnweb.freebsd.org/changeset/base/318441
>>
>> Log:
>>   Handle the cron.d entry for MK_AT in cron conditionally
>>   

> 
> The thread on the newsyslog clearly shows that this is a contriversial change.
> 
> I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
> to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
> desires of others.
> 

I'm not an appliance vendor and am not affiliated with Dell/EMC/Isilon
and this change served my needs and desires.

When automating configuration management, templating a file instead of
conditionally installing/removing configuration snippets is:

1) less performant because you can't just check mtime of the expanded
template vs. the source file to figure out whether to expand it again,
which affects practical frequency of configuration runs
2) couples logic from unrelated configuration modules, making working on
different configuration with different people more difficult

I really wish we had /etc/fstab.d/ :)

> I especially object to it being done on a 1 of case, either completly split
> the file or make it 1 file, but making it this miss match is just adding to
> the work load of ansible and puppet task writting.  You now have to mange
> 2 config files rather than 1 for cron, and 7 for newsyslog instead of 1.
> 

I agree that inconsistencies are bad, but I think we can get there
incrementally, unbundling configuration of one MK_* thing at a time.

- Nikolai Lifanov



signature.asc
Description: OpenPGP digital signature


svn commit: r318448 - head/usr.bin/top

2017-05-18 Thread Allan Jude
Author: allanjude
Date: Thu May 18 12:55:07 2017
New Revision: 318448
URL: https://svnweb.freebsd.org/changeset/base/318448

Log:
  Explain the new fields in top(1) related to ZFS compressed ARC
  
  Reviewed by:  bcr
  X-MFC-with:   316314
  Differential Revision:https://reviews.freebsd.org/D10781

Modified:
  head/usr.bin/top/top.local.1

Modified: head/usr.bin/top/top.local.1
==
--- head/usr.bin/top/top.local.1Thu May 18 12:27:41 2017
(r318447)
+++ head/usr.bin/top/top.local.1Thu May 18 12:55:07 2017
(r318448)
@@ -2,9 +2,10 @@
 .SH "FreeBSD NOTES"
 
 .SH DESCRIPTION OF MEMORY
-Mem: 9220K Active, 1M Inact, 1M Laundry, 3284K Wired, 2M Buf, 932K Free
-ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 96K Header, 442K Other
-Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out
+Mem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free
+ARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other
+ 15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead
+Swap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out
 .TP
 .B K:
 Kilobyte
@@ -54,8 +55,20 @@ number of ARC bytes holding in flight da
 .B Header:
 number of ARC bytes holding headers
 .TP
-.B Other
+.B Other:
 miscellaneous ARC bytes
+.TP
+.B Compressed:
+bytes of memory used by ARC caches
+.TP
+.B Uncompressed:
+bytes of data stored in ARC caches before compression
+.TP
+.B Ratio:
+ratio of uncompressed data to total ARC size
+.TP
+.B Overhead:
+amount of overhead from ARC compression
 .SS Swap Stats
 .TP
 .B Total:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Rodney W. Grimes
> Author: ngie
> Date: Thu May 18 06:25:39 2017
> New Revision: 318441
> URL: https://svnweb.freebsd.org/changeset/base/318441
> 
> Log:
>   Handle the cron.d entry for MK_AT in cron conditionally
>   
>   Install /etc/cron.d/at if MK_AT != no, always using it, which tries
>   to run a non-existent program via cron(8) every 5 minutes with the
>   default /etc/crontab, prior to this commit.
>   
>   SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
>   because atrun(8) executes programs, which may rely on environment
>   currently set via /etc/crontab.
>   
>   Noted by:   bdrewery (in an internal review)
>   MFC after:  2 months
>   Relnotes:   yes (may need to add environmental modifications to
>/etc/cron.d/at)
>   Sponsored by:   Dell EMC Isilon
> 
> Added:
>   head/etc/cron.d/
>   head/etc/cron.d/Makefile   (contents, props changed)
>   head/etc/cron.d/at   (contents, props changed)
> Modified:
>   head/etc/Makefile
>   head/etc/crontab
> 
> Modified: head/etc/Makefile
> ==
> --- head/etc/Makefile Thu May 18 06:15:42 2017(r318440)
> +++ head/etc/Makefile Thu May 18 06:25:39 2017(r318441)
> @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
>  # No need as it is empty and just causes rebuilds since this file does so 
> much.
>  UPDATE_DEPENDFILE=   no
>  SUBDIR=  \
> + cron.d \
>   newsyslog.conf.d \
>   syslog.d

The thread on the newsyslog clearly shows that this is a contriversial change.

I strongly object to further splitting of /etc/FOO into /etc/foo.d/FOO files
to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs and
desires of others.

I especially object to it being done on a 1 of case, either completly split
the file or make it 1 file, but making it this miss match is just adding to
the work load of ansible and puppet task writting.  You now have to mange
2 config files rather than 1 for cron, and 7 for newsyslog instead of 1.

> Added: head/etc/cron.d/Makefile
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/etc/cron.d/Makefile  Thu May 18 06:25:39 2017(r318441)
> @@ -0,0 +1,11 @@
> +# $FreeBSD$
> +
> +.include 
> +
> +.if ${MK_AT} != "no"
> +FILES+=  at
> +.endif
> +
> +BINDIR=  /etc/cron.d
> +
> +.include 
> 
> Added: head/etc/cron.d/at
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/etc/cron.d/atThu May 18 06:25:39 2017(r318441)
> @@ -0,0 +1,7 @@
> +# $FreeBSD$
> +#
> +SHELL=/bin/sh
> +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
> +
> +# See crontab(5) for field format.
> +*/5  *   *   *   *   root/usr/libexec/atrun
> 
> Modified: head/etc/crontab
> ==
> --- head/etc/crontab  Thu May 18 06:15:42 2017(r318440)
> +++ head/etc/crontab  Thu May 18 06:25:39 2017(r318441)
> @@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
>  #
>  #minute  hourmdaymonth   wdaywho command
>  #
> -*/5  *   *   *   *   root/usr/libexec/atrun
> -#
>  # Save some entropy so that /dev/random can re-seed on boot.
>  */11 *   *   *   *   operator /usr/libexec/save-entropy
>  #
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318400 - head/sbin/ipfw

2017-05-18 Thread Rodney W. Grimes
-- Start of PGP signed section.
[ Charset UTF-8 unsupported, converting... ]
> On 18.05.2017 03:49, Rodney W. Grimes wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> >> Author: ae
> >> Date: Wed May 17 10:56:22 2017
> >> New Revision: 318400
> >> URL: https://svnweb.freebsd.org/changeset/base/318400
> >>
> >> Log:
> >>   Allow zero port specification in table entries with type flow.
> >>   
> >>   PR:  217620
> >>   MFC after:   1 week
> >>
> >> Modified:
> >>   head/sbin/ipfw/tables.c
> >>
> >> Modified: head/sbin/ipfw/tables.c
> >> ==
> >> --- head/sbin/ipfw/tables.cWed May 17 09:04:09 2017
> >> (r318399)
> >> +++ head/sbin/ipfw/tables.cWed May 17 10:56:22 2017
> >> (r318400)
> >> @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj
> >>if ((p = strchr(arg, ',')) != NULL)
> >>*p++ = '\0';
> >>  
> >> -  if ((port = htons(strtol(arg, NULL, 10))) == 0) {
> >> +  port = htons(strtol(arg, , 10));
> >   ^^^
> > Can this be converted to a sizeof(foo) somehow?
> > Constants like this are typically bad style and lead to bugs.
> 
> This means that decimal number is expected in the string.
> Not sure what bugs this can lead to.

Ignore me, my brain was reading strtok as strncpy and expecting
the third argument to be length limit.

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318446 - head/libexec/rtld-elf

2017-05-18 Thread Konstantin Belousov
Author: kib
Date: Thu May 18 09:34:26 2017
New Revision: 318446
URL: https://svnweb.freebsd.org/changeset/base/318446

Log:
  Update my copyright, note The FreeBSD Foundation involvement.
  While tweaking copyright block, switch to use __FBSDID for tag.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cThu May 18 09:31:30 2017
(r318445)
+++ head/libexec/rtld-elf/rtld.cThu May 18 09:34:26 2017
(r318446)
@@ -1,10 +1,14 @@
 /*-
  * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
  * Copyright 2003 Alexander Kabaev .
- * Copyright 2009-2012 Konstantin Belousov .
+ * Copyright 2009-2013 Konstantin Belousov .
  * Copyright 2012 John Marino .
+ * Copyright 2014-2017 The FreeBSD Foundation
  * All rights reserved.
  *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -24,8 +28,6 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
 /*
@@ -34,6 +36,9 @@
  * John Polstra .
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318445 - head/libexec/rtld-elf

2017-05-18 Thread Konstantin Belousov
Author: kib
Date: Thu May 18 09:31:30 2017
New Revision: 318445
URL: https://svnweb.freebsd.org/changeset/base/318445

Log:
  Fix style [1], add static keyword before static function definition.
  
  Noted by: bapt [1]
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cThu May 18 08:25:07 2017
(r318444)
+++ head/libexec/rtld-elf/rtld.cThu May 18 09:31:30 2017
(r318445)
@@ -5378,7 +5378,8 @@ parse_integer(const char *str)
return (n);
 }
 
-void print_usage(const char *argv0)
+static void
+print_usage(const char *argv0)
 {
 
rtld_printf("Usage: %s [-h] [-f ] [--]  []\n"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318444 - head/sys/geom

2017-05-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 18 08:25:07 2017
New Revision: 318444
URL: https://svnweb.freebsd.org/changeset/base/318444

Log:
  Fix typo.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/geom_vfs.c

Modified: head/sys/geom/geom_vfs.c
==
--- head/sys/geom/geom_vfs.cThu May 18 06:33:55 2017(r318443)
+++ head/sys/geom/geom_vfs.cThu May 18 08:25:07 2017(r318444)
@@ -168,7 +168,7 @@ g_vfs_strategy(struct bufobj *bo, struct
sc = cp->geom->softc;
 
/*
-* If the provider has orphaned us, just return EXIO.
+* If the provider has orphaned us, just return ENXIO.
 */
mtx_lock(>sc_mtx);
if (sc->sc_orphaned) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318431 - head/libexec/rtld-elf

2017-05-18 Thread Baptiste Daroussin
On Wed, May 17, 2017 at 10:51:28PM +, Jonathan Anderson wrote:
> Author: jonathan
> Date: Wed May 17 22:51:28 2017
> New Revision: 318431
> URL: https://svnweb.freebsd.org/changeset/base/318431
> 
> Log:
>   Allow rtld direct-exec to take a file descriptor.
>   
[snip]
> +}
> +
> +/*
>   * Parse a file descriptor number without pulling in more of libc (e.g. 
> atoi).
>   */
>  static int
> @@ -5300,6 +5378,20 @@ parse_integer(const char *str)
>   return (n);
>  }
>  
> +void print_usage(const char *argv0)

Style(9) bug :)

> +{
> +
> + rtld_printf("Usage: %s [-h] [-f ] [--]  []\n"
> + "\n"
> + "Options:\n"
> + "  -hDisplay this help message\n"
> + /* TODO: "  -pSearch in PATH for named binary\n" */
> + "  -fExecute  instead of searching for \n"
> + "  --End of RTLD options\n"
> + "Name of process to execute\n"
> + "  Arguments to the executed process\n", argv0);
> +}
> +
>  /*
>   * Overrides for libc_pic-provided functions.
>   */
> 


signature.asc
Description: PGP signature


svn commit: r318443 - in head/etc: . cron.d

2017-05-18 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:33:55 2017
New Revision: 318443
URL: https://svnweb.freebsd.org/changeset/base/318443

Log:
  Conditionally handle the crontab entry for atrun(8)
  
  The default crontab prior to this commit assumes atrun(8) is always
  present, which isn't true if MK_AT == no. Move atrun(8) execution
  from /etc/crontab to /etc/cron.d/at, and base /etc/cron.d/at's installation
  on MK_AT. cron(8) will detect /etc/cron.d/at's presence when the configuration
  is loaded and run atrun every 5 minutes like it would prior to this commit.
  
  SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
  because atrun(8) executes programs, which may rely on environment
  set in the current default /etc/crontab.
  
  Noted by: bdrewery (in an internal review)
  MFC after:2 months
  Relnotes: yes (may need to add environmental modifications to
 /etc/cron.d/at)
  Sponsored by: Dell EMC Isilon

Added:
  head/etc/cron.d/
  head/etc/cron.d/Makefile   (contents, props changed)
  head/etc/cron.d/at   (contents, props changed)
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:27:37 2017(r318442)
+++ head/etc/Makefile   Thu May 18 06:33:55 2017(r318443)
@@ -8,6 +8,7 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
+   cron.d \
newsyslog.conf.d \
syslog.d
 

Added: head/etc/cron.d/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/MakefileThu May 18 06:33:55 2017(r318443)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include 
+
+.if ${MK_AT} != "no"
+FILES+=at
+.endif
+
+BINDIR=/etc/cron.d
+
+.include 

Added: head/etc/cron.d/at
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/at  Thu May 18 06:33:55 2017(r318443)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+#
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+
+# See crontab(5) for field format.
+*/5*   *   *   *   root/usr/libexec/atrun

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:27:37 2017(r318442)
+++ head/etc/crontabThu May 18 06:33:55 2017(r318443)
@@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
-*/5*   *   *   *   root/usr/libexec/atrun
-#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318442 - in head/etc: . cron.d

2017-05-18 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:27:37 2017
New Revision: 318442
URL: https://svnweb.freebsd.org/changeset/base/318442

Log:
  Revert r318441: the commit message was incoherent

Deleted:
  head/etc/cron.d/
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
+++ head/etc/Makefile   Thu May 18 06:27:37 2017(r318442)
@@ -8,7 +8,6 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
-   cron.d \
newsyslog.conf.d \
syslog.d
 

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:25:39 2017(r318441)
+++ head/etc/crontabThu May 18 06:27:37 2017(r318442)
@@ -7,6 +7,8 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
+*/5*   *   *   *   root/usr/libexec/atrun
+#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318441 - in head/etc: . cron.d

2017-05-18 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:25:39 2017
New Revision: 318441
URL: https://svnweb.freebsd.org/changeset/base/318441

Log:
  Handle the cron.d entry for MK_AT in cron conditionally
  
  Install /etc/cron.d/at if MK_AT != no, always using it, which tries
  to run a non-existent program via cron(8) every 5 minutes with the
  default /etc/crontab, prior to this commit.
  
  SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
  because atrun(8) executes programs, which may rely on environment
  currently set via /etc/crontab.
  
  Noted by: bdrewery (in an internal review)
  MFC after:2 months
  Relnotes: yes (may need to add environmental modifications to
 /etc/cron.d/at)
  Sponsored by: Dell EMC Isilon

Added:
  head/etc/cron.d/
  head/etc/cron.d/Makefile   (contents, props changed)
  head/etc/cron.d/at   (contents, props changed)
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:15:42 2017(r318440)
+++ head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
@@ -8,6 +8,7 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
+   cron.d \
newsyslog.conf.d \
syslog.d
 

Added: head/etc/cron.d/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/MakefileThu May 18 06:25:39 2017(r318441)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include 
+
+.if ${MK_AT} != "no"
+FILES+=at
+.endif
+
+BINDIR=/etc/cron.d
+
+.include 

Added: head/etc/cron.d/at
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/at  Thu May 18 06:25:39 2017(r318441)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+#
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+
+# See crontab(5) for field format.
+*/5*   *   *   *   root/usr/libexec/atrun

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:15:42 2017(r318440)
+++ head/etc/crontabThu May 18 06:25:39 2017(r318441)
@@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
-*/5*   *   *   *   root/usr/libexec/atrun
-#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318440 - head/sys/modules/dtrace/dtaudit

2017-05-18 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:15:42 2017
New Revision: 318440
URL: https://svnweb.freebsd.org/changeset/base/318440

Log:
  Normalize SYSDIR on SRCTOP instead of .CURDIR
  
  This is being done to simplify pathing for CFLAGS and source files.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/modules/dtrace/dtaudit/Makefile

Modified: head/sys/modules/dtrace/dtaudit/Makefile
==
--- head/sys/modules/dtrace/dtaudit/MakefileThu May 18 06:13:29 2017
(r318439)
+++ head/sys/modules/dtrace/dtaudit/MakefileThu May 18 06:15:42 2017
(r318440)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-SYSDIR?=   ${.CURDIR}/../../..
+SYSDIR?=   ${SRCTOP}/sys
 
 .PATH: ${SYSDIR}/security/audit
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318439 - head/sys/modules/ipsec

2017-05-18 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:13:29 2017
New Revision: 318439
URL: https://svnweb.freebsd.org/changeset/base/318439

Log:
  Normalize .PATH on SRCTOP
  
  This will help Jenkins dedupe 9 warnings between the static build and
  the module build of ipsec(4).
  
  Missed in SRCTOP conversion in r314651.
  
  MFC with: r314651
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/modules/ipsec/Makefile

Modified: head/sys/modules/ipsec/Makefile
==
--- head/sys/modules/ipsec/Makefile Thu May 18 03:32:01 2017
(r318438)
+++ head/sys/modules/ipsec/Makefile Thu May 18 06:13:29 2017
(r318439)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.PATH: ${SRCTOP}/sys/net ${.CURDIR}/../../netipsec
+.PATH: ${SRCTOP}/sys/net ${SRCTOP}/sys/netipsec
 
 KMOD=  ipsec
 SRCS=  if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"