svn commit: r234453 - stable/8/cddl/contrib/opensolaris/cmd/zpool

2012-04-19 Thread Martin Matuska
Author: mm
Date: Thu Apr 19 07:43:44 2012
New Revision: 234453
URL: http://svn.freebsd.org/changeset/base/234453

Log:
  MFC r234336:
  Fix typo miror -> mirror
  
  Reported by:  Glen Barber 

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 07:43:28 
2012(r234452)
+++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 07:43:44 
2012(r234453)
@@ -1779,7 +1779,7 @@ The following command creates a
 storage pool consisting of two, two-way
 mirrors and mirrored log devices:
 .Bd -literal -offset 2n
-.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log miror da4 da5
+.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
 .Ed
 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
 .Pp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234452 - stable/9/cddl/contrib/opensolaris/cmd/zpool

2012-04-19 Thread Martin Matuska
Author: mm
Date: Thu Apr 19 07:43:28 2012
New Revision: 234452
URL: http://svn.freebsd.org/changeset/base/234452

Log:
  MFC r234336:
  Fix typo miror -> mirror
  
  Reported by:  Glen Barber 

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 04:07:55 
2012(r234451)
+++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 07:43:28 
2012(r234452)
@@ -1779,7 +1779,7 @@ The following command creates a
 storage pool consisting of two, two-way
 mirrors and mirrored log devices:
 .Bd -literal -offset 2n
-.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log miror da4 da5
+.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5
 .Ed
 .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool
 .Pp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234454 - stable/9/libexec/rtld-elf

2012-04-19 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 19 10:17:28 2012
New Revision: 234454
URL: http://svn.freebsd.org/changeset/base/234454

Log:
  MFC r234170:
  Propagate the current state of rtld_bind_lock to dlopen_object() calls
  through the filter loading call chain. This fixes attempts to
  write-lock the already locked rtld_bind_lock when filter loading is
  initiated by relocation of dlopening dso.

Modified:
  stable/9/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/9/libexec/rtld-elf/   (props changed)

Modified: stable/9/libexec/rtld-elf/rtld.c
==
--- stable/9/libexec/rtld-elf/rtld.cThu Apr 19 07:43:44 2012
(r234453)
+++ stable/9/libexec/rtld-elf/rtld.cThu Apr 19 10:17:28 2012
(r234454)
@@ -85,7 +85,7 @@ static void digest_dynamic(Obj_Entry *, 
 static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *);
 static Obj_Entry *dlcheck(void *);
 static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj,
-int lo_flags, int mode);
+int lo_flags, int mode, RtldLockState *lockstate);
 static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, 
int);
 static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *);
 static bool donelist_check(DoneList *, const Obj_Entry *);
@@ -1672,13 +1672,14 @@ unload_filtees(Obj_Entry *obj)
 }
 
 static void
-load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags)
+load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags,
+RtldLockState *lockstate)
 {
 
 for (; needed != NULL; needed = needed->next) {
needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj,
  flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) |
- RTLD_LOCAL);
+ RTLD_LOCAL, lockstate);
 }
 }
 
@@ -1688,8 +1689,8 @@ load_filtees(Obj_Entry *obj, int flags, 
 
 lock_restart_for_upgrade(lockstate);
 if (!obj->filtees_loaded) {
-   load_filtee1(obj, obj->needed_filtees, flags);
-   load_filtee1(obj, obj->needed_aux_filtees, flags);
+   load_filtee1(obj, obj->needed_filtees, flags, lockstate);
+   load_filtee1(obj, obj->needed_aux_filtees, flags, lockstate);
obj->filtees_loaded = true;
 }
 }
@@ -2489,7 +2490,7 @@ rtld_dlopen(const char *name, int fd, in
lo_flags |= RTLD_LO_TRACE;
 
 return (dlopen_object(name, fd, obj_main, lo_flags,
-  mode & (RTLD_MODEMASK | RTLD_GLOBAL)));
+  mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL));
 }
 
 static void
@@ -2504,17 +2505,20 @@ dlopen_cleanup(Obj_Entry *obj)
 
 static Obj_Entry *
 dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags,
-int mode)
+int mode, RtldLockState *lockstate)
 {
 Obj_Entry **old_obj_tail;
 Obj_Entry *obj;
 Objlist initlist;
-RtldLockState lockstate;
+RtldLockState mlockstate;
 int result;
 
 objlist_init(&initlist);
 
-wlock_acquire(rtld_bind_lock, &lockstate);
+if (lockstate == NULL && !(lo_flags & RTLD_LO_EARLY)) {
+   wlock_acquire(rtld_bind_lock, &mlockstate);
+   lockstate = &mlockstate;
+}
 GDB_STATE(RT_ADD,NULL);
 
 old_obj_tail = obj_tail;
@@ -2543,7 +2547,7 @@ dlopen_object(const char *name, int fd, 
if (result == -1 || (relocate_objects(obj,
 (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld,
  (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0,
- &lockstate)) == -1) {
+ lockstate)) == -1) {
dlopen_cleanup(obj);
obj = NULL;
} else if (lo_flags & RTLD_LO_EARLY) {
@@ -2587,28 +2591,31 @@ dlopen_object(const char *name, int fd, 
 GDB_STATE(RT_CONSISTENT,obj ? &obj->linkmap : NULL);
 
 if (!(lo_flags & RTLD_LO_EARLY)) {
-   map_stacks_exec(&lockstate);
+   map_stacks_exec(lockstate);
 }
 
 if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == RTLD_NOW,
   (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0,
-  &lockstate) == -1) {
+  lockstate) == -1) {
objlist_clear(&initlist);
dlopen_cleanup(obj);
-   lock_release(rtld_bind_lock, &lockstate);
+   if (lockstate == &mlockstate)
+   lock_release(rtld_bind_lock, lockstate);
return (NULL);
 }
 
 if (!(lo_flags & RTLD_LO_EARLY)) {
/* Call the init functions. */
-   objlist_call_init(&initlist, &lockstate);
+   objlist_call_init(&initlist, lockstate);
 }
 objlist_clear(&initlist);
-lock_release(rtld_bind_lock, &lockstate);
+if (lockstate == &mlockstate)
+   lock_release(rtld_bind_lock, lockstate);
 return obj;
 trace:
 trace_loaded_objects(obj);
-lock_release(rtld_bind_lock, &lockstate);
+if (lockstate == &mlockstate)
+   lock_release(rtld_bind_lock, lockstate);
 exit(0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/l

svn commit: r234455 - in stable/9/sys: kern sys

2012-04-19 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 19 10:36:23 2012
New Revision: 234455
URL: http://svn.freebsd.org/changeset/base/234455

Log:
  MFC r234172:
  Add thread-private flag to indicate that error value is already placed
  in td_errno. Flag is supposed to be used by syscalls returning
  EJUSTRETURN because errno was already placed into the usermode frame
  by a call to set_syscall_retval(9). Both ktrace and dtrace get errno
  value from td_errno if the flag is set.
  
  Use the flag to fix sigsuspend(2) error return ktrace records.

Modified:
  stable/9/sys/kern/kern_sig.c
  stable/9/sys/kern/subr_syscall.c
  stable/9/sys/sys/proc.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_sig.c
==
--- stable/9/sys/kern/kern_sig.cThu Apr 19 10:17:28 2012
(r234454)
+++ stable/9/sys/kern/kern_sig.cThu Apr 19 10:36:23 2012
(r234455)
@@ -1465,6 +1465,8 @@ kern_sigsuspend(struct thread *td, sigse
mtx_unlock(&p->p_sigacts->ps_mtx);
}
PROC_UNLOCK(p);
+   td->td_errno = EINTR;
+   td->td_pflags |= TDP_NERRNO;
return (EJUSTRETURN);
 }
 

Modified: stable/9/sys/kern/subr_syscall.c
==
--- stable/9/sys/kern/subr_syscall.cThu Apr 19 10:17:28 2012
(r234454)
+++ stable/9/sys/kern/subr_syscall.cThu Apr 19 10:36:23 2012
(r234455)
@@ -136,7 +136,8 @@ syscallenter(struct thread *td, struct s
AUDIT_SYSCALL_EXIT(error, td);
 
/* Save the latest error return value. */
-   td->td_errno = error;
+   if ((td->td_pflags & TDP_NERRNO) == 0)
+   td->td_errno = error;
 
 #ifdef KDTRACE_HOOKS
/*
@@ -191,9 +192,12 @@ syscallret(struct thread *td, int error,
syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name);
 
 #ifdef KTRACE
-   if (KTRPOINT(td, KTR_SYSRET))
-   ktrsysret(sa->code, error, td->td_retval[0]);
+   if (KTRPOINT(td, KTR_SYSRET)) {
+   ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ?
+   error : td->td_errno, td->td_retval[0]);
+   }
 #endif
+   td->td_pflags &= ~TDP_NERRNO;
 
if (p->p_flag & P_TRACED) {
traced = 1;

Modified: stable/9/sys/sys/proc.h
==
--- stable/9/sys/sys/proc.h Thu Apr 19 10:17:28 2012(r234454)
+++ stable/9/sys/sys/proc.h Thu Apr 19 10:36:23 2012(r234455)
@@ -417,6 +417,7 @@ do {
\
 #defineTDP_AUDITREC0x0100 /* Audit record pending on thread */
 #defineTDP_RFPPWAIT0x0200 /* Handle RFPPWAIT on syscall exit */
 #defineTDP_RESETSPUR   0x0400 /* Reset spurious page fault 
history. */
+#defineTDP_NERRNO  0x0800 /* Last errno is already in td_errno 
*/
 
 /*
  * Reasons that the current thread can not be run yet.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234457 - in stable/8/sys: kern sys

2012-04-19 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 19 10:53:17 2012
New Revision: 234457
URL: http://svn.freebsd.org/changeset/base/234457

Log:
  MFC r234172:
  Add thread-private flag to indicate that error value is already placed
  in td_errno. Flag is supposed to be used by syscalls returning
  EJUSTRETURN because errno was already placed into the usermode frame
  by a call to set_syscall_retval(9). Both ktrace and dtrace get errno
  value from td_errno if the flag is set.
  
  Use the flag to fix sigsuspend(2) error return ktrace records.

Modified:
  stable/8/sys/kern/kern_sig.c
  stable/8/sys/kern/subr_syscall.c
  stable/8/sys/sys/proc.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/kern_sig.c
==
--- stable/8/sys/kern/kern_sig.cThu Apr 19 10:48:25 2012
(r234456)
+++ stable/8/sys/kern/kern_sig.cThu Apr 19 10:53:17 2012
(r234457)
@@ -1489,6 +1489,8 @@ kern_sigsuspend(struct thread *td, sigse
mtx_unlock(&p->p_sigacts->ps_mtx);
}
PROC_UNLOCK(p);
+   td->td_errno = EINTR;
+   td->td_pflags |= TDP_NERRNO;
return (EJUSTRETURN);
 }
 

Modified: stable/8/sys/kern/subr_syscall.c
==
--- stable/8/sys/kern/subr_syscall.cThu Apr 19 10:48:25 2012
(r234456)
+++ stable/8/sys/kern/subr_syscall.cThu Apr 19 10:53:17 2012
(r234457)
@@ -115,7 +115,8 @@ syscallenter(struct thread *td, struct s
AUDIT_SYSCALL_EXIT(error, td);
 
/* Save the latest error return value. */
-   td->td_errno = error;
+   if ((td->td_pflags & TDP_NERRNO) == 0)
+   td->td_errno = error;
 
 #ifdef KDTRACE_HOOKS
/*
@@ -169,9 +170,12 @@ syscallret(struct thread *td, int error,
syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name);
 
 #ifdef KTRACE
-   if (KTRPOINT(td, KTR_SYSRET))
-   ktrsysret(sa->code, error, td->td_retval[0]);
+   if (KTRPOINT(td, KTR_SYSRET)) {
+   ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ?
+   error : td->td_errno, td->td_retval[0]);
+   }
 #endif
+   td->td_pflags &= ~TDP_NERRNO;
 
if (p->p_flag & P_TRACED) {
traced = 1;

Modified: stable/8/sys/sys/proc.h
==
--- stable/8/sys/sys/proc.h Thu Apr 19 10:48:25 2012(r234456)
+++ stable/8/sys/sys/proc.h Thu Apr 19 10:53:17 2012(r234457)
@@ -410,6 +410,7 @@ do {
\
 #defineTDP_IGNSUSP 0x0080 /* Permission to ignore the 
MNTK_SUSPEND* */
 #defineTDP_AUDITREC0x0100 /* Audit record pending on thread */
 #defineTDP_RESETSPUR   0x0400 /* Reset spurious page fault 
history. */
+#defineTDP_NERRNO  0x0800 /* Last errno is already in td_errno 
*/
 
 /*
  * Reasons that the current thread can not be run yet.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2012-04-19 Thread John Baldwin
On Wednesday, April 18, 2012 4:10:01 pm Dimitry Andric wrote:
> On 2012-04-18 15:54, John Baldwin wrote:
> ...
> > http://www.FreeBSD.org/~jhb/patches/asr_stailq.patch
> 
> Yes, that seems to work just fine, at least for the list juggling.  Thanks!
> 
> The only additional fix needed now is the following.  Shall I commit
> that including your patch?

Sure.

> Index: sys/dev/asr/asr.c
> ===
> --- sys/dev/asr/asr.c (revision 234390)
> +++ sys/dev/asr/asr.c (working copy)
> @@ -2700,7 +2701,7 @@ asr_action(struct cam_sim *sim, union ccb  *ccb)
>   
>   ccb->ccb_h.spriv_ptr0 = sc = (struct Asr_softc *)cam_sim_softc(sim);
>   
> - switch (ccb->ccb_h.func_code) {
> + switch ((int)ccb->ccb_h.func_code) {
>   
>   /* Common cases first */
>   case XPT_SCSI_IO:   /* Execute the requested I/O operation */
> 

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


svn commit: r234458 - in head: sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom/geom_raid

2012-04-19 Thread Alexander Motin
Author: mav
Date: Thu Apr 19 12:30:12 2012
New Revision: 234458
URL: http://svn.freebsd.org/changeset/base/234458

Log:
  Add to GEOM RAID class module for reading non-degraded RAID5 volumes and
  some environment to differentiate 4 possible RAID5 on-disk layouts.
  
  Tested with Intel and AMD RAID BIOSes.
  
  MFC after:2 weeks

Added:
  head/sys/geom/raid/tr_raid5.c   (contents, props changed)
Modified:
  head/sbin/geom/class/raid/graid.8
  head/sys/conf/files
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/g_raid.h
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_jmicron.c
  head/sys/geom/raid/md_nvidia.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/modules/geom/geom_raid/Makefile

Modified: head/sbin/geom/class/raid/graid.8
==
--- head/sbin/geom/class/raid/graid.8   Thu Apr 19 10:53:17 2012
(r234457)
+++ head/sbin/geom/class/raid/graid.8   Thu Apr 19 12:30:12 2012
(r234458)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 26, 2011
+.Dd April 19, 2012
 .Dt GRAID 8
 .Os
 .Sh NAME
@@ -242,7 +242,8 @@ own risk: RAID1 (3+ disks), RAID10 (6+ d
 The GEOM RAID class follows a modular design, allowing different RAID levels
 to be used.
 Support for the following RAID levels is currently implemented: RAID0, RAID1,
-RAID1E, RAID10, SINGLE, CONCAT.
+RAID1E, RAID5, RAID10, SINGLE, CONCAT.
+RAID5 support is read-only and only for volumes in optimal state.
 .Sh RAID LEVEL MIGRATION
 The GEOM RAID class has no support for RAID level migration, allowed by some
 metadata formats.

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Apr 19 10:53:17 2012(r234457)
+++ head/sys/conf/files Thu Apr 19 12:30:12 2012(r234458)
@@ -2405,6 +2405,7 @@ geom/raid/tr_concat.c optional geom_rai
 geom/raid/tr_raid0.c   optional geom_raid
 geom/raid/tr_raid1.c   optional geom_raid
 geom/raid/tr_raid1e.c  optional geom_raid
+geom/raid/tr_raid5.c   optional geom_raid
 geom/raid3/g_raid3.c   optional geom_raid3
 geom/raid3/g_raid3_ctl.c   optional geom_raid3
 geom/shsec/g_shsec.c   optional geom_shsec

Modified: head/sys/geom/raid/g_raid.c
==
--- head/sys/geom/raid/g_raid.c Thu Apr 19 10:53:17 2012(r234457)
+++ head/sys/geom/raid/g_raid.c Thu Apr 19 12:30:12 2012(r234458)
@@ -281,6 +281,14 @@ g_raid_volume_level2str(int level, int q
case G_RAID_VOLUME_RL_RAID4:
return ("RAID4");
case G_RAID_VOLUME_RL_RAID5:
+   if (qual == G_RAID_VOLUME_RLQ_R5RA)
+   return ("RAID5RA");
+   if (qual == G_RAID_VOLUME_RLQ_R5RS)
+   return ("RAID5RS");
+   if (qual == G_RAID_VOLUME_RLQ_R5LA)
+   return ("RAID5LA");
+   if (qual == G_RAID_VOLUME_RLQ_R5LS)
+   return ("RAID5LS");
return ("RAID5");
case G_RAID_VOLUME_RL_RAID6:
return ("RAID6");
@@ -313,9 +321,20 @@ g_raid_volume_str2level(const char *str,
*level = G_RAID_VOLUME_RL_RAID3;
else if (strcasecmp(str, "RAID4") == 0)
*level = G_RAID_VOLUME_RL_RAID4;
-   else if (strcasecmp(str, "RAID5") == 0)
+   else if (strcasecmp(str, "RAID5RA") == 0) {
*level = G_RAID_VOLUME_RL_RAID5;
-   else if (strcasecmp(str, "RAID6") == 0)
+   *qual = G_RAID_VOLUME_RLQ_R5RA;
+   } else if (strcasecmp(str, "RAID5RS") == 0) {
+   *level = G_RAID_VOLUME_RL_RAID5;
+   *qual = G_RAID_VOLUME_RLQ_R5RS;
+   } else if (strcasecmp(str, "RAID5") == 0 ||
+  strcasecmp(str, "RAID5LA") == 0) {
+   *level = G_RAID_VOLUME_RL_RAID5;
+   *qual = G_RAID_VOLUME_RLQ_R5LA;
+   } else if (strcasecmp(str, "RAID5LS") == 0) {
+   *level = G_RAID_VOLUME_RL_RAID5;
+   *qual = G_RAID_VOLUME_RLQ_R5LS;
+   } else if (strcasecmp(str, "RAID6") == 0)
*level = G_RAID_VOLUME_RL_RAID6;
else if (strcasecmp(str, "RAID10") == 0 ||
 strcasecmp(str, "RAID1E") == 0)

Modified: head/sys/geom/raid/g_raid.h
==
--- head/sys/geom/raid/g_raid.h Thu Apr 19 10:53:17 2012(r234457)
+++ head/sys/geom/raid/g_raid.h Thu Apr 19 12:30:12 2012(r234458)
@@ -227,6 +227,10 @@ struct g_raid_subdisk {
 #define G_RAID_VOLUME_RL_UNKNOWN   0xff
 
 #define G_RAID_VOLUME_RLQ_NONE 0x00
+#define G_RAID_VOLUME_RLQ_R5RA 0x00
+#define G_RAID_VOLUME_RLQ_R5RS 0x01
+#define G_RAID_VOLUME_RLQ_R5LA 0x02
+#define G_RAID_VOLUME_RLQ_R5LS 0x03
 #define G_RAID_VOLUME_

svn commit: r234459 - head/sys/netinet

2012-04-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Apr 19 12:43:19 2012
New Revision: 234459
URL: http://svn.freebsd.org/changeset/base/234459

Log:
  Fix a bug where we copy out more data from a mbuf chain that are
  actually in it. This happens when SCTP receives an unknown chunk, which
  requires the sending of an ERROR chunk, and there is no final padding but
  the chunk is not 4-byte aligned.
  Reported by yueting via rwatson@
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Thu Apr 19 12:30:12 2012
(r234458)
+++ head/sys/netinet/sctp_indata.c  Thu Apr 19 12:43:19 2012
(r234459)
@@ -2746,11 +2746,13 @@ sctp_process_data(struct mbuf **mm, int 
phd->param_length =
htons(chk_length + 
sizeof(*phd));
SCTP_BUF_LEN(merr) = 
sizeof(*phd);
-   SCTP_BUF_NEXT(merr) = 
SCTP_M_COPYM(m, *offset,
-   SCTP_SIZE32(chk_length),
-   M_DONTWAIT);
+   SCTP_BUF_NEXT(merr) = 
SCTP_M_COPYM(m, *offset, chk_length, M_DONTWAIT);
if (SCTP_BUF_NEXT(merr)) {
-   sctp_queue_op_err(stcb, 
merr);
+   if 
(sctp_pad_lastmbuf(SCTP_BUF_NEXT(merr), SCTP_SIZE32(chk_length) - chk_length, 
NULL)) {
+   
sctp_m_freem(merr);
+   } else {
+   
sctp_queue_op_err(stcb, merr);
+   }
} else {
sctp_m_freem(merr);
}

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Thu Apr 19 12:30:12 2012
(r234458)
+++ head/sys/netinet/sctp_input.c   Thu Apr 19 12:43:19 2012
(r234459)
@@ -5461,23 +5461,26 @@ process_control_chunks:
phd->param_type = 
htons(SCTP_CAUSE_UNRECOG_CHUNK);
phd->param_length = htons(chk_length + 
sizeof(*phd));
SCTP_BUF_LEN(mm) = sizeof(*phd);
-   SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, 
*offset, SCTP_SIZE32(chk_length),
-   M_DONTWAIT);
+   SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, 
*offset, chk_length, M_DONTWAIT);
if (SCTP_BUF_NEXT(mm)) {
+   if 
(sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(chk_length) - chk_length, 
NULL)) {
+   sctp_m_freem(mm);
+   } else {
 #ifdef SCTP_MBUF_LOGGING
-   if 
(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
-   struct mbuf *mat;
+   if 
(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
+   struct mbuf 
*mat;
 
-   mat = SCTP_BUF_NEXT(mm);
-   while (mat) {
-   if 
(SCTP_BUF_IS_EXTENDED(mat)) {
-   
sctp_log_mb(mat, SCTP_MBUF_ICOPY);
+   mat = 
SCTP_BUF_NEXT(mm);
+   while (mat) {
+   if 
(SCTP_BUF_IS_EXTENDED(mat)) {
+   
sctp_log_mb(mat, SCTP_MBUF_ICOPY);
+   }
+   mat = 
SCTP_BUF_NEXT(mat);
}
-   mat = 
SCTP_BUF_NEXT(mat);
 

svn commit: r234460 - head/sys/netinet

2012-04-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Apr 19 12:47:18 2012
New Revision: 234460
URL: http://svn.freebsd.org/changeset/base/234460

Log:
  Fix reported errno.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Thu Apr 19 12:43:19 2012(r234459)
+++ head/sys/netinet/sctputil.c Thu Apr 19 12:47:18 2012(r234460)
@@ -2553,8 +2553,8 @@ sctp_add_pad_tombuf(struct mbuf *m, int 
tmp = sctp_get_mbuf_for_msg(padlen, 0, M_DONTWAIT, 1, MT_DATA);
if (tmp == NULL) {
/* Out of space GAK! we are in big trouble. */
-   SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, 
SCTP_FROM_SCTPUTIL, EINVAL);
-   return (ENOSPC);
+   SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, 
SCTP_FROM_SCTPUTIL, ENOBUFS);
+   return (ENOBUFS);
}
/* setup and insert in middle */
SCTP_BUF_LEN(tmp) = padlen;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234461 - head/sys/netinet

2012-04-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Apr 19 13:11:17 2012
New Revision: 234461
URL: http://svn.freebsd.org/changeset/base/234461

Log:
  Use the same pattern for mbuf logging everywhere.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Thu Apr 19 12:47:18 2012
(r234460)
+++ head/sys/netinet/sctp_input.c   Thu Apr 19 13:11:17 2012
(r234461)
@@ -2463,12 +2463,10 @@ sctp_handle_cookie_echo(struct mbuf *m, 
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
struct mbuf *mat;
 
-   mat = m_sig;
-   while (mat) {
+   for (mat = m_sig; mat; mat = SCTP_BUF_NEXT(mat)) {
if (SCTP_BUF_IS_EXTENDED(mat)) {
sctp_log_mb(mat, SCTP_MBUF_SPLIT);
}
-   mat = SCTP_BUF_NEXT(mat);
}
}
 #endif
@@ -5470,12 +5468,10 @@ process_control_chunks:
if 
(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
struct mbuf 
*mat;
 
-   mat = 
SCTP_BUF_NEXT(mm);
-   while (mat) {
+   for (mat = 
SCTP_BUF_NEXT(mm); mat; mat = SCTP_BUF_NEXT(mat)) {
if 
(SCTP_BUF_IS_EXTENDED(mat)) {

sctp_log_mb(mat, SCTP_MBUF_ICOPY);
}
-   mat = 
SCTP_BUF_NEXT(mat);
}
}
 #endif
@@ -5808,10 +5804,6 @@ sctp_print_mbuf_chain(struct mbuf *m)
 void
 sctp_input_with_port(struct mbuf *i_pak, int off, uint16_t port)
 {
-#ifdef SCTP_MBUF_LOGGING
-   struct mbuf *mat;
-
-#endif
struct mbuf *m;
int iphlen;
uint32_t vrf_id = 0;
@@ -5846,6 +5838,8 @@ sctp_input_with_port(struct mbuf *i_pak,
 #ifdef SCTP_MBUF_LOGGING
/* Log in any input mbufs */
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
+   struct mbuf *mat;
+
for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) {
if (SCTP_BUF_IS_EXTENDED(mat)) {
sctp_log_mb(mat, SCTP_MBUF_INPUT);

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Thu Apr 19 12:47:18 2012
(r234460)
+++ head/sys/netinet/sctp_output.c  Thu Apr 19 13:11:17 2012
(r234461)
@@ -3714,12 +3714,10 @@ sctp_add_cookie(struct mbuf *init, int i
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
struct mbuf *mat;
 
-   mat = copy_init;
-   while (mat) {
+   for (mat = copy_init; mat; mat = SCTP_BUF_NEXT(mat)) {
if (SCTP_BUF_IS_EXTENDED(mat)) {
sctp_log_mb(mat, SCTP_MBUF_ICOPY);
}
-   mat = SCTP_BUF_NEXT(mat);
}
}
 #endif
@@ -3734,12 +3732,10 @@ sctp_add_cookie(struct mbuf *init, int i
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
struct mbuf *mat;
 
-   mat = copy_initack;
-   while (mat) {
+   for (mat = copy_initack; mat; mat = SCTP_BUF_NEXT(mat)) {
if (SCTP_BUF_IS_EXTENDED(mat)) {
sctp_log_mb(mat, SCTP_MBUF_ICOPY);
}
-   mat = SCTP_BUF_NEXT(mat);
}
}
 #endif
@@ -6446,12 +6442,10 @@ error_out:
if (SCTP_BASE_SYSCTL(sctp_logging_level) & 
SCTP_MBUF_LOGGING_ENABLE) {
struct mbuf *mat;
 
-   mat = appendchain;
-   while (mat) {
+   for (mat = appendchain; mat; mat = 
SCTP_BUF_NEXT(mat)) {
if (SCTP_BUF_IS_EXTENDED(mat)) {
sctp_log_mb(mat, 
SCTP_MBUF_ICOPY);
}
-   mat = SCTP_BUF_NEXT(mat);
}
}
 #endif
@@ -6547,12 +6541,

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Conrad J. Sabatier
On Tue, 17 Apr 2012 11:05:08 -0700
Adrian Chadd  wrote:

> On 17 April 2012 02:43, Bjoern A. Zeeb  wrote:
> 
> > Actually it seems these failed:
> >
> > arm.armeb buildworld failed, check _.arm.armeb.buildworld for
> > details arm.arm buildworld failed, check _.arm.arm.buildworld for
> > details mips.mips64 buildworld failed, check
> > _.mips.mips64.buildworld for details mips.mipsel buildworld failed,
> > check _.mips.mipsel.buildworld for details mips.mips64el buildworld
> > failed, check _.mips.mips64el.buildworld for details mips.mipsn32
> > buildworld failed, check _.mips.mipsn32.buildworld for details
> > mips.mips buildworld failed, check _.mips.mips.buildworld for
> > details i386.i386 buildworld failed, check _.i386.i386.buildworld
> > for details pc98.i386 buildworld failed, check
> > _.pc98.i386.buildworld for details powerpc.powerpc buildworld
> > failed, check _.powerpc.powerpc.buildworld for details
> > powerpc.powerpc64 buildworld failed, check
> > _.powerpc.powerpc64.buildworld for details
> 
> This looks like it only works on amd64 and sparc64. Lucky them. :)

Actually, I keep getting "undefined reference to _malloc_options" while
building libexec/atrun on amd64.  Not sure what the problem may be.
Could it have something to do with doing a debug build (with -g)?

===> libexec/atrun (all)
clang -Wno-error -O2 -g -pipe -fno-strict-aliasing -march=native
-DATJOB_DIR=\"/var/at/jobs/\"  -DLFILE=\"/var/at/jobs/.lockfile\"
-DLOADAVG_MX=1.5 -DATSPOOL_DIR=\"/var/at/spool\"  -DVERSION=\"2.9\"
-DDAEMON_UID=1 -DDAEMON_GID=1  -DDEFAULT_BATCH_QUEUE=\'E\'
-DDEFAULT_AT_QUEUE=\'c\' -DPERM_PATH=\"/var/at/\"
-I/usr/src/libexec/atrun/../../usr.bin/at -I/usr/src/libexec/atrun
-DLOGIN_CAP -DPAM -DNDEBUG -std=gnu99 -Qunused-arguments
-Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized
-Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
-Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
-Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum
-c /usr/src/libexec/atrun/atrun.c clang -Wno-error -O2 -g -pipe
-fno-strict-aliasing -march=native -DATJOB_DIR=\"/var/at/jobs/\"
-DLFILE=\"/var/at/jobs/.lockfile\"  -DLOADAVG_MX=1.5
-DATSPOOL_DIR=\"/var/at/spool\"  -DVERSION=\"2.9\" -DDAEMON_UID=1
-DDAEMON_GID=1  -DDEFAULT_BATCH_QUEUE=\'E\'  -DDEFAULT_AT_QUEUE=\'c\'
-DPERM_PATH=\"/var/at/\" -I/usr/src/libexec/atrun/../../usr.bin/at
-I/usr/src/libexec/atrun -DLOGIN_CAP -DPAM -DNDEBUG -std=gnu99
-Qunused-arguments -Wsystem-headers -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -Wno-empty-body
-Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value
-Wno-parentheses-equality -Wno-unused-function -Wno-conversion
-Wno-switch -Wno-switch-enum -c /usr/src/libexec/atrun/gloadavg.c clang
-Wno-error -O2 -g -pipe -fno-strict-aliasing -march=native
-DATJOB_DIR=\"/var/at/jobs/\"  -DLFILE=\"/var/at/jobs/.lockfile\"
-DLOADAVG_MX=1.5 -DATSPOOL_DIR=\"/var/at/spool\"  -DVERSION=\"2.9\"
-DDAEMON_UID=1 -DDAEMON_GID=1  -DDEFAULT_BATCH_QUEUE=\'E\'
-DDEFAULT_AT_QUEUE=\'c\' -DPERM_PATH=\"/var/at/\"
-I/usr/src/libexec/atrun/../../usr.bin/at -I/usr/src/libexec/atrun
-DLOGIN_CAP -DPAM -DNDEBUG -std=gnu99 -Qunused-arguments
-Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized
-Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
-Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
-Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum  -o
atrun atrun.o gloadavg.o -lpam
-lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
`_malloc_options' clang: error: linker command failed with exit code 1
(use -v to see invocation) *** [atrun] Error code 1

Stop in /usr/src/libexec/atrun.
*** [all] Error code 1

Stop in /usr/src/libexec.
*** [libexec.all__D] Error code 1

Stop in /usr/src.
*** [everything] Error code 1

Stop in /usr/src.
*** [buildworld] Error code 1

Stop in /usr/src.

-- 
Conrad J. Sabatier
conr...@cox.net
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Bjoern A. Zeeb
On 19. Apr 2012, at 14:15 , Conrad J. Sabatier wrote:

> Actually, I keep getting "undefined reference to _malloc_options" while
> building libexec/atrun on amd64.  Not sure what the problem may be.
> Could it have something to do with doing a debug build (with -g)?

See UPDATING entry.

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

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


Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Conrad J. Sabatier
On Thu, 19 Apr 2012 14:18:15 +
"Bjoern A. Zeeb"  wrote:

> On 19. Apr 2012, at 14:15 , Conrad J. Sabatier wrote:
> 
> > Actually, I keep getting "undefined reference to _malloc_options"
> > while building libexec/atrun on amd64.  Not sure what the problem
> > may be. Could it have something to do with doing a debug build
> > (with -g)?
> 
> See UPDATING entry.
> 

Yes, that's what's so strange here; I've already done that.  Deleted my
old /etc/malloc.conf symlink when I first came across that information,
and haven't created a new one yet.

Thought it may have been due to having MALLOC_PRODUCTION defined in
/etc/make.conf and/or /etc/src.conf, so disabled that, too.  Still
the problem persists.

Quite mystifying at this point.  :-)

-- 
Conrad J. Sabatier
conr...@cox.net
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234462 - head/lib/libulog

2012-04-19 Thread Ed Schouten
Author: ed
Date: Thu Apr 19 15:28:15 2012
New Revision: 234462
URL: http://svn.freebsd.org/changeset/base/234462

Log:
  Properly use SHA1_Final() instead of SHA_Final().
  
  In this case it doesn't really matter, as long as we turn a TTY name
  into a set of shuffled bytes. Still, for correctness we should use the
  proper function.
  
  MFC after:2 weeks

Modified:
  head/lib/libulog/ulog_login.c

Modified: head/lib/libulog/ulog_login.c
==
--- head/lib/libulog/ulog_login.c   Thu Apr 19 13:11:17 2012
(r234461)
+++ head/lib/libulog/ulog_login.c   Thu Apr 19 15:28:15 2012
(r234462)
@@ -55,7 +55,7 @@ ulog_fill(struct utmpx *utx, const char 
SHA1_Init(&c);
SHA1_Update(&c, "libulog", 7);
SHA1_Update(&c, utx->ut_line, sizeof utx->ut_line);
-   SHA_Final(id, &c);
+   SHA1_Final(id, &c);
 
memcpy(utx->ut_id, id, MIN(sizeof utx->ut_id, sizeof id));
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234463 - head/share/man/man9

2012-04-19 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Apr 19 15:29:09 2012
New Revision: 234463
URL: http://svn.freebsd.org/changeset/base/234463

Log:
  Document swi_remove(9).
  
  Reviewed by:  jhb
  MFC after:1 week

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/swi.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileThu Apr 19 15:28:15 2012
(r234462)
+++ head/share/man/man9/MakefileThu Apr 19 15:29:09 2012
(r234463)
@@ -1250,6 +1250,7 @@ MLINKS+=store.9 subyte.9 \
store.9 suword32.9 \
store.9 suword64.9
 MLINKS+=swi.9 swi_add.9 \
+   swi.9 swi_remove.9 \
swi.9 swi_sched.9
 MLINKS+=sx.9 sx_assert.9 \
sx.9 sx_destroy.9 \

Modified: head/share/man/man9/swi.9
==
--- head/share/man/man9/swi.9   Thu Apr 19 15:28:15 2012(r234462)
+++ head/share/man/man9/swi.9   Thu Apr 19 15:29:09 2012(r234463)
@@ -24,11 +24,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2012
+.Dd April 19, 2012
 .Dt SWI 9
 .Os
 .Sh NAME
 .Nm swi_add ,
+.Nm swi_remove ,
 .Nm swi_sched
 .Nd register and schedule software interrupt handlers
 .Sh SYNOPSIS
@@ -50,6 +51,8 @@
 .Fa "enum intr_type flags"
 .Fa "void **cookiep"
 .Fc
+.Ft int
+.Fn swi_remove "void *cookie"
 .Ft void
 .Fn swi_sched "void *cookie" "int flags"
 .Sh DESCRIPTION
@@ -114,6 +117,14 @@ This cookie will be set to a value that 
 and is used to schedule the handler for execution later on.
 .Pp
 The
+.Fn swi_remove
+function is used to teardown an interrupt handler pointed to by the
+.Fa cookie
+argument.
+It detaches the interrupt handler from the associated interrupt event
+and frees its memory.
+.Pp
+The
 .Fn swi_sched
 function is used to schedule an interrupt handler and its associated thread to
 run.
@@ -164,7 +175,9 @@ networking stack, clock interrupt, and V
 .Sh RETURN VALUES
 The
 .Fn swi_add
-function returns zero on success and non-zero on failure.
+and
+.Fn swi_remove
+functions return zero on success and non-zero on failure.
 .Sh ERRORS
 The
 .Fn swi_add
@@ -201,6 +214,17 @@ flag is specified and the interrupt even
 already has at least one handler, or the interrupt event already has an
 exclusive handler.
 .El
+.Pp
+The
+.Fn swi_remove
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+A software interrupt handler pointed to by
+.Fa cookie
+is
+.Dv NULL .
+.El
 .Sh SEE ALSO
 .Xr ithread 9 ,
 .Xr taskqueue 9
@@ -221,6 +245,10 @@ and
 .Fn schedsoft*
 functions which date back to at least
 .Bx 4.4 .
+The
+.Fn swi_remove
+function first appeared in
+.Fx 6.1 .
 .Sh BUGS
 Most of the global variables described in this manual page should not be
 global, or at the very least should not be declared in
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234464 - head/sys/netinet

2012-04-19 Thread Michael Tuexen
Author: tuexen
Date: Thu Apr 19 15:30:15 2012
New Revision: 234464
URL: http://svn.freebsd.org/changeset/base/234464

Log:
  Whitespace changes.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctp_var.h

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Thu Apr 19 15:29:09 2012
(r234463)
+++ head/sys/netinet/sctp_usrreq.c  Thu Apr 19 15:30:15 2012
(r234464)
@@ -1616,7 +1616,7 @@ out_now:
   }
 
 
-#define SCTP_CHECK_AND_CAST(destp, srcp, type, size)  {\
+#define SCTP_CHECK_AND_CAST(destp, srcp, type, size) {\
if (size < sizeof(type)) { \
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, 
EINVAL); \
error = EINVAL; \

Modified: head/sys/netinet/sctp_var.h
==
--- head/sys/netinet/sctp_var.h Thu Apr 19 15:29:09 2012(r234463)
+++ head/sys/netinet/sctp_var.h Thu Apr 19 15:30:15 2012(r234464)
@@ -157,7 +157,7 @@ extern struct pr_usrreqs sctp_usrreqs;
 }
 
 #define sctp_alloc_a_chunk(_stcb, _chk) { \
-   if (TAILQ_EMPTY(&(_stcb)->asoc.free_chunks))  { \
+   if (TAILQ_EMPTY(&(_stcb)->asoc.free_chunks)) { \
(_chk) = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_chunk), struct 
sctp_tmit_chunk); \
if ((_chk)) { \
SCTP_INCR_CHK_COUNT(); \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234465 - head/share/man/man9

2012-04-19 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Apr 19 16:13:15 2012
New Revision: 234465
URL: http://svn.freebsd.org/changeset/base/234465

Log:
  - Update the rest of struct ithd references.
  - net_ih and softclock_ih cookies have gone away.
  
  MFC after:1 week

Modified:
  head/share/man/man9/swi.9

Modified: head/share/man/man9/swi.9
==
--- head/share/man/man9/swi.9   Thu Apr 19 15:30:15 2012(r234464)
+++ head/share/man/man9/swi.9   Thu Apr 19 16:13:15 2012(r234465)
@@ -36,10 +36,8 @@
 .In sys/param.h
 .In sys/bus.h
 .In sys/interrupt.h
-.Vt "extern struct ithd *tty_ithd" ;
-.Vt "extern struct ithd *clk_ithd" ;
-.Vt "extern void *net_ih" ;
-.Vt "extern void *softclock_ih" ;
+.Vt "extern struct intr_event *tty_intr_event" ;
+.Vt "extern struct intr_event *clk_intr_event" ;
 .Vt "extern void *vm_ih" ;
 .Ft int
 .Fo swi_add
@@ -152,26 +150,23 @@ in earlier versions of
 .El
 .Pp
 The
-.Va tty_ithd
+.Va tty_intr_event
 and
-.Va clk_ithd
-variables contain pointers to the software interrupt threads for the tty and
+.Va clk_intr_event
+variables contain pointers to the software interrupt handlers for the tty and
 clock software interrupts, respectively.
-.Va tty_ithd
+.Va tty_intr_event
 is used to hang tty software interrupt handlers off of the same thread.
-.Va clk_ithd
+.Va clk_intr_event
 is used to hang delayed handlers off of the clock software interrupt thread so
 that the functionality of
 .Fn setdelayed
 can be obtained in conjunction with
 .Dv SWI_DELAY .
 The
-.Va net_ih ,
-.Va softclock_ih ,
-and
 .Va vm_ih
-handler cookies are used to schedule software interrupt threads to run for the
-networking stack, clock interrupt, and VM subsystem respectively.
+handler cookie is used to schedule software interrupt threads to run for the
+VM subsystem.
 .Sh RETURN VALUES
 The
 .Fn swi_add
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234466 - in stable/9/sys: fs/msdosfs geom i386/conf kern sys ufs/ffs vm

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 18:03:24 2012
New Revision: 234466
URL: http://svn.freebsd.org/changeset/base/234466

Log:
  MFC of 233627, 234024, 234025, and 234026
  
  Restore per mount-point counts of synchronous and asynchronous
  reads and writes associated with UFS and MSDOS filesystems.
  
  MFS 233627:
  Keep track of the mount point associated with a special device
  to enable the collection of counts of synchronous and asynchronous
  reads and writes for its associated filesystem. The counts are
  displayed using `mount -v'.
  
  Ensure that buffers used for paging indicate the vnode from
  which they are operating so that counts of paging I/O operations
  from the filesystem are collected.
  
  This checkin only adds the setting of the mount point for the
  UFS/FFS filesystem, but it would be trivial to add the setting
  and clearing of the mount point at filesystem mount/unmount
  time for other filesystems too.
  
  Reviewed by: kib
  
  MFC 234024:
  Drop an unnecessary setting of si_mountpt when updating a UFS mount point.
  Clearly it must have been set when the mount was done.
  
  Reviewed by: kib
  
  MFC 234025:
  Add I/O accounting to msdos filesystem.
  
  Suggested and reviewed by: kib
  
  MFC 234026:
  Expand locking around identification of filesystem mount point when
  accounting for I/O counts at completion of I/O operation. Also switch
  from using global devmtx to vnode mutex to reduce contention.
  
  Suggested and reviewed by: kib

Modified:
  stable/9/sys/fs/msdosfs/msdosfs_vfsops.c
  stable/9/sys/geom/geom_vfs.c
  stable/9/sys/sys/conf.h
  stable/9/sys/ufs/ffs/ffs_vfsops.c
  stable/9/sys/vm/vnode_pager.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- stable/9/sys/fs/msdosfs/msdosfs_vfsops.cThu Apr 19 16:13:15 2012
(r234465)
+++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.cThu Apr 19 18:03:24 2012
(r234466)
@@ -401,6 +401,8 @@ msdosfs_mount(struct mount *mp)
return error;
}
 
+   if (devvp->v_type == VCHR && devvp->v_rdev != NULL)
+   devvp->v_rdev->si_mountpt = mp;
vfs_mountedfrom(mp, from);
 #ifdef MSDOSFS_DEBUG
printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, 
pmp->pm_inusemap);
@@ -843,6 +845,8 @@ msdosfs_unmount(struct mount *mp, int mn
}
 #endif
DROP_GIANT();
+   if (pmp->pm_devvp->v_type == VCHR && pmp->pm_devvp->v_rdev != NULL)
+   pmp->pm_devvp->v_rdev->si_mountpt = NULL;
g_topology_lock();
g_vfs_close(pmp->pm_cp);
g_topology_unlock();

Modified: stable/9/sys/geom/geom_vfs.c
==
--- stable/9/sys/geom/geom_vfs.cThu Apr 19 16:13:15 2012
(r234465)
+++ stable/9/sys/geom/geom_vfs.cThu Apr 19 18:03:24 2012
(r234466)
@@ -70,6 +70,9 @@ g_vfs_done(struct bio *bip)
 {
struct buf *bp;
int vfslocked;
+   struct mount *mp;
+   struct vnode *vp;
+   struct cdev *cdevp;
 
/*
 * Provider ('bio_to') could have withered away sometime
@@ -81,12 +84,50 @@ g_vfs_done(struct bio *bip)
if (bip->bio_from->provider == NULL)
bip->bio_to = NULL;
 
+   /*
+* Collect statistics on synchronous and asynchronous read
+* and write counts for disks that have associated filesystems.
+* Since this is run by the g_up thread it is single threaded and
+* we do not need to use atomic increments on the counters.
+*/
+   bp = bip->bio_caller2;
+   vp = bp->b_vp;
+   if (vp == NULL) {
+   mp = NULL;
+   } else {
+   /*
+* If not a disk vnode, use its associated mount point
+* otherwise use the mountpoint associated with the disk.
+*/
+   VI_LOCK(vp);
+   if (vp->v_type != VCHR ||
+   (cdevp = vp->v_rdev) == NULL ||
+   cdevp->si_devsw == NULL ||
+   

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Jason Evans
On Apr 19, 2012, at 7:15 AM, Conrad J. Sabatier wrote:
> Actually, I keep getting "undefined reference to _malloc_options" while
> building libexec/atrun on amd64.  Not sure what the problem may be.
> Could it have something to do with doing a debug build (with -g)?
> 
> ===> libexec/atrun (all)
> […]
> -lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
> `_malloc_options' clang: error: linker command failed with exit code 1
> (use -v to see invocation) *** [atrun] Error code 1

Perhaps this is related to using clang rather than gcc.  I'll start a 
clang-based buildworld to see if it reproduces here.

Jason___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234467 - stable/9/sys/i386/i386

2012-04-19 Thread Jung-uk Kim
Author: jkim
Date: Thu Apr 19 20:11:43 2012
New Revision: 234467
URL: http://svn.freebsd.org/changeset/base/234467

Log:
  MFC:  r234350
  
  - When interrupt is not requested for VM86 call, make a fake exit point and
  push the address onto stack as we do for INTn emulation.  This avoids stack
  underflow when we encounter RETF instruction in VM86 mode.  Lack of this
  exit point actually caused page fault in VM86 mode with VESA module when we
  resume from suspend state.
  - Remove unnecessary CLI and STI instructions from BIOS interrupt emulation.
  INTn and IRET must be able to emulate the flag correctly.

Modified:
  stable/9/sys/i386/i386/vm86.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/i386/i386/vm86.c
==
--- stable/9/sys/i386/i386/vm86.c   Thu Apr 19 18:03:24 2012
(r234466)
+++ stable/9/sys/i386/i386/vm86.c   Thu Apr 19 20:11:43 2012
(r234467)
@@ -512,22 +512,27 @@ full:
 void
 vm86_prepcall(struct vm86frame *vmf)
 {
-   uintptr_t addr[] = { 0xA00, 0x1000 };   /* code, stack */
-   u_char intcall[] = {
-   CLI, INTn, 0x00, STI, HLT
-   };
struct vm86_kernel *vm86;
+   uint32_t *stack;
+   uint8_t *code;
 
+   code = (void *)0xa00;
+   stack = (void *)(0x1000 - 2);   /* keep aligned */
if ((vmf->vmf_trapno & PAGE_MASK) <= 0xff) {
/* interrupt call requested */
-   intcall[2] = (u_char)(vmf->vmf_trapno & 0xff);
-   memcpy((void *)addr[0], (void *)intcall, sizeof(intcall));
-   vmf->vmf_ip = addr[0];
+   code[0] = INTn;
+   code[1] = vmf->vmf_trapno & 0xff;
+   code[2] = HLT;
+   vmf->vmf_ip = (uintptr_t)code;
vmf->vmf_cs = 0;
+   } else {
+   code[0] = HLT;
+   stack--;
+   stack[0] = MAKE_VEC(0, (uintptr_t)code);
}
-   vmf->vmf_sp = addr[1] - 2;  /* keep aligned */
-   vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0;
+   vmf->vmf_sp = (uintptr_t)stack;
vmf->vmf_ss = 0;
+   vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0;
vmf->vmf_eflags = PSL_VIF | PSL_VM | PSL_USER;
 
vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234468 - in stable/9: contrib/bind9 share/doc/bind9

2012-04-19 Thread Doug Barton
Author: dougb
Date: Thu Apr 19 20:44:40 2012
New Revision: 234468
URL: http://svn.freebsd.org/changeset/base/234468

Log:
  MFV r234164/MFC r234165:
  
  The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes.
  This change was noticed by ISC at:
  
  https://lists.isc.org/pipermail/bind-users/2012-April/087345.html
  
  and verified by me both by comparing the contents of the old and new
  distfiles and by verifying the PGP signature on the new distfile.

Deleted:
  stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.html
  stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.pdf
  stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.txt
  stable/9/contrib/bind9/release-notes.css
Modified:
  stable/9/share/doc/bind9/Makefile
Directory Properties:
  stable/9/contrib/bind9/   (props changed)
  stable/9/share/doc/bind9/   (props changed)

Modified: stable/9/share/doc/bind9/Makefile
==
--- stable/9/share/doc/bind9/Makefile   Thu Apr 19 20:11:43 2012
(r234467)
+++ stable/9/share/doc/bind9/Makefile   Thu Apr 19 20:44:40 2012
(r234468)
@@ -8,9 +8,7 @@ SRCDIR= ${BIND_DIR}/doc
 NO_OBJ=
 
 FILESGROUPS=   TOP ARM MISC
-TOP=   CHANGES COPYRIGHT FAQ HISTORY README \
-   RELEASE-NOTES-BIND-9.8.1.pdf RELEASE-NOTES-BIND-9.8.1.txt \
-   RELEASE-NOTES-BIND-9.8.1.html release-notes.css
+TOP=   CHANGES COPYRIGHT FAQ HISTORY README
 TOPDIR=${DOCDIR}/bind9
 ARM=   Bv9ARM.ch01.html Bv9ARM.ch02.html Bv9ARM.ch03.html \
Bv9ARM.ch04.html Bv9ARM.ch05.html Bv9ARM.ch06.html \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234469 - head/libexec/ulog-helper

2012-04-19 Thread Ed Schouten
Author: ed
Date: Thu Apr 19 21:12:08 2012
New Revision: 234469
URL: http://svn.freebsd.org/changeset/base/234469

Log:
  Do a better job at determining the username of the login session.
  
  When multiple users share the same UID, the old code will simply pick an
  arbitrary username to attach to the utmpx entries. Make the code a bit
  more accurate by first checking whether getlogin() returns a username
  which corresponds to the uid of the calling process. If this fails,
  simply fall back to picking an arbitrary username.
  
  Reported by:  saurik on GitHub
  MFC after:2 weeks

Modified:
  head/libexec/ulog-helper/ulog-helper.c

Modified: head/libexec/ulog-helper/ulog-helper.c
==
--- head/libexec/ulog-helper/ulog-helper.c  Thu Apr 19 20:44:40 2012
(r234468)
+++ head/libexec/ulog-helper/ulog-helper.c  Thu Apr 19 21:12:08 2012
(r234469)
@@ -46,6 +46,28 @@ __FBSDID("$FreeBSD$");
  * username.  It does allow users to log arbitrary hostnames.
  */
 
+static const char *
+get_username(void)
+{
+   const struct passwd *pw;
+   const char *login;
+   uid_t uid;
+
+   /*
+* Attempt to determine the username corresponding to this login
+* session.  First, validate the results of getlogin() against
+* the password database.  If getlogin() returns invalid data,
+* return an arbitrary username corresponding to this uid.
+*/
+   uid = getuid();
+   if ((login = getlogin()) != NULL && (pw = getpwnam(login)) != NULL &&
+   pw->pw_uid == uid)
+   return (login);
+   if ((pw = getpwuid(uid)) != NULL)
+   return (pw->pw_name);
+   return (NULL);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -57,7 +79,7 @@ main(int argc, char *argv[])
 
if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) {
/* Username. */
-   user = user_from_uid(getuid(), 1);
+   user = get_username();
if (user == NULL)
return (EX_OSERR);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r234353 - in head: . contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/A

2012-04-19 Thread Joerg Sonnenberger
On Thu, Apr 19, 2012 at 09:14:41PM +, Alexander Best wrote:
> On Mon Apr 16 12, Dimitry Andric wrote:
> > Author: dim
> > Date: Mon Apr 16 21:23:25 2012
> > New Revision: 234353
> > URL: http://svn.freebsd.org/changeset/base/234353
> > 
> > Log:
> >   Upgrade our copy of llvm/clang to trunk r154661, in preparation of the
> >   upcoming 3.1 release (expected in a few weeks).  Preliminary release
> >   notes can be found at: 
> 
> very nice. :)
> 
> any reason '-fformat-extensions'-support still hasn't been pushed upstream as
> something like '-fbsd-extensions'?

I think it's the wrong approach. What about adding a freebsd_printf
format modifer (similar to the existing gnu_printf) and tagging the
kernel printf accordingly?

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


svn commit: r234470 - in stable/9/sys: i386/conf kern ufs/ffs ufs/ufs

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 22:22:21 2012
New Revision: 234470
URL: http://svn.freebsd.org/changeset/base/234470

Log:
  MFC of 233817:
  
  A file cannot be deallocated until its last name has been removed
  and it is no longer referenced by a user process. The inode for a
  file whose name has been removed, but is still referenced at the
  time of a crash will still be allocated in the filesystem, but will
  have no references (e.g., they will have no names referencing them
  from any directory).
  
  With traditional soft updates these unreferenced inodes will be
  found and reclaimed when the background fsck is run. When using
  journaled soft updates, the kernel must keep track of these inodes
  so that it can find and reclaim them during the cleanup process.
  Their existence cannot be stored in the journal as the journal only
  handles short-term events, and they may persist for days. So, they
  are tracked by keeping them in a linked list whose head pointer is
  stored in the superblock. The journal tracks them only until their
  linked list pointers have been commited to disk. Part of the cleanup
  process involves traversing the list of unreferenced inodes and
  reclaiming them.
  
  This bug was triggered when confusion arose in the commit steps
  of keeping the unreferenced-inode linked list coherent on disk.
  Notably, a race between the link() system call adding a link-count
  to a file and the unlink() system call removing a link-count to
  the file. Here if the unlink() ran after link() had looked up
  the file but before link() had incremented the link-count of the
  file, the file's link-count would drop to zero before the link()
  incremented it back up to one. If the file was referenced by a
  user process, the first transition through zero made it appear
  that it should be added to the unreferenced-inode list when in
  fact it should not have been added. If the new name created by
  link() was deleted within a few seconds (with the file still
  referenced by a user process) it would legitimately be a candidate
  for addition to the unreferenced-inode list. The result was that
  there were two attempts to add the same inode to the unreferenced-inode
  list which scrambled the unreferenced-inode list's pointers leading
  to a panic. The fix is to detect and avoid the false attempt at
  adding it to the unreferenced-inode list by having the link()
  system call check to see if the link count is zero before it
  increments it. If it is, the link() fails with ENOENT (showing that
  it has failed the link()/unlink() race).
  
  While tracking down this bug, we have added additional assertions
  to detect the problem sooner and also simplified some of the code.
  
  Reported by:  Kirk Russell
  Fix submitted by: Jeff Roberson
  Tested by:Peter Holm
  PR:   kern/159971

Modified:
  stable/9/sys/ufs/ffs/ffs_softdep.c
  stable/9/sys/ufs/ufs/ufs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_softdep.c
==
--- stable/9/sys/ufs/ffs/ffs_softdep.c  Thu Apr 19 21:12:08 2012
(r234469)
+++ stable/9/sys/ufs/ffs/ffs_softdep.c  Thu Apr 19 22:22:21 2012
(r234470)
@@ -4322,6 +4322,7 @@ inodedep_lookup_ip(ip)
(void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags,
&inodedep);
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
+   KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked"));
 
return (inodedep);
 }
@@ -8454,6 +8455,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir
if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0,
&inodedep) == 0)
panic("softdep_setup_remove: Lost inodedep.");
+   KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked"));
dirrem->dm_state |= ONDEPLIST;
LIST_INSERT_HEAD(&inodedep->id_dirremhd, dirrem, dm_inonext);
 
@@ -8986,6 +8988,7 @@ first_unlinked_inodedep(ump)
struct inodedep *inodedep;
struct inodedep *idp;
 
+   mtx_assert(&lk, MA_OWNED);
   

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Jason Evans
On Apr 19, 2012, at 11:44 AM, Jason Evans wrote:
> On Apr 19, 2012, at 7:15 AM, Conrad J. Sabatier wrote:
>> Actually, I keep getting "undefined reference to _malloc_options" while
>> building libexec/atrun on amd64.  Not sure what the problem may be.
>> Could it have something to do with doing a debug build (with -g)?
>> 
>> ===> libexec/atrun (all)
>> […]
>> -lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
>> `_malloc_options' clang: error: linker command failed with exit code 1
>> (use -v to see invocation) *** [atrun] Error code 1
> 
> Perhaps this is related to using clang rather than gcc.  I'll start a 
> clang-based buildworld to see if it reproduces here.
> 
> Jason


With /etc/make.conf as:

CFLAGS+=-g
STRIP=
CC=clang
CXX=clang++
CPP=clang-cpp

I got this buildworld failure:
---
clang -O2 -pipe -g  -I/usr/src/lib/csu/amd64/../common  
-I/usr/src/lib/csu/amd64/../../libc/include -fno-omit-frame-pointer -std=gnu99 
-Qunused-arguments  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wreturn-type -Wcast-qual -Wwrite-strin
gs -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign 
-Wno-empty-body -Wno-string-plus-int -c -o crt1.o crt1.scrt1.s:8:2: error: 
input can't have .file dwarf directives when -g is used to generate dwarf debug 
info for assembly code
.file   1 "/usr/src/lib/csu/amd64/crt1.c"^
crt1.s:8:8: error: file number already allocated.file   1 
"/usr/src/lib/csu/amd64/crt1.c"
^crt1.s:9:2: error: input can't have .file dwarf directives 
when -g is used to generate dwarf debug info for assembly code
.file   2 "/usr/src/lib/csu/amd64/../common/crtbrand.c"
^crt1.s:10:2: error: input can't have .file dwarf directives when -g is used to 
generate dwarf debug info for assembly code
.file   3 "/usr/src/lib/csu/amd64/../common/ignore_init.c"^
---

I removed the CFLAGS+=-g line, and buildworld succeeded.

Jason___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234471 - in stable/9/sys: i386/conf kern sys

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 22:28:42 2012
New Revision: 234471
URL: http://svn.freebsd.org/changeset/base/234471

Log:
  MFC of 234157:
  
  Whitespace cleanup.

Modified:
  stable/9/sys/sys/mount.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/sys/mount.h
==
--- stable/9/sys/sys/mount.hThu Apr 19 22:22:21 2012(r234470)
+++ stable/9/sys/sys/mount.hThu Apr 19 22:28:42 2012(r234471)
@@ -200,10 +200,10 @@ void  __mnt_vnode_markerfree(str
__mnt_vnode_markerfree(&(mvp), (mp))
 
 #define MNT_VNODE_FOREACH_ABORT(mp, mvp)   \
-do {   \
- MNT_ILOCK(mp);\
-  MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);\
- MNT_IUNLOCK(mp);  \
+   do {\
+   MNT_ILOCK(mp);  \
+   MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);   \
+   MNT_IUNLOCK(mp);\
} while (0)
 
 #defineMNT_ILOCK(mp)   mtx_lock(&(mp)->mnt_mtx)
@@ -212,7 +212,7 @@ void  __mnt_vnode_markerfree(str
 #defineMNT_MTX(mp) (&(mp)->mnt_mtx)
 #defineMNT_REF(mp) (mp)->mnt_ref++
 #defineMNT_REL(mp) do {
\
-   KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref"));   
\
+   KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref"));   \
(mp)->mnt_ref--;\
if ((mp)->mnt_ref == 0) \
wakeup((mp));   \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234472 - in stable/8/sys: i386/conf sys

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 22:37:24 2012
New Revision: 234472
URL: http://svn.freebsd.org/changeset/base/234472

Log:
  MFC of 234157:
  
  Whitespace cleanup.

Modified:
  stable/8/sys/sys/mount.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/sys/mount.h
==
--- stable/8/sys/sys/mount.hThu Apr 19 22:28:42 2012(r234471)
+++ stable/8/sys/sys/mount.hThu Apr 19 22:37:24 2012(r234472)
@@ -201,10 +201,10 @@ void  __mnt_vnode_markerfree(str
__mnt_vnode_markerfree(&(mvp), (mp))
 
 #define MNT_VNODE_FOREACH_ABORT(mp, mvp)   \
-do {   \
- MNT_ILOCK(mp);\
-  MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);\
- MNT_IUNLOCK(mp);  \
+   do {\
+   MNT_ILOCK(mp);  \
+   MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);   \
+   MNT_IUNLOCK(mp);\
} while (0)
 
 #defineMNT_ILOCK(mp)   mtx_lock(&(mp)->mnt_mtx)
@@ -213,7 +213,7 @@ void  __mnt_vnode_markerfree(str
 #defineMNT_MTX(mp) (&(mp)->mnt_mtx)
 #defineMNT_REF(mp) (mp)->mnt_ref++
 #defineMNT_REL(mp) do {
\
-   KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref"));   
\
+   KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref"));   \
(mp)->mnt_ref--;\
if ((mp)->mnt_ref == 0) \
wakeup((mp));   \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234473 - in stable/9/sys: i386/conf kern sys ufs/ffs

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 22:42:28 2012
New Revision: 234473
URL: http://svn.freebsd.org/changeset/base/234473

Log:
  MFC of 234158:
  
  Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
  static and declare its prototype in sys/vnode.h) so that it can be
  called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
  instead of the body of vinactive() being cut and pasted into
  process_deferred_inactive().
  
  Reviewed by: kib
  MFC after:   2 weeks

Modified:
  stable/9/sys/kern/vfs_subr.c
  stable/9/sys/sys/vnode.h
  stable/9/sys/ufs/ffs/ffs_snapshot.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/kern/vfs_subr.c
==
--- stable/9/sys/kern/vfs_subr.cThu Apr 19 22:37:24 2012
(r234472)
+++ stable/9/sys/kern/vfs_subr.cThu Apr 19 22:42:28 2012
(r234473)
@@ -103,7 +103,6 @@ static int  flushbuflist(struct bufv *buf
 static voidsyncer_shutdown(void *arg, int howto);
 static int vtryrecycle(struct vnode *vp);
 static voidvbusy(struct vnode *vp);
-static voidvinactive(struct vnode *, struct thread *);
 static voidv_incr_usecount(struct vnode *);
 static voidv_decr_usecount(struct vnode *);
 static voidv_decr_useonly(struct vnode *);
@@ -2401,7 +2400,7 @@ vdropl(struct vnode *vp)
  * OWEINACT tracks whether a vnode missed a call to inactive due to a
  * failed lock upgrade.
  */
-static void
+void
 vinactive(struct vnode *vp, struct thread *td)
 {
 

Modified: stable/9/sys/sys/vnode.h
==
--- stable/9/sys/sys/vnode.hThu Apr 19 22:37:24 2012(r234472)
+++ stable/9/sys/sys/vnode.hThu Apr 19 22:42:28 2012(r234473)
@@ -635,6 +635,7 @@ int vget(struct vnode *vp, int lockflag,
 void   vgone(struct vnode *vp);
 void   vhold(struct vnode *);
 void   vholdl(struct vnode *);
+void   vinactive(struct vnode *, struct thread *);
 intvinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
 intvtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td,
off_t length, int blksize);

Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c
==
--- stable/9/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 22:37:24 2012
(r234472)
+++ stable/9/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 22:42:28 2012
(r234473)
@@ -2572,20 +2572,9 @@ process_deferred_inactive(struct mount *
MNT_ILOCK(mp);
continue;
}
-   
-   VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp,
-("process_deferred_inactive: "
- "recursed on VI_DOINGINACT"));
-   vp->v_iflag |= VI_DOINGINACT;
-   vp->v_iflag &= ~VI_OWEINACT;
-   VI_UNLOCK(vp);
-   (void) VOP_INACTIVE(vp, td);
-   VI_LOCK(vp);
-   VNASSERT(vp->v_iflag & VI_DOINGINACT, vp,
-("process_deferred_inactive: lost VI_DOINGINACT"));
+   vinactive(vp, td);
VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
 ("process_deferred_inactive: got VI_OWEINACT"));
-   vp->v_iflag &= ~VI_DOINGINACT;
VI_UNLOCK(vp);
VOP_UNLOCK(vp, 0);
vdrop(vp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234474 - in stable/8/sys: i386/conf kern sys ufs/ffs

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Thu Apr 19 23:04:35 2012
New Revision: 234474
URL: http://svn.freebsd.org/changeset/base/234474

Log:
  MFC of 234158:
  
  Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
  static and declare its prototype in sys/vnode.h) so that it can be
  called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
  instead of the body of vinactive() being cut and pasted into
  process_deferred_inactive().
  
  Reviewed by: kib

Modified:
  stable/8/sys/kern/vfs_subr.c
  stable/8/sys/sys/vnode.h
  stable/8/sys/ufs/ffs/ffs_snapshot.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/kern/vfs_subr.c
==
--- stable/8/sys/kern/vfs_subr.cThu Apr 19 22:42:28 2012
(r234473)
+++ stable/8/sys/kern/vfs_subr.cThu Apr 19 23:04:35 2012
(r234474)
@@ -103,7 +103,6 @@ static int  flushbuflist(struct bufv *buf
 static voidsyncer_shutdown(void *arg, int howto);
 static int vtryrecycle(struct vnode *vp);
 static voidvbusy(struct vnode *vp);
-static voidvinactive(struct vnode *, struct thread *);
 static voidv_incr_usecount(struct vnode *);
 static voidv_decr_usecount(struct vnode *);
 static voidv_decr_useonly(struct vnode *);
@@ -2404,7 +2403,7 @@ vdropl(struct vnode *vp)
  * OWEINACT tracks whether a vnode missed a call to inactive due to a
  * failed lock upgrade.
  */
-static void
+void
 vinactive(struct vnode *vp, struct thread *td)
 {
 

Modified: stable/8/sys/sys/vnode.h
==
--- stable/8/sys/sys/vnode.hThu Apr 19 22:42:28 2012(r234473)
+++ stable/8/sys/sys/vnode.hThu Apr 19 23:04:35 2012(r234474)
@@ -637,6 +637,7 @@ int vget(struct vnode *vp, int lockflag,
 void   vgone(struct vnode *vp);
 void   vhold(struct vnode *);
 void   vholdl(struct vnode *);
+void   vinactive(struct vnode *, struct thread *);
 intvinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
 intvtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td,
off_t length, int blksize);

Modified: stable/8/sys/ufs/ffs/ffs_snapshot.c
==
--- stable/8/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 22:42:28 2012
(r234473)
+++ stable/8/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 23:04:35 2012
(r234474)
@@ -2441,20 +2441,9 @@ process_deferred_inactive(struct mount *
MNT_ILOCK(mp);
continue;
}
-   
-   VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp,
-("process_deferred_inactive: "
- "recursed on VI_DOINGINACT"));
-   vp->v_iflag |= VI_DOINGINACT;
-   vp->v_iflag &= ~VI_OWEINACT;
-   VI_UNLOCK(vp);
-   (void) VOP_INACTIVE(vp, td);
-   VI_LOCK(vp);
-   VNASSERT(vp->v_iflag & VI_DOINGINACT, vp,
-("process_deferred_inactive: lost VI_DOINGINACT"));
+   vinactive(vp, td);
VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
 ("process_deferred_inactive: got VI_OWEINACT"));
-   vp->v_iflag &= ~VI_DOINGINACT;
VI_UNLOCK(vp);
VOP_UNLOCK(vp, 0);
vdrop(vp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234476 - in stable/9/sys: powerpc/aim vm

2012-04-19 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Apr 20 00:45:23 2012
New Revision: 234476
URL: http://svn.freebsd.org/changeset/base/234476

Log:
  MFC r233949,233957,233964,234149,234155:
  More PMAP concurrency and performance improvements by only flushing icaches
  when needed and executing ptesync only when architecturally required.

Modified:
  stable/9/sys/powerpc/aim/machdep.c
  stable/9/sys/powerpc/aim/mmu_oea.c
  stable/9/sys/powerpc/aim/mmu_oea64.c
  stable/9/sys/powerpc/aim/moea64_native.c
  stable/9/sys/vm/vm_page.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/powerpc/aim/machdep.c
==
--- stable/9/sys/powerpc/aim/machdep.c  Fri Apr 20 00:34:15 2012
(r234475)
+++ stable/9/sys/powerpc/aim/machdep.c  Fri Apr 20 00:45:23 2012
(r234476)
@@ -400,6 +400,9 @@ powerpc_init(vm_offset_t startkernel, vm
cacheline_size = 32;
}
 
+   /* Make sure the kernel icache is valid before we go too much further */
+   __syncicache((caddr_t)startkernel, endkernel - startkernel);
+
#ifndef __powerpc64__
/*
 * Figure out whether we need to use the 64 bit PMAP. This works by

Modified: stable/9/sys/powerpc/aim/mmu_oea.c
==
--- stable/9/sys/powerpc/aim/mmu_oea.c  Fri Apr 20 00:34:15 2012
(r234475)
+++ stable/9/sys/powerpc/aim/mmu_oea.c  Fri Apr 20 00:45:23 2012
(r234476)
@@ -1055,7 +1055,7 @@ moea_enter_locked(pmap_t pmap, vm_offset
struct  pvo_head *pvo_head;
uma_zone_t  zone;
vm_page_t   pg;
-   u_int   pte_lo, pvo_flags, was_exec;
+   u_int   pte_lo, pvo_flags;
int error;
 
if (!moea_initialized) {
@@ -1063,13 +1063,11 @@ moea_enter_locked(pmap_t pmap, vm_offset
zone = moea_upvo_zone;
pvo_flags = 0;
pg = NULL;
-   was_exec = PTE_EXEC;
} else {
pvo_head = vm_page_to_pvoh(m);
pg = m;
zone = moea_mpvo_zone;
pvo_flags = PVO_MANAGED;
-   was_exec = 0;
}
if (pmap_bootstrapped)
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
@@ -1085,18 +1083,6 @@ moea_enter_locked(pmap_t pmap, vm_offset
zone = moea_upvo_zone;
}
 
-   /*
-* If this is a managed page, and it's the first reference to the page,
-* clear the execness of the page.  Otherwise fetch the execness.
-*/
-   if ((pg != NULL) && ((m->oflags & VPO_UNMANAGED) == 0)) {
-   if (LIST_EMPTY(pvo_head)) {
-   moea_attr_clear(pg, PTE_EXEC);
-   } else {
-   was_exec = moea_attr_fetch(pg) & PTE_EXEC;
-   }
-   }
-
pte_lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m));
 
if (prot & VM_PROT_WRITE) {
@@ -1117,22 +1103,14 @@ moea_enter_locked(pmap_t pmap, vm_offset
pte_lo, pvo_flags);
 
/*
-* Flush the real page from the instruction cache if this page is
-* mapped executable and cacheable and was not previously mapped (or
-* was not mapped executable).
+* Flush the real page from the instruction cache. This has be done
+* for all user mappings to prevent information leakage via the
+* instruction cache. moea_pvo_enter() returns ENOENT for the first
+* mapping for a page.
 */
-   if (error == 0 && (pvo_flags & PVO_EXECUTABLE) &&
-   (pte_lo & PTE_I) == 0 && was_exec == 0) {
-   /*
-* Flush the real memory from the cache.
-*/
+   if (pmap != kernel_pmap && error == ENOENT &&
+   (pte_lo & (PTE_I | PTE_G)) == 0)
moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE);
-   if (pg != NULL)
-   moea_attr_save(pg, PTE_EXEC);
-   }
-
-   /* XXX syncicache always until problems are sorted */
-   moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE);
 }
 
 /*
@@ -1454,12 +1432,6 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t 
panic("moea_kenter: failed to enter va %#x pa %#x: %d", va,
pa, error);
 
-   /*
-* Flush the real memory from the instruction cache.
-*/
-   if ((pte_lo & (PTE_I | PTE_G)) == 0) {
-   moea_syncicache(pa, PAGE_SIZE);
-   }
PMAP_UNLOCK(kernel_pmap);
 }
 

Modified: stable/9/sys/powerpc/aim/mmu_oea64.c
==
--- stable/9/sys/powerpc/aim/mmu_oea64.cFri Apr 20 00:34:15 2012
(r234475)
+++ stable/9/sys/powerpc/aim/mmu_oea64.cFri Apr 20 00:45:23 2012
(r234476)
@@ -283,8 +283,6 @@ static struct   pvo_entry *moea64_pvo_find
 /*
  *

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Conrad J. Sabatier
On Thu, 19 Apr 2012 15:23:39 -0700
Jason Evans  wrote:

> On Apr 19, 2012, at 11:44 AM, Jason Evans wrote:
> > On Apr 19, 2012, at 7:15 AM, Conrad J. Sabatier wrote:
> >> Actually, I keep getting "undefined reference to _malloc_options"
> >> while building libexec/atrun on amd64.  Not sure what the problem
> >> may be. Could it have something to do with doing a debug build
> >> (with -g)?
> >> 
> >> ===> libexec/atrun (all)
> >> […]
> >> -lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
> >> `_malloc_options' clang: error: linker command failed with exit
> >> code 1 (use -v to see invocation) *** [atrun] Error code 1
> > 
> > Perhaps this is related to using clang rather than gcc.  I'll start
> > a clang-based buildworld to see if it reproduces here.
> > 
> > Jason
> 
> 
> With /etc/make.conf as:
> 
>   CFLAGS+=-g
>   STRIP=
>   CC=clang
>   CXX=clang++
>   CPP=clang-cpp
> 
> I got this buildworld failure:
> ---
> clang -O2 -pipe -g  -I/usr/src/lib/csu/amd64/../common
> -I/usr/src/lib/csu/amd64/../../libc/include -fno-omit-frame-pointer
> -std=gnu99 -Qunused-arguments  -Wsystem-headers -Werror -Wall
> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual
> -Wwrite-strin gs -Wswitch -Wshadow -Wunused-parameter -Wcast-align
> -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
> -Wold-style-definition -Wno-pointer-sign -Wno-empty-body
> -Wno-string-plus-int -c -o crt1.o crt1.scrt1.s:8:2: error: input
> can't have .file dwarf directives when -g is used to generate dwarf
> debug info for assembly code .file   1
> "/usr/src/lib/csu/amd64/crt1.c"^ crt1.s:8:8: error: file
> number already allocated.file   1
> "/usr/src/lib/csu/amd64/crt1.c" ^crt1.s:9:2: error: input can't
> have .file dwarf directives when -g is used to generate dwarf debug
> info for assembly code .file   2
> "/usr/src/lib/csu/amd64/../common/crtbrand.c"^crt1.s:10:2:
> error: input can't have .file dwarf directives when -g is used to
> generate dwarf debug info for assembly code .file   3
> "/usr/src/lib/csu/amd64/../common/ignore_init.c"^ ---
> 
> I removed the CFLAGS+=-g line, and buildworld succeeded.
> 
> Jason

Yes, I've seen exactly the same on other, earlier builds (I've been
using essentially exactly the same make.conf settings as what you just
posted, as well as using "make -j8").  That other error output I posted
earlier in this thread resulted after I had already seen the above, and
tried another buildworld without -j8.

So, apparently, the thing to do for now is *not* attempt to build a
debug world, it would seem.  I suspected as much.  :-)

Thank you very much for giving your attention to this matter.

-- 
Conrad J. Sabatier
conr...@cox.net
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234481 - head/sys/modules/iscsi/initiator

2012-04-19 Thread Xin LI
Author: delphij
Date: Fri Apr 20 04:40:39 2012
New Revision: 234481
URL: http://svn.freebsd.org/changeset/base/234481

Log:
  Fix build.

Modified:
  head/sys/modules/iscsi/initiator/Makefile

Modified: head/sys/modules/iscsi/initiator/Makefile
==
--- head/sys/modules/iscsi/initiator/Makefile   Fri Apr 20 03:12:02 2012
(r234480)
+++ head/sys/modules/iscsi/initiator/Makefile   Fri Apr 20 04:40:39 2012
(r234481)
@@ -1,18 +1,14 @@
 # $FreeBSD$
 
-S=  ${.CURDIR}/../../..
-.PATH: $S/dev/iscsi/initiator
-
+.PATH: ${.CURDIR}/../../../dev/iscsi/initiator
 KMOD=iscsi_initiator
 
 SRCS=  iscsi.h iscsivar.h
 SRCS+= iscsi.c isc_cam.c isc_soc.c isc_sm.c isc_subr.c iscsi_subr.c
 SRCS+= opt_cam.h opt_iscsi_initiator.h
 SRCS+= bus_if.h device_if.h
-#CFLAGS+= -DNO_USE_MBUF
-CFLAGS+= -DISCSI_INITIATOR_DEBUG=2
-#CFLAGS+= -DISCSI_INITIATOR_DEBUG=2
-CFLAGS+= -DINVARIANTS
-CFLAGS+= -I$S
-CFLAGS+= -DINVARIANTS
+
+# Debugging
+# CFLAGS+= -DISCSI_INITIATOR_DEBUG=9
+
 .include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r234482 - in head/sys: fs/msdosfs fs/nfsserver kern sys

2012-04-19 Thread Kirk McKusick
Author: mckusick
Date: Fri Apr 20 06:50:44 2012
New Revision: 234482
URL: http://svn.freebsd.org/changeset/base/234482

Log:
  This change creates a new list of active vnodes associated with
  a mount point. Active vnodes are those with a non-zero use or hold
  count, e.g., those vnodes that are not on the free list. Note that
  this list is in addition to the list of all the vnodes associated
  with a mount point.
  
  To avoid adding another set of linkage pointers to the vnode
  structure, the active list uses the existing linkage pointers
  used by the free list (previously named v_freelist, now renamed
  v_actfreelist).
  
  This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loops
  over just the active vnodes associated with a mount point (typically
  less than 1% of the vnodes associated with the mount point).
  
  Reviewed by: kib
  Tested by:   Peter Holm
  MFC after:   2 weeks

Modified:
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/kern/vfs_mount.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/mount.h
  head/sys/sys/vnode.h

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- head/sys/fs/msdosfs/msdosfs_vfsops.cFri Apr 20 04:40:39 2012
(r234481)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.cFri Apr 20 06:50:44 2012
(r234482)
@@ -834,7 +834,7 @@ msdosfs_unmount(struct mount *mp, int mn
vn_printf(vp,
"msdosfs_umount(): just before calling VOP_CLOSE()\n");
printf("freef %p, freeb %p, mount %p\n",
-   TAILQ_NEXT(vp, v_freelist), vp->v_freelist.tqe_prev,
+   TAILQ_NEXT(vp, v_actfreelist), vp->v_actfreelist.tqe_prev,
vp->v_mount);
printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n",
TAILQ_FIRST(&vp->v_bufobj.bo_clean.bv_hd),

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 20 04:40:39 2012
(r234481)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 20 06:50:44 2012
(r234482)
@@ -2907,12 +2907,14 @@ nfsd_mntinit(void)
inited = 1;
nfsv4root_mnt.mnt_flag = (MNT_RDONLY | MNT_EXPORTED);
TAILQ_INIT(&nfsv4root_mnt.mnt_nvnodelist);
+   TAILQ_INIT(&nfsv4root_mnt.mnt_activevnodelist);
nfsv4root_mnt.mnt_export = NULL;
TAILQ_INIT(&nfsv4root_opt);
TAILQ_INIT(&nfsv4root_newopt);
nfsv4root_mnt.mnt_opt = &nfsv4root_opt;
nfsv4root_mnt.mnt_optnew = &nfsv4root_newopt;
nfsv4root_mnt.mnt_nvnodelistsize = 0;
+   nfsv4root_mnt.mnt_activevnodelistsize = 0;
 }
 
 /*

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Fri Apr 20 04:40:39 2012(r234481)
+++ head/sys/kern/vfs_mount.c   Fri Apr 20 06:50:44 2012(r234482)
@@ -461,6 +461,8 @@ vfs_mount_alloc(struct vnode *vp, struct
__rangeof(struct mount, mnt_startzero, mnt_endzero));
TAILQ_INIT(&mp->mnt_nvnodelist);
mp->mnt_nvnodelistsize = 0;
+   TAILQ_INIT(&mp->mnt_activevnodelist);
+   mp->mnt_activevnodelistsize = 0;
mp->mnt_ref = 0;
(void) vfs_busy(mp, MBF_NOWAIT);
mp->mnt_op = vfsp->vfc_vfsops;
@@ -514,6 +516,8 @@ vfs_mount_destroy(struct mount *mp)
}
if (mp->mnt_nvnodelistsize != 0)
panic("vfs_mount_destroy: nonzero nvnodelistsize");
+   if (mp->mnt_activevnodelistsize != 0)
+   panic("vfs_mount_destroy: nonzero activevnodelistsize");
if (mp->mnt_lockref != 0)
panic("vfs_mount_destroy: nonzero lock refcount");
MNT_IUNLOCK(mp);

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cFri Apr 20 04:40:39 2012(r234481)
+++ head/sys/kern/vfs_subr.cFri Apr 20 06:50:44 2012(r234482)
@@ -775,12 +775,16 @@ vnlru_free(int count)
break;
VNASSERT(vp->v_op != NULL, vp,
("vnlru_free: vnode already reclaimed."));
-   TAILQ_REMOVE(&vnode_free_list, vp, v_freelist);
+   KASSERT((vp->v_iflag & VI_FREE) != 0,
+   ("Removing vnode not on freelist"));
+   KASSERT((vp->v_iflag & VI_ACTIVE) == 0,
+   ("Mangling active vnode"));
+   TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist);
/*
 * Don't recycle if we can't get the interlock.
 */
if (!VI_TRYLOCK(vp)) {
-   TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist);
+   TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_actfreelist)