From owner-svn-src-stable@FreeBSD.ORG Sun Oct 19 06:38:34 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AA41065687; Sun, 19 Oct 2008 06:38:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9C48FC1B; Sun, 19 Oct 2008 06:38:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J6cY5t036076; Sun, 19 Oct 2008 06:38:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J6cYhm036074; Sun, 19 Oct 2008 06:38:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810190638.m9J6cYhm036074@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 19 Oct 2008 06:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184045 - in stable/7/sys: . dev/jme X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 06:38:34 -0000 Author: yongari Date: Sun Oct 19 06:38:34 2008 New Revision: 184045 URL: http://svn.freebsd.org/changeset/base/184045 Log: MFC r183814: Read PCI device id instead of PCI revision id. Also checks the read device id is JMC260 family. Previously it just verified the deivce is JMC260 Rev A0. This will make it easy for newer JMC2xx support. Pointed out by: bouyer at NetBSD MFC r183859: Make sure to read the last byte of EEPROM descriptor. Previously the last byte of the ethernet address was not read which in turn resulted in getting 5 out of the 6 bytes of ethernet address and always returned ENOENT. I did not notice the bug on FPGA version because of additional configuration data in EEPROM. Pointed out by: bouyer at NetBSD Approved by: re (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Sun Oct 19 06:12:47 2008 (r184044) +++ stable/7/sys/dev/jme/if_jme.c Sun Oct 19 06:38:34 2008 (r184045) @@ -415,11 +415,8 @@ jme_eeprom_macaddr(struct jme_softc *sc) do { if (jme_eeprom_read_byte(sc, offset, &fup) != 0) break; - /* Check for the end of EEPROM descriptor. */ - if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) - break; - if ((uint8_t)JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, - JME_EEPROM_PAGE_BAR1) == fup) { + if (JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, JME_EEPROM_PAGE_BAR1) == + (fup & (JME_EEPROM_FUNC_MASK | JME_EEPROM_PAGE_MASK))) { if (jme_eeprom_read_byte(sc, offset + 1, ®) != 0) break; if (reg >= JME_PAR0 && @@ -431,6 +428,9 @@ jme_eeprom_macaddr(struct jme_softc *sc) match++; } } + /* Check for the end of EEPROM descriptor. */ + if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) + break; /* Try next eeprom descriptor. */ offset += JME_EEPROM_DESC_BYTES; } while (match != ETHER_ADDR_LEN && offset < JME_EEPROM_END); @@ -624,8 +624,8 @@ jme_attach(device_t dev) goto fail; } - sc->jme_rev = pci_get_revid(dev); - if (sc->jme_rev == DEVICEID_JMC260) { + sc->jme_rev = pci_get_device(dev); + if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260) { sc->jme_flags |= JME_FLAG_FASTETH; sc->jme_flags |= JME_FLAG_NOJUMBO; } Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Sun Oct 19 06:12:47 2008 (r184044) +++ stable/7/sys/dev/jme/if_jmereg.h Sun Oct 19 06:38:34 2008 (r184045) @@ -48,6 +48,8 @@ #define DEVICEID_JMC260 0x0260 #define DEVICEREVID_JMC260_A0 0x00 +#define DEVICEID_JMC2XX_MASK 0x0FF0 + /* JMC250 PCI configuration register. */ #define JME_PCI_BAR0 0x10 /* 16KB memory window. */ From owner-svn-src-stable@FreeBSD.ORG Sun Oct 19 06:45:03 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B535B106568A; Sun, 19 Oct 2008 06:45:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2EC68FC16; Sun, 19 Oct 2008 06:45:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J6j3Kn036233; Sun, 19 Oct 2008 06:45:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J6j3LT036231; Sun, 19 Oct 2008 06:45:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810190645.m9J6j3LT036231@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 19 Oct 2008 06:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184046 - in stable/6/sys: . dev/jme X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 06:45:03 -0000 Author: yongari Date: Sun Oct 19 06:45:03 2008 New Revision: 184046 URL: http://svn.freebsd.org/changeset/base/184046 Log: MFC r183814: Read PCI device id instead of PCI revision id. Also checks the read device id is JMC260 family. Previously it just verified the deivce is JMC260 Rev A0. This will make it easy for newer JMC2xx support. Pointed out by: bouyer at NetBSD MFC r183859: Make sure to read the last byte of EEPROM descriptor. Previously the last byte of the ethernet address was not read which in turn resulted in getting 5 out of the 6 bytes of ethernet address and always returned ENOENT. I did not notice the bug on FPGA version because of additional configuration data in EEPROM. Pointed out by: bouyer at NetBSD Approved by: re (gnn) Modified: stable/6/sys/ (props changed) stable/6/sys/dev/jme/if_jme.c stable/6/sys/dev/jme/if_jmereg.h Modified: stable/6/sys/dev/jme/if_jme.c ============================================================================== --- stable/6/sys/dev/jme/if_jme.c Sun Oct 19 06:38:34 2008 (r184045) +++ stable/6/sys/dev/jme/if_jme.c Sun Oct 19 06:45:03 2008 (r184046) @@ -439,11 +439,8 @@ jme_eeprom_macaddr(struct jme_softc *sc) do { if (jme_eeprom_read_byte(sc, offset, &fup) != 0) break; - /* Check for the end of EEPROM descriptor. */ - if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) - break; - if ((uint8_t)JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, - JME_EEPROM_PAGE_BAR1) == fup) { + if (JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, JME_EEPROM_PAGE_BAR1) == + (fup & (JME_EEPROM_FUNC_MASK | JME_EEPROM_PAGE_MASK))) { if (jme_eeprom_read_byte(sc, offset + 1, ®) != 0) break; if (reg >= JME_PAR0 && @@ -455,6 +452,9 @@ jme_eeprom_macaddr(struct jme_softc *sc) match++; } } + /* Check for the end of EEPROM descriptor. */ + if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END) + break; /* Try next eeprom descriptor. */ offset += JME_EEPROM_DESC_BYTES; } while (match != ETHER_ADDR_LEN && offset < JME_EEPROM_END); @@ -648,8 +648,8 @@ jme_attach(device_t dev) goto fail; } - sc->jme_rev = pci_get_revid(dev); - if (sc->jme_rev == DEVICEID_JMC260) { + sc->jme_rev = pci_get_device(dev); + if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260) { sc->jme_flags |= JME_FLAG_FASTETH; sc->jme_flags |= JME_FLAG_NOJUMBO; } Modified: stable/6/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/6/sys/dev/jme/if_jmereg.h Sun Oct 19 06:38:34 2008 (r184045) +++ stable/6/sys/dev/jme/if_jmereg.h Sun Oct 19 06:45:03 2008 (r184046) @@ -48,6 +48,8 @@ #define DEVICEID_JMC260 0x0260 #define DEVICEREVID_JMC260_A0 0x00 +#define DEVICEID_JMC2XX_MASK 0x0FF0 + /* JMC250 PCI configuration register. */ #define JME_PCI_BAR0 0x10 /* 16KB memory window. */ From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 11:15:58 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38F3D106566B; Mon, 20 Oct 2008 11:15:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25EE38FC0A; Mon, 20 Oct 2008 11:15:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KBFwoi069541; Mon, 20 Oct 2008 11:15:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KBFvoE069538; Mon, 20 Oct 2008 11:15:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201115.m9KBFvoE069538@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 11:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184075 - in stable/7/sys: . amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 11:15:58 -0000 Author: kib Date: Mon Oct 20 11:15:57 2008 New Revision: 184075 URL: http://svn.freebsd.org/changeset/base/184075 Log: MFC r177257 (by rdivacky): Implement sched_setaffinity and get_setaffinity using real cpu affinity setting primitives. MFC r177604 (by ru): Fix build. MFC r183612: Use FreeBSD size of cpuset_t for bitmap size parameter and return EINVAL if length of user space bitmap less than our size of cpuset_t. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/syscalls.master stable/7/sys/compat/linux/linux_misc.c stable/7/sys/i386/linux/syscalls.master Modified: stable/7/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/7/sys/amd64/linux32/syscalls.master Mon Oct 20 10:11:33 2008 (r184074) +++ stable/7/sys/amd64/linux32/syscalls.master Mon Oct 20 11:15:57 2008 (r184075) @@ -407,7 +407,8 @@ 239 AUE_SENDFILE UNIMPL linux_sendfile64 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, int val, \ struct l_timespec *timeout, void *uaddr2, int val3); } -241 AUE_NULL UNIMPL linux_sched_setaffinity +241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ + l_ulong *user_mask_ptr); } 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ l_ulong *user_mask_ptr); } 243 AUE_NULL STD { int linux_set_thread_area(struct l_user_desc *desc); } Modified: stable/7/sys/compat/linux/linux_misc.c ============================================================================== --- stable/7/sys/compat/linux/linux_misc.c Mon Oct 20 10:11:33 2008 (r184074) +++ stable/7/sys/compat/linux/linux_misc.c Mon Oct 20 11:15:57 2008 (r184075) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1730,22 +1731,57 @@ linux_prctl(struct thread *td, struct li } /* - * XXX: fake one.. waiting for real implementation of affinity mask. + * Get affinity of a process. */ int linux_sched_getaffinity(struct thread *td, struct linux_sched_getaffinity_args *args) { int error; - cpumask_t i = ~0; + struct cpuset_getaffinity_args cga; - if (args->len < sizeof(cpumask_t)) +#ifdef DEBUG + if (ldebug(sched_getaffinity)) + printf(ARGS(sched_getaffinity, "%d, %d, *"), args->pid, + args->len); +#endif + if (args->len < sizeof(cpuset_t)) return (EINVAL); - error = copyout(&i, args->user_mask_ptr, sizeof(cpumask_t)); - if (error) - return (EFAULT); + cga.level = CPU_LEVEL_WHICH; + cga.which = CPU_WHICH_PID; + cga.id = args->pid; + cga.cpusetsize = sizeof(cpuset_t); + cga.mask = (cpuset_t *) args->user_mask_ptr; - td->td_retval[0] = sizeof(cpumask_t); - return (0); + if ((error = cpuset_getaffinity(td, &cga)) == 0) + td->td_retval[0] = sizeof(cpuset_t); + + return (error); +} + +/* + * Set affinity of a process. + */ +int +linux_sched_setaffinity(struct thread *td, + struct linux_sched_setaffinity_args *args) +{ + struct cpuset_setaffinity_args csa; + +#ifdef DEBUG + if (ldebug(sched_setaffinity)) + printf(ARGS(sched_setaffinity, "%d, %d, *"), args->pid, + args->len); +#endif + if (args->len < sizeof(cpuset_t)) + return (EINVAL); + + csa.level = CPU_LEVEL_WHICH; + csa.which = CPU_WHICH_PID; + csa.id = args->pid; + csa.cpusetsize = sizeof(cpuset_t); + csa.mask = (cpuset_t *) args->user_mask_ptr; + + return (cpuset_setaffinity(td, &csa)); } Modified: stable/7/sys/i386/linux/syscalls.master ============================================================================== --- stable/7/sys/i386/linux/syscalls.master Mon Oct 20 10:11:33 2008 (r184074) +++ stable/7/sys/i386/linux/syscalls.master Mon Oct 20 11:15:57 2008 (r184075) @@ -409,7 +409,8 @@ 239 AUE_SENDFILE UNIMPL linux_sendfile64 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, int val, \ struct l_timespec *timeout, void *uaddr2, int val3); } -241 AUE_NULL UNIMPL linux_sched_setaffinity +241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ + l_ulong *user_mask_ptr); } 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ l_ulong *user_mask_ptr); } 243 AUE_NULL STD { int linux_set_thread_area(struct l_user_desc *desc); } From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 11:17:21 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79971065685; Mon, 20 Oct 2008 11:17:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D54B48FC0C; Mon, 20 Oct 2008 11:17:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KBHK9Q069601; Mon, 20 Oct 2008 11:17:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KBHKmb069598; Mon, 20 Oct 2008 11:17:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201117.m9KBHKmb069598@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 11:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184076 - stable/7/sys/i386/linux X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 11:17:21 -0000 Author: kib Date: Mon Oct 20 11:17:20 2008 New Revision: 184076 URL: http://svn.freebsd.org/changeset/base/184076 Log: Regenerate. Approved by: re (kensmith) Modified: stable/7/sys/i386/linux/linux_proto.h stable/7/sys/i386/linux/linux_syscall.h stable/7/sys/i386/linux/linux_sysent.c Modified: stable/7/sys/i386/linux/linux_proto.h ============================================================================== --- stable/7/sys/i386/linux/linux_proto.h Mon Oct 20 11:15:57 2008 (r184075) +++ stable/7/sys/i386/linux/linux_proto.h Mon Oct 20 11:17:20 2008 (r184076) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.89 2007/09/18 19:50:33 dwmalone Exp + * created from FreeBSD: stable/7/sys/i386/linux/syscalls.master 184075 2008-10-20 11:15:57Z kib */ #ifndef _LINUX_SYSPROTO_H_ @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -731,6 +732,11 @@ struct linux_sys_futex_args { char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; }; +struct linux_sched_setaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; struct linux_sched_getaffinity_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; @@ -1124,6 +1130,7 @@ int linux_lremovexattr(struct thread *, int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); +int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); int linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *); int linux_get_thread_area(struct thread *, struct linux_get_thread_area_args *); @@ -1380,6 +1387,7 @@ int linux_unshare(struct thread *, struc #define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_tkill AUE_NULL #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL +#define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL #define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL #define LINUX_SYS_AUE_linux_get_thread_area AUE_NULL Modified: stable/7/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/7/sys/i386/linux/linux_syscall.h Mon Oct 20 11:15:57 2008 (r184075) +++ stable/7/sys/i386/linux/linux_syscall.h Mon Oct 20 11:17:20 2008 (r184076) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.89 2007/09/18 19:50:33 dwmalone Exp + * created from FreeBSD: stable/7/sys/i386/linux/syscalls.master 184075 2008-10-20 11:15:57Z kib */ #define LINUX_SYS_exit 1 @@ -228,6 +228,7 @@ #define LINUX_SYS_linux_fremovexattr 237 #define LINUX_SYS_linux_tkill 238 #define LINUX_SYS_linux_sys_futex 240 +#define LINUX_SYS_linux_sched_setaffinity 241 #define LINUX_SYS_linux_sched_getaffinity 242 #define LINUX_SYS_linux_set_thread_area 243 #define LINUX_SYS_linux_get_thread_area 244 Modified: stable/7/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/7/sys/i386/linux/linux_sysent.c Mon Oct 20 11:15:57 2008 (r184075) +++ stable/7/sys/i386/linux/linux_sysent.c Mon Oct 20 11:17:20 2008 (r184076) @@ -3,10 +3,9 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.89 2007/09/18 19:50:33 dwmalone Exp + * created from FreeBSD: stable/7/sys/i386/linux/syscalls.master 184075 2008-10-20 11:15:57Z kib */ -#include #include #include #include @@ -260,7 +259,7 @@ struct sysent linux_sysent[] = { { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0 }, /* 238 = linux_tkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = linux_sendfile64 */ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 }, /* 240 = linux_sys_futex */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ + { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ { AS(linux_get_thread_area_args), (sy_call_t *)linux_get_thread_area, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 11:19:48 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 798D31065676; Mon, 20 Oct 2008 11:19:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66C038FC16; Mon, 20 Oct 2008 11:19:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KBJmQV069678; Mon, 20 Oct 2008 11:19:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KBJml3069675; Mon, 20 Oct 2008 11:19:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201119.m9KBJml3069675@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 11:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184077 - stable/7/sys/amd64/linux32 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 11:19:48 -0000 Author: kib Date: Mon Oct 20 11:19:48 2008 New Revision: 184077 URL: http://svn.freebsd.org/changeset/base/184077 Log: Regenerate. Approved by: re (kensmith) Modified: stable/7/sys/amd64/linux32/linux32_proto.h stable/7/sys/amd64/linux32/linux32_syscall.h stable/7/sys/amd64/linux32/linux32_sysent.c Modified: stable/7/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/7/sys/amd64/linux32/linux32_proto.h Mon Oct 20 11:17:20 2008 (r184076) +++ stable/7/sys/amd64/linux32/linux32_proto.h Mon Oct 20 11:19:48 2008 (r184077) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.29 2007/08/28 12:26:34 kib Exp + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 184075 2008-10-20 11:15:57Z kib */ #ifndef _LINUX_SYSPROTO_H_ @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -734,6 +735,11 @@ struct linux_sys_futex_args { char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; }; +struct linux_sched_setaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; struct linux_sched_getaffinity_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; @@ -1105,6 +1111,7 @@ int linux_lremovexattr(struct thread *, int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); +int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); int linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *); int linux_fadvise64(struct thread *, struct linux_fadvise64_args *); @@ -1360,6 +1367,7 @@ int linux_unshare(struct thread *, struc #define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_tkill AUE_NULL #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL +#define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL #define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL #define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL Modified: stable/7/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/7/sys/amd64/linux32/linux32_syscall.h Mon Oct 20 11:17:20 2008 (r184076) +++ stable/7/sys/amd64/linux32/linux32_syscall.h Mon Oct 20 11:19:48 2008 (r184077) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.29 2007/08/28 12:26:34 kib Exp + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 184075 2008-10-20 11:15:57Z kib */ #define LINUX_SYS_exit 1 @@ -222,6 +222,7 @@ #define LINUX_SYS_linux_fremovexattr 237 #define LINUX_SYS_linux_tkill 238 #define LINUX_SYS_linux_sys_futex 240 +#define LINUX_SYS_linux_sched_setaffinity 241 #define LINUX_SYS_linux_sched_getaffinity 242 #define LINUX_SYS_linux_set_thread_area 243 #define LINUX_SYS_linux_fadvise64 250 Modified: stable/7/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysent.c Mon Oct 20 11:17:20 2008 (r184076) +++ stable/7/sys/amd64/linux32/linux32_sysent.c Mon Oct 20 11:19:48 2008 (r184077) @@ -3,10 +3,9 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.29 2007/08/28 12:26:34 kib Exp + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 184075 2008-10-20 11:15:57Z kib */ -#include #include "opt_compat.h" #include #include @@ -261,7 +260,7 @@ struct sysent linux_sysent[] = { { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0 }, /* 238 = linux_tkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = linux_sendfile64 */ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 }, /* 240 = linux_sys_futex */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ + { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 16:33:45 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C291065682; Mon, 20 Oct 2008 16:33:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91C728FC08; Mon, 20 Oct 2008 16:33:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGXjg3075132; Mon, 20 Oct 2008 16:33:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGXjX3075131; Mon, 20 Oct 2008 16:33:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201633.m9KGXjX3075131@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 16:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184078 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:33:45 -0000 Author: kib Date: Mon Oct 20 16:33:45 2008 New Revision: 184078 URL: http://svn.freebsd.org/changeset/base/184078 Log: MFC r183820: Use ufs2_daddr_t for block numbers. Approved by: re (kensmith) Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/pass5.c Modified: stable/7/sbin/fsck_ffs/pass5.c ============================================================================== --- stable/7/sbin/fsck_ffs/pass5.c Mon Oct 20 11:19:48 2008 (r184077) +++ stable/7/sbin/fsck_ffs/pass5.c Mon Oct 20 16:33:45 2008 (r184078) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include "fsck.h" -static void check_maps(u_char *, u_char *, int, int, const char *, int *, int, int); +static void check_maps(u_char *, u_char *, int, ufs2_daddr_t, const char *, int *, int, int); void pass5(void) @@ -321,13 +321,17 @@ pass5(void) } if (excessdirs > 0) check_maps(cg_inosused(newcg), cg_inosused(cg), - inomapsize, cg->cg_cgx * fs->fs_ipg, "DIR", + inomapsize, + cg->cg_cgx * (ufs2_daddr_t) fs->fs_ipg, + "DIR", freedirs, 0, excessdirs); check_maps(cg_inosused(newcg), cg_inosused(cg), - inomapsize, cg->cg_cgx * fs->fs_ipg, "FILE", + inomapsize, + cg->cg_cgx * (ufs2_daddr_t) fs->fs_ipg, "FILE", freefiles, excessdirs, fs->fs_ipg); check_maps(cg_blksfree(cg), cg_blksfree(newcg), - blkmapsize, cg->cg_cgx * fs->fs_fpg, "FRAG", + blkmapsize, + cg->cg_cgx * (ufs2_daddr_t) fs->fs_fpg, "FRAG", freeblks, 0, fs->fs_fpg); } if (cursnapshot == 0 && @@ -407,7 +411,7 @@ check_maps( u_char *map1, /* map of claimed allocations */ u_char *map2, /* map of determined allocations */ int mapsize, /* size of above two maps */ - int startvalue, /* resource value for first element in map */ + ufs2_daddr_t startvalue, /* resource value for first element in map */ const char *name, /* name of resource found in maps */ int *opcode, /* sysctl opcode to free resource */ int skip, /* number of entries to skip before starting to free */ @@ -415,8 +419,8 @@ check_maps( { # define BUFSIZE 16 char buf[BUFSIZE]; - long i, j, k, l, m, n, size; - int astart, aend, ustart, uend; + long i, j, k, l, m, size; + ufs2_daddr_t n, astart, aend, ustart, uend; void (*msg)(const char *fmt, ...); if (bkgrdflag) @@ -443,10 +447,12 @@ check_maps( continue; } if (astart == aend) - (*msg)("ALLOCATED %s %d MARKED FREE\n", + (*msg)("ALLOCATED %s %" PRId64 + " MARKED FREE\n", name, astart); else - (*msg)("%s %sS %d-%d MARKED FREE\n", + (*msg)("%s %sS %" PRId64 "-%" PRId64 + " MARKED FREE\n", "ALLOCATED", name, astart, aend); astart = aend = n; } else { @@ -472,10 +478,12 @@ check_maps( if (size > limit) size = limit; if (debug && size == 1) - pwarn("%s %s %d MARKED USED\n", + pwarn("%s %s %" PRId64 + " MARKED USED\n", "UNALLOCATED", name, ustart); else if (debug) - pwarn("%s %sS %d-%ld MARKED USED\n", + pwarn("%s %sS %" PRId64 "-%" PRId64 + " MARKED USED\n", "UNALLOCATED", name, ustart, ustart + size - 1); if (bkgrdflag != 0) { @@ -497,9 +505,11 @@ check_maps( } if (astart != -1) { if (astart == aend) - (*msg)("ALLOCATED %s %d MARKED FREE\n", name, astart); + (*msg)("ALLOCATED %s %" PRId64 + " MARKED FREE\n", name, astart); else - (*msg)("ALLOCATED %sS %d-%d MARKED FREE\n", + (*msg)("ALLOCATED %sS %" PRId64 "-%" PRId64 + " MARKED FREE\n", name, astart, aend); } if (ustart != -1) { @@ -514,10 +524,12 @@ check_maps( size = limit; if (debug) { if (size == 1) - pwarn("UNALLOCATED %s %d MARKED USED\n", + pwarn("UNALLOCATED %s %" PRId64 + " MARKED USED\n", name, ustart); else - pwarn("UNALLOCATED %sS %d-%ld MARKED USED\n", + pwarn("UNALLOCATED %sS %" PRId64 "-%" PRId64 + " MARKED USED\n", name, ustart, ustart + size - 1); } if (bkgrdflag != 0) { From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 16:36:33 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1158E106567F; Mon, 20 Oct 2008 16:36:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F30348FC1A; Mon, 20 Oct 2008 16:36:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGaWdo075249; Mon, 20 Oct 2008 16:36:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGaW0N075248; Mon, 20 Oct 2008 16:36:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201636.m9KGaW0N075248@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 16:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184079 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:36:33 -0000 Author: kib Date: Mon Oct 20 16:36:32 2008 New Revision: 184079 URL: http://svn.freebsd.org/changeset/base/184079 Log: MFC r183821: Use old summary data for cg when bgfsck is performed. Approved by: re (kensmith) Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/pass5.c Modified: stable/7/sbin/fsck_ffs/pass5.c ============================================================================== --- stable/7/sbin/fsck_ffs/pass5.c Mon Oct 20 16:33:45 2008 (r184078) +++ stable/7/sbin/fsck_ffs/pass5.c Mon Oct 20 16:36:32 2008 (r184079) @@ -291,10 +291,17 @@ pass5(void) sump[run]++; } } - cstotal.cs_nffree += newcg->cg_cs.cs_nffree; - cstotal.cs_nbfree += newcg->cg_cs.cs_nbfree; - cstotal.cs_nifree += newcg->cg_cs.cs_nifree; - cstotal.cs_ndir += newcg->cg_cs.cs_ndir; + if (bkgrdflag != 0) { + cstotal.cs_nffree += cg->cg_cs.cs_nffree; + cstotal.cs_nbfree += cg->cg_cs.cs_nbfree; + cstotal.cs_nifree += cg->cg_cs.cs_nifree; + cstotal.cs_ndir += cg->cg_cs.cs_ndir; + } else { + cstotal.cs_nffree += newcg->cg_cs.cs_nffree; + cstotal.cs_nbfree += newcg->cg_cs.cs_nbfree; + cstotal.cs_nifree += newcg->cg_cs.cs_nifree; + cstotal.cs_ndir += newcg->cg_cs.cs_ndir; + } cs = &fs->fs_cs(fs, c); if (cursnapshot == 0 && memcmp(&newcg->cg_cs, cs, sizeof *cs) != 0 && From owner-svn-src-stable@FreeBSD.ORG Mon Oct 20 16:45:00 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CBE2106569D; Mon, 20 Oct 2008 16:45:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38E898FC1E; Mon, 20 Oct 2008 16:45:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGj0cY075453; Mon, 20 Oct 2008 16:45:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGj0DJ075452; Mon, 20 Oct 2008 16:45:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201645.m9KGj0DJ075452@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 16:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184080 - in stable/7/sys: . ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:45:00 -0000 Author: kib Date: Mon Oct 20 16:44:59 2008 New Revision: 184080 URL: http://svn.freebsd.org/changeset/base/184080 Log: MFC r183822: Sync up summary information for cylinder groups while data is already in memory during snapshot creation. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/ufs/ffs/ffs_snapshot.c Modified: stable/7/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/7/sys/ufs/ffs/ffs_snapshot.c Mon Oct 20 16:36:32 2008 (r184079) +++ stable/7/sys/ufs/ffs/ffs_snapshot.c Mon Oct 20 16:44:59 2008 (r184080) @@ -880,6 +880,13 @@ cgaccount(cg, vp, nbp, passno) } UFS_LOCK(ip->i_ump); ACTIVESET(fs, cg); + /* + * Recomputation of summary information might not have been performed + * at mount time. Sync up summary information for current cylinder + * group while data is in memory to ensure that result of background + * fsck is slightly more consistent. + */ + fs->fs_cs(fs, cg) = cgp->cg_cs; UFS_UNLOCK(ip->i_ump); bcopy(bp->b_data, nbp->b_data, fs->fs_cgsize); if (fs->fs_cgsize < fs->fs_bsize) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 09:30:42 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58D9D106567B; Tue, 21 Oct 2008 09:30:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46CC38FC27; Tue, 21 Oct 2008 09:30:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L9Ugit094409; Tue, 21 Oct 2008 09:30:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L9UgbH094408; Tue, 21 Oct 2008 09:30:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810210930.m9L9UgbH094408@svn.freebsd.org> From: Robert Watson Date: Tue, 21 Oct 2008 09:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184116 - in stable/7/sys: . fs/portalfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 09:30:42 -0000 Author: rwatson Date: Tue Oct 21 09:30:42 2008 New Revision: 184116 URL: http://svn.freebsd.org/changeset/base/184116 Log: Merge r183806 from head to stable/7: The locking in portalfs's socket connect code is no less correct than identical code in connect(2), so remove XXX that it might be incorrect. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/portalfs/portal_vnops.c Modified: stable/7/sys/fs/portalfs/portal_vnops.c ============================================================================== --- stable/7/sys/fs/portalfs/portal_vnops.c Tue Oct 21 08:03:12 2008 (r184115) +++ stable/7/sys/fs/portalfs/portal_vnops.c Tue Oct 21 09:30:42 2008 (r184116) @@ -280,7 +280,6 @@ portal_open(ap) * will happen if the server dies. Sleep for 5 second intervals * and keep polling the reference count. XXX. */ - /* XXXRW: Locking? */ SOCK_LOCK(so); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { if (fmp->pm_server->f_count == 1) { From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 09:45:02 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA6EF1065676; Tue, 21 Oct 2008 09:45:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C908E8FC22; Tue, 21 Oct 2008 09:45:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L9j2aS094715; Tue, 21 Oct 2008 09:45:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L9j2qG094714; Tue, 21 Oct 2008 09:45:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810210945.m9L9j2qG094714@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 21 Oct 2008 09:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184117 - in stable/7/sys: . netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 09:45:03 -0000 Author: bz Date: Tue Oct 21 09:45:02 2008 New Revision: 184117 URL: http://svn.freebsd.org/changeset/base/184117 Log: MFC: r183923 Check that the mbuf len is positive (like we do in the v4 case) to avoid possible panics. PR: kern/119123 Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet6/ip6_output.c Modified: stable/7/sys/netinet6/ip6_output.c ============================================================================== --- stable/7/sys/netinet6/ip6_output.c Tue Oct 21 09:30:42 2008 (r184116) +++ stable/7/sys/netinet6/ip6_output.c Tue Oct 21 09:45:02 2008 (r184117) @@ -2814,7 +2814,7 @@ ip6_setpktopts(struct mbuf *control, str if (control->m_next) return (EINVAL); - for (; control->m_len; control->m_data += CMSG_ALIGN(cm->cmsg_len), + for (; control->m_len > 0; control->m_data += CMSG_ALIGN(cm->cmsg_len), control->m_len -= CMSG_ALIGN(cm->cmsg_len)) { int error; From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 09:56:24 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2158E1065680; Tue, 21 Oct 2008 09:56:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EB678FC20; Tue, 21 Oct 2008 09:56:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L9uNWK094991; Tue, 21 Oct 2008 09:56:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L9uNBi094990; Tue, 21 Oct 2008 09:56:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810210956.m9L9uNBi094990@svn.freebsd.org> From: Robert Watson Date: Tue, 21 Oct 2008 09:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184119 - in stable/7/sys: . netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 09:56:24 -0000 Author: rwatson Date: Tue Oct 21 09:56:23 2008 New Revision: 184119 URL: http://svn.freebsd.org/changeset/base/184119 Log: Merge r183807 from head to stable/7: When disconnecting a UDPv6 socket, acquire the socket lock around the changing of the so_state field, as is done in UDPv4. Remove XXX locking comment. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet6/udp6_usrreq.c Modified: stable/7/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/7/sys/netinet6/udp6_usrreq.c Tue Oct 21 09:55:49 2008 (r184118) +++ stable/7/sys/netinet6/udp6_usrreq.c Tue Oct 21 09:56:23 2008 (r184119) @@ -918,8 +918,9 @@ udp6_disconnect(struct socket *so) in6_pcbdisconnect(inp); inp->in6p_laddr = in6addr_any; - /* XXXRW: so_state locking? */ + SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ + SOCK_UNLOCK(so); out: INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&udbinfo); From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 10:17:52 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582DC1065670; Tue, 21 Oct 2008 10:17:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4429F8FC1F; Tue, 21 Oct 2008 10:17:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LAHqcd095480; Tue, 21 Oct 2008 10:17:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LAHqGK095479; Tue, 21 Oct 2008 10:17:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810211017.m9LAHqGK095479@svn.freebsd.org> From: Robert Watson Date: Tue, 21 Oct 2008 10:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184120 - in stable/7/sys: . kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 10:17:52 -0000 Author: rwatson Date: Tue Oct 21 10:17:51 2008 New Revision: 184120 URL: http://svn.freebsd.org/changeset/base/184120 Log: Merge r183803 from head to stable/7: Downgrade XXX to a Note for fgetsock() and fputsock(). Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_descrip.c Modified: stable/7/sys/kern/kern_descrip.c ============================================================================== --- stable/7/sys/kern/kern_descrip.c Tue Oct 21 09:56:23 2008 (r184119) +++ stable/7/sys/kern/kern_descrip.c Tue Oct 21 10:17:51 2008 (r184120) @@ -2163,7 +2163,7 @@ fgetvp_write(struct thread *td, int fd, * We bump the ref count on the returned socket. XXX Also obtain the SX lock * in the future. * - * XXXRW: fgetsock() and fputsock() are deprecated, as consumers should rely + * Note: fgetsock() and fputsock() are deprecated, as consumers should rely * on their file descriptor reference to prevent the socket from being free'd * during use. */ @@ -2196,7 +2196,7 @@ fgetsock(struct thread *td, int fd, stru * Drop the reference count on the socket and XXX release the SX lock in the * future. The last reference closes the socket. * - * XXXRW: fputsock() is deprecated, see comment for fgetsock(). + * Note: fputsock() is deprecated, see comment for fgetsock(). */ void fputsock(struct socket *so) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 12:19:09 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 094BF1065670; Tue, 21 Oct 2008 12:19:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECA948FC1F; Tue, 21 Oct 2008 12:19:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LCJ89m098873; Tue, 21 Oct 2008 12:19:08 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LCJ8Ad098872; Tue, 21 Oct 2008 12:19:08 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810211219.m9LCJ8Ad098872@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 21 Oct 2008 12:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184124 - in stable/7/sys: . dev/puc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 12:19:09 -0000 Author: des Date: Tue Oct 21 12:19:08 2008 New Revision: 184124 URL: http://svn.freebsd.org/changeset/base/184124 Log: MFH (r183817): revert OX16PCI954 breakage Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/dev/puc/pucdata.c Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Tue Oct 21 12:10:30 2008 (r184123) +++ stable/7/sys/dev/puc/pucdata.c Tue Oct 21 12:19:08 2008 (r184124) @@ -603,14 +603,14 @@ const struct puc_cfg puc_pci_devices[] = }, { 0x1415, 0x9501, 0xffff, 0, - "Oxford Semiconductor OX16PCI954 UARTs 4-port type 1", - DEFAULT_RCLK * 10, + "Oxford Semiconductor OX16PCI954 UARTs", + DEFAULT_RCLK, PUC_PORT_4S, 0x10, 0, 8, }, { 0x1415, 0x950a, 0xffff, 0, - "Oxford Semiconductor OX16PCI954 UARTs 4-port type 2", - DEFAULT_RCLK * 10, + "Oxford Semiconductor OX16PCI954 UARTs", + DEFAULT_RCLK, PUC_PORT_4S, 0x10, 0, 8, }, From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 14:11:00 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA11106567D; Tue, 21 Oct 2008 14:11:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B88428FC1E; Tue, 21 Oct 2008 14:11:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LEB0mv000999; Tue, 21 Oct 2008 14:11:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LEB08O000998; Tue, 21 Oct 2008 14:11:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810211411.m9LEB08O000998@svn.freebsd.org> From: Robert Watson Date: Tue, 21 Oct 2008 14:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184126 - in stable/7/sys: . nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 14:11:01 -0000 Author: rwatson Date: Tue Oct 21 14:11:00 2008 New Revision: 184126 URL: http://svn.freebsd.org/changeset/base/184126 Log: Merge r183809 from head to stable/7: Turn XXX's for unlocked writes of NFS server statistics to simple notes, as we consider it a feature to exchange performance for consistency. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/nfsserver/nfs_serv.c Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Tue Oct 21 12:50:45 2008 (r184125) +++ stable/7/sys/nfsserver/nfs_serv.c Tue Oct 21 14:11:00 2008 (r184126) @@ -1177,7 +1177,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, uiop->uio_td = NULL; uiop->uio_offset = off; error = VOP_WRITE(vp, uiop, ioflags, cred); - /* XXXRW: unlocked write. */ + /* Unlocked write. */ nfsrvstats.srvvop_writes++; FREE((caddr_t)iv, M_TEMP); } @@ -1492,7 +1492,7 @@ loop1: } if (!error) { error = VOP_WRITE(vp, uiop, ioflags, cred); - /* XXXRW: unlocked write. */ + /* Unlocked write. */ nfsrvstats.srvvop_writes++; vn_finished_write(mntp); } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 18:35:04 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDF331065682; Tue, 21 Oct 2008 18:35:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB82D8FC1A; Tue, 21 Oct 2008 18:35:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIZ4hF005678; Tue, 21 Oct 2008 18:35:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIZ44K005677; Tue, 21 Oct 2008 18:35:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810211835.m9LIZ44K005677@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Oct 2008 18:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184131 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:35:04 -0000 Author: jhb Date: Tue Oct 21 18:35:04 2008 New Revision: 184131 URL: http://svn.freebsd.org/changeset/base/184131 Log: MFC: Use 32k transfers rather than 63k transfers for chipsets that can't do 64k transfers and use the MIO method to talk to the Serverworks HT1000_S1 SATA controller. Approved by: re (kib) Modified: stable/7/sys/dev/ata/ata-chipset.c Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Tue Oct 21 18:30:10 2008 (r184130) +++ stable/7/sys/dev/ata/ata-chipset.c Tue Oct 21 18:35:04 2008 (r184131) @@ -1500,7 +1500,7 @@ ata_cyrix_setmode(device_t dev, int mode int error; ch->dma->alignment = 16; - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; mode = ata_limit_mode(dev, mode, ATA_UDMA2); @@ -2892,7 +2892,7 @@ ata_marvell_edma_dmainit(device_t dev) ch->dma->max_address = BUS_SPACE_MAXADDR; /* chip does not reliably do 64K DMA transfers */ - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; } } @@ -2942,7 +2942,7 @@ ata_national_setmode(device_t dev, int m int error; ch->dma->alignment = 16; - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; mode = ata_limit_mode(dev, mode, ATA_UDMA2); @@ -4192,7 +4192,7 @@ ata_serverworks_ident(device_t dev) { ATA_CSB6, 0x00, SWKS100, 0, ATA_UDMA5, "CSB6" }, { ATA_CSB6_1, 0x00, SWKS66, 0, ATA_UDMA4, "CSB6" }, { ATA_HT1000, 0x00, SWKS100, 0, ATA_UDMA5, "HT1000" }, - { ATA_HT1000_S1, 0x00, SWKS100, 4, ATA_SA150, "HT1000" }, + { ATA_HT1000_S1, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, { ATA_HT1000_S2, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, { ATA_K2, 0x00, SWKSMIO, 4, ATA_SA150, "K2" }, { ATA_FRODO4, 0x00, SWKSMIO, 4, ATA_SA150, "Frodo4" }, @@ -4295,7 +4295,7 @@ ata_serverworks_allocate(device_t dev) /* chip does not reliably do 64K DMA transfers */ if (ch->dma) - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; return 0; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 18:35:24 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0CB1065670; Tue, 21 Oct 2008 18:35:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3108FC1F; Tue, 21 Oct 2008 18:35:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIZOYY005719; Tue, 21 Oct 2008 18:35:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIZOR4005718; Tue, 21 Oct 2008 18:35:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810211835.m9LIZOR4005718@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Oct 2008 18:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184132 - stable/6/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:35:24 -0000 Author: jhb Date: Tue Oct 21 18:35:23 2008 New Revision: 184132 URL: http://svn.freebsd.org/changeset/base/184132 Log: MFC: Use 32k transfers rather than 63k transfers for chipsets that can't do 64k transfers and use the MIO method to talk to the Serverworks HT1000_S1 SATA controller. Approved by: re (kib) Modified: stable/6/sys/dev/ata/ata-chipset.c Modified: stable/6/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/6/sys/dev/ata/ata-chipset.c Tue Oct 21 18:35:04 2008 (r184131) +++ stable/6/sys/dev/ata/ata-chipset.c Tue Oct 21 18:35:23 2008 (r184132) @@ -1500,7 +1500,7 @@ ata_cyrix_setmode(device_t dev, int mode int error; ch->dma->alignment = 16; - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; mode = ata_limit_mode(dev, mode, ATA_UDMA2); @@ -2892,7 +2892,7 @@ ata_marvell_edma_dmainit(device_t dev) ch->dma->max_address = BUS_SPACE_MAXADDR; /* chip does not reliably do 64K DMA transfers */ - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; } } @@ -2942,7 +2942,7 @@ ata_national_setmode(device_t dev, int m int error; ch->dma->alignment = 16; - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; mode = ata_limit_mode(dev, mode, ATA_UDMA2); @@ -4192,7 +4192,7 @@ ata_serverworks_ident(device_t dev) { ATA_CSB6, 0x00, SWKS100, 0, ATA_UDMA5, "CSB6" }, { ATA_CSB6_1, 0x00, SWKS66, 0, ATA_UDMA4, "CSB6" }, { ATA_HT1000, 0x00, SWKS100, 0, ATA_UDMA5, "HT1000" }, - { ATA_HT1000_S1, 0x00, SWKS100, 4, ATA_SA150, "HT1000" }, + { ATA_HT1000_S1, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, { ATA_HT1000_S2, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, { ATA_K2, 0x00, SWKSMIO, 4, ATA_SA150, "K2" }, { ATA_FRODO4, 0x00, SWKSMIO, 4, ATA_SA150, "Frodo4" }, @@ -4295,7 +4295,7 @@ ata_serverworks_allocate(device_t dev) /* chip does not reliably do 64K DMA transfers */ if (ch->dma) - ch->dma->max_iosize = 126 * DEV_BSIZE; + ch->dma->max_iosize = 64 * DEV_BSIZE; return 0; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 18:50:52 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2ED106567B; Tue, 21 Oct 2008 18:50:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97288FC20; Tue, 21 Oct 2008 18:50:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIoqS5006089; Tue, 21 Oct 2008 18:50:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIoqBS006088; Tue, 21 Oct 2008 18:50:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810211850.m9LIoqBS006088@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 Oct 2008 18:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184134 - in stable/7/sys: . amd64/linux32 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:50:52 -0000 Author: kib Date: Tue Oct 21 18:50:52 2008 New Revision: 184134 URL: http://svn.freebsd.org/changeset/base/184134 Log: MFC r184026: Set PCB_32BIT and clear PCB_GS32BIT for linux32 binaries. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/linux32_sysvec.c Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysvec.c Tue Oct 21 18:40:29 2008 (r184133) +++ stable/7/sys/amd64/linux32/linux32_sysvec.c Tue Oct 21 18:50:52 2008 (r184134) @@ -843,7 +843,8 @@ exec_linux_setregs(td, entry, stack, ps_ fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX; + pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags &= ~PCB_GS32BIT; td->td_retval[1] = 0; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 21 19:42:57 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5224E106566C; Tue, 21 Oct 2008 19:42:57 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDE78FC1E; Tue, 21 Oct 2008 19:42:57 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LJgvep007063; Tue, 21 Oct 2008 19:42:57 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LJgv1E007062; Tue, 21 Oct 2008 19:42:57 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810211942.m9LJgv1E007062@svn.freebsd.org> From: Ken Smith Date: Tue, 21 Oct 2008 19:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184137 - in stable/7/release: . scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 19:42:57 -0000 Author: kensmith Date: Tue Oct 21 19:42:56 2008 New Revision: 184137 URL: http://svn.freebsd.org/changeset/base/184137 Log: MFC r183771 and r183860: r183771: Add a build knob MAKE_DVD to control on a per-architecture basis whether or not to build a tree used for the creation of a DVD image. If that is enabled set up a DVD tree by installing everything we normally install to the individual CDROM trees into the one DVD tree. The result is one image with all the install bits, livefs bits, and doc bits suitable for burning to a DVD instead of CDROM. Enable building the DVD for amd64 and i386. r183860: The thought of making more than one DVD image for a release really freaks me out. But it turns out we might be able to generalize a few of the other things RE uses to assemble the package trees for releases if the DVDs use a naming theme close to what is used for the CDROMS (disc1, disc2, etc). So change the name to dvd1. Hopefully this way src/release/scripts/{package-split.py,package-trees.sh} can be generalized instead of copied-and-hacked. Approved by: re (kib) Modified: stable/7/release/ (props changed) stable/7/release/Makefile stable/7/release/scripts/src-install.sh (props changed) Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Tue Oct 21 18:52:38 2008 (r184136) +++ stable/7/release/Makefile Tue Oct 21 19:42:56 2008 (r184137) @@ -192,6 +192,7 @@ MNT= /mnt .undef MAKE_FLOPPIES .if ${TARGET_ARCH} == "i386" MAKE_FLOPPIES= true +MAKE_DVD= SEPARATE_LIVEFS= SPLIT_MFSROOT= .if ${TARGET} == "pc98" @@ -221,6 +222,7 @@ MFSLABEL= auto SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "amd64" MAKE_FLOPPIES= true +MAKE_DVD= FLOPPYSIZE= 1440 FLOPPYSPLITSIZE= 1392 FLOPPYINODE= 40000 @@ -261,6 +263,9 @@ CD_BOOT= ${CD}/bootonly CD_DISC1= ${CD}/disc1 CD_DISC2= ${CD}/disc2 CD_DISC3= ${CD}/disc3 +.if defined(MAKE_DVD) +CD_DVD1= ${CD}/dvd1 +.endif .if !defined(NODOC) CD_DOCS= ${CD}/docs .endif @@ -479,6 +484,7 @@ release rerelease: KERNELS \ KERNELS_BASE \ KERNEL_FLAGS \ + MAKE_DVD \ MAKE_FLOPPIES \ MAKE_ISOS \ NOCDROM \ @@ -924,6 +930,18 @@ cdrom.1: find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \ fi \ done +.if defined(MAKE_DVD) + @echo "Building DVD filesystem image as well as CDROM" + @mkdir -p ${CD_DVD1}/${BUILDNAME} + @for i in ${DISTRIBUTIONS} ; \ + do \ + if [ -d ${RD}/trees/$${i} ] ; then \ + chflags -R noschg ${RD}/trees/$${i} || true ; \ + ( cd ${RD}/trees/$${i} && \ + find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \ + fi \ + done +.endif @echo "Copy GENERIC kernel to boot area" @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel @rm -f ${CD_LIVEFS}/boot/kernel/*.symbols @@ -941,7 +959,24 @@ cdrom.1: @rm -f ${CD_LIVEFS}/boot/device.hints @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints .endif +.if defined(MAKE_DVD) + @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel + @rm -f ${CD_DVD1}/boot/kernel/*.symbols + @rm -f ${CD_DVD1}/.profile + @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile + @ln -sf /rescue ${CD_DVD1}/stand @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf + @rm -f ${CD_DVD1}/boot/loader.conf + @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz + @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf + @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf + @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf +.if exists(${RD}/trees/base/boot/device.hints) + @rm -f ${CD_DVD1}/boot/device.hints + @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints +.endif +.endif touch ${.TARGET} # Build disc1, disc2 and disc3 cdrom images @@ -980,11 +1015,37 @@ cdrom.2: @mkdir -p ${CD_DISC3} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC3}/cdrom.inf @echo "CD_VOLUME = 3" >> ${CD_DISC3}/cdrom.inf +.if defined(MAKE_DVD) +.if defined(MAKE_FLOPPIES) + @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1} +.endif + @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME} +.if !defined(NODOC) + @for i in ${DIST_DOCS_ARCH_INDEP}; do \ + cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ + cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ + done + @for i in ${DIST_DOCS_ARCH_DEP}; do \ + cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ + cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ + done + @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1} +.endif + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf + @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf +.endif .if !defined(NODOC) echo "Building CDROM docs filesystem image" @mkdir -p ${CD_DOCS} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf @mkdir -p ${CD_DOCS}/usr/share/doc +.if defined(MAKE_DVD) + @mkdir -p ${CD_DVD1}/usr/share/doc +.endif @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \ if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \ -d /usr/doc/$$i ]; then \ @@ -992,6 +1053,10 @@ cdrom.2: ${CD_DOCS}/usr/share/doc; \ fi \ done +.if defined(MAKE_DVD) + @cd ${CD_DOCS}/usr/share/doc && find . -print | \ + cpio -dumpl ${CD_DVD1}/usr/share/doc +.endif .endif touch ${.TARGET} @@ -1025,6 +1090,9 @@ CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 .if exists(${CD_PACKAGE_TREE}/disc3) CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3 .endif +.if exists(${CD_PACKAGE_TREE}/dvd1) +CD_DVD_PKGS= ${CD_PACKAGE_TREE}/dvd1 +.endif .endif .endif @@ -1048,6 +1116,12 @@ iso.1: FreeBSD_Packages_2 \ ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ ${CD_DISC3_PKGS} +.if defined(MAKE_DVD) + @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + FreeBSD_Install \ + ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ + ${CD_DVD1_PKGS} +.endif .if !defined(NODOC) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Documentation \ From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 08:52:46 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E631065675; Wed, 22 Oct 2008 08:52:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267238FC2F; Wed, 22 Oct 2008 08:52:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M8qkpB023650; Wed, 22 Oct 2008 08:52:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M8qkn8023649; Wed, 22 Oct 2008 08:52:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810220852.m9M8qkn8023649@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 22 Oct 2008 08:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184155 - in stable/7/sys: . security/mac_partition X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 08:52:46 -0000 Author: bz Date: Wed Oct 22 08:52:45 2008 New Revision: 184155 URL: http://svn.freebsd.org/changeset/base/184155 Log: MFC: r183970 Use the label from the socket credential rather than the solabel which was not set by the mac_partition policy. Approved by: re (rwatson) Modified: stable/7/sys/ (props changed) stable/7/sys/security/mac_partition/mac_partition.c Modified: stable/7/sys/security/mac_partition/mac_partition.c ============================================================================== --- stable/7/sys/security/mac_partition/mac_partition.c Wed Oct 22 08:43:35 2008 (r184154) +++ stable/7/sys/security/mac_partition/mac_partition.c Wed Oct 22 08:52:45 2008 (r184155) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -221,7 +222,7 @@ partition_check_socket_visible(struct uc { int error; - error = label_on_label(cred->cr_label, solabel); + error = label_on_label(cred->cr_label, so->so_cred->cr_label); return (error ? ENOENT : 0); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 09:28:57 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3E0E1065674; Wed, 22 Oct 2008 09:28:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15828FC17; Wed, 22 Oct 2008 09:28:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M9SvdG024453; Wed, 22 Oct 2008 09:28:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M9SvPO024452; Wed, 22 Oct 2008 09:28:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810220928.m9M9SvPO024452@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 22 Oct 2008 09:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184158 - in stable/6/sys: . security/mac_partition X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 09:28:57 -0000 Author: bz Date: Wed Oct 22 09:28:57 2008 New Revision: 184158 URL: http://svn.freebsd.org/changeset/base/184158 Log: MFC: r183970 Use the label from the socket credential rather than the solabel which was not set by the mac_partition policy. Approved by: re (rwatson) Modified: stable/6/sys/ (props changed) stable/6/sys/security/mac_partition/mac_partition.c Modified: stable/6/sys/security/mac_partition/mac_partition.c ============================================================================== --- stable/6/sys/security/mac_partition/mac_partition.c Wed Oct 22 09:11:35 2008 (r184157) +++ stable/6/sys/security/mac_partition/mac_partition.c Wed Oct 22 09:28:57 2008 (r184158) @@ -244,7 +244,7 @@ mac_partition_check_socket_visible(struc { int error; - error = label_on_label(cred->cr_label, socketlabel); + error = label_on_label(cred->cr_label, socket->so_cred->cr_label); return (error ? ENOENT : 0); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 14:56:15 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 697271065670; Wed, 22 Oct 2008 14:56:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56BE38FC12; Wed, 22 Oct 2008 14:56:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MEuFHe031433; Wed, 22 Oct 2008 14:56:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MEuFpP031432; Wed, 22 Oct 2008 14:56:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810221456.m9MEuFpP031432@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 22 Oct 2008 14:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184162 - in stable/6/sys: . netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 14:56:15 -0000 Author: bz Date: Wed Oct 22 14:56:15 2008 New Revision: 184162 URL: http://svn.freebsd.org/changeset/base/184162 Log: MFC: r183923 Check that the mbuf len is positive (like we do in the v4 case) to avoid possible panics. PR: kern/119123 Approved by: re (kib) Modified: stable/6/sys/ (props changed) stable/6/sys/netinet6/ip6_output.c Modified: stable/6/sys/netinet6/ip6_output.c ============================================================================== --- stable/6/sys/netinet6/ip6_output.c Wed Oct 22 14:45:30 2008 (r184161) +++ stable/6/sys/netinet6/ip6_output.c Wed Oct 22 14:56:15 2008 (r184162) @@ -2979,7 +2979,7 @@ ip6_setpktopts(control, opt, stickyopt, if (control->m_next) return (EINVAL); - for (; control->m_len; control->m_data += CMSG_ALIGN(cm->cmsg_len), + for (; control->m_len > 0; control->m_data += CMSG_ALIGN(cm->cmsg_len), control->m_len -= CMSG_ALIGN(cm->cmsg_len)) { int error; From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 15:28:00 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A25106566B; Wed, 22 Oct 2008 15:28:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 368AA8FC0A; Wed, 22 Oct 2008 15:28:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MFS0wV032143; Wed, 22 Oct 2008 15:28:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MFS04p032142; Wed, 22 Oct 2008 15:28:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810221528.m9MFS04p032142@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Oct 2008 15:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184165 - in stable/6/sys: . kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:28:00 -0000 Author: jhb Date: Wed Oct 22 15:27:59 2008 New Revision: 184165 URL: http://svn.freebsd.org/changeset/base/184165 Log: MFC: Close a race in the kern.ttys sysctl handler that resulted in panics in dev2udev() when a tty was being detached concurrently with the sysctl handler. One difference relative to 7.x+ is that we still leak tty objects in tty_free() since destroy_dev() in 6.x doesn't purge all threads. Approved by: re (kib) Modified: stable/6/sys/ (props changed) stable/6/sys/kern/tty.c Modified: stable/6/sys/kern/tty.c ============================================================================== --- stable/6/sys/kern/tty.c Wed Oct 22 15:00:22 2008 (r184164) +++ stable/6/sys/kern/tty.c Wed Oct 22 15:27:59 2008 (r184165) @@ -3024,16 +3024,19 @@ ttygone(struct tty *tp) * * XXX: This shall sleep until all threads have left the driver. */ - void ttyfree(struct tty *tp) { + struct cdev *dev; u_int unit; mtx_assert(&Giant, MA_OWNED); ttygone(tp); unit = tp->t_devunit; - destroy_dev(tp->t_mdev); + dev = tp->t_mdev; + dev->si_tty = NULL; + tp->t_dev = NULL; + destroy_dev(dev); free_unr(tty_unit, unit); } @@ -3049,8 +3052,9 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) tp = TAILQ_FIRST(&tty_list); if (tp != NULL) ttyref(tp); - mtx_unlock(&tty_list_mutex); while (tp != NULL) { + if (tp->t_state & TS_GONE) + goto nexttp; bzero(&xt, sizeof xt); xt.xt_size = sizeof xt; #define XT_COPY(field) xt.xt_##field = tp->t_##field @@ -3058,6 +3062,18 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) xt.xt_cancc = tp->t_canq.c_cc; xt.xt_outcc = tp->t_outq.c_cc; XT_COPY(line); + + /* + * XXX: We hold the tty list lock while doing this to + * work around a race with pty/pts tty destruction. + * They set t_dev to NULL and then call ttyrel() to + * free the structure which will block on the list + * lock before they call destroy_dev() on the cdev + * backing t_dev. + * + * XXX: ttyfree() now does the same since it has been + * fixed to not leak ttys. + */ if (tp->t_dev != NULL) xt.xt_dev = dev2udev(tp->t_dev); XT_COPY(state); @@ -3080,19 +3096,22 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) XT_COPY(olowat); XT_COPY(ospeedwat); #undef XT_COPY + mtx_unlock(&tty_list_mutex); error = SYSCTL_OUT(req, &xt, sizeof xt); if (error != 0) { ttyrel(tp); return (error); } mtx_lock(&tty_list_mutex); - tp2 = TAILQ_NEXT(tp, t_list); +nexttp: tp2 = TAILQ_NEXT(tp, t_list); if (tp2 != NULL) ttyref(tp2); mtx_unlock(&tty_list_mutex); ttyrel(tp); tp = tp2; + mtx_lock(&tty_list_mutex); } + mtx_unlock(&tty_list_mutex); return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 15:39:28 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C876C106569F; Wed, 22 Oct 2008 15:39:28 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4CF78FC0A; Wed, 22 Oct 2008 15:39:28 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MFdSPi032415; Wed, 22 Oct 2008 15:39:28 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MFdS7i032414; Wed, 22 Oct 2008 15:39:28 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810221539.m9MFdS7i032414@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Oct 2008 15:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184166 - in stable/7/release: . scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:39:29 -0000 Author: kensmith Date: Wed Oct 22 15:39:28 2008 New Revision: 184166 URL: http://svn.freebsd.org/changeset/base/184166 Log: MFC r184144 and r184145. Replace an @ that went missing and move an echo that accidentally got wrapped in the MAKE_DVD knob. Approved by: re (kib) Modified: stable/7/release/ (props changed) stable/7/release/Makefile stable/7/release/scripts/src-install.sh (props changed) Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Wed Oct 22 15:27:59 2008 (r184165) +++ stable/7/release/Makefile Wed Oct 22 15:39:28 2008 (r184166) @@ -959,13 +959,13 @@ cdrom.1: @rm -f ${CD_LIVEFS}/boot/device.hints @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints .endif + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf .if defined(MAKE_DVD) @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel @rm -f ${CD_DVD1}/boot/kernel/*.symbols @rm -f ${CD_DVD1}/.profile @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile @ln -sf /rescue ${CD_DVD1}/stand - @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf @rm -f ${CD_DVD1}/boot/loader.conf @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz @@ -1039,7 +1039,7 @@ cdrom.2: @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf .endif .if !defined(NODOC) - echo "Building CDROM docs filesystem image" + @echo "Building CDROM docs filesystem image" @mkdir -p ${CD_DOCS} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf @mkdir -p ${CD_DOCS}/usr/share/doc From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 18:07:38 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74E031065699; Wed, 22 Oct 2008 18:07:38 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6120B8FC13; Wed, 22 Oct 2008 18:07:38 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MI7cNl035262; Wed, 22 Oct 2008 18:07:38 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MI7b8X035259; Wed, 22 Oct 2008 18:07:37 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200810221807.m9MI7b8X035259@svn.freebsd.org> From: Alfred Perlstein Date: Wed, 22 Oct 2008 18:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184172 - in stable/6: lib/libthr/thread sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:07:38 -0000 Author: alfred Date: Wed Oct 22 18:07:37 2008 New Revision: 184172 URL: http://svn.freebsd.org/changeset/base/184172 Log: Close races in the pthread_condvar implementation in 6.x, note that 7.x and beyond have very different implementations and these fixes do not apply. In the kernel: Move the flag UQF_UMTXQ from the thread's td_flags where it was unlocked to the umtx_q struct where it now has locking. Nuke the UMTX_DYNAMIC_SHARED define while here, it's unused and complex. Refactor do_wait so that if we get a signal or timeout AND woken up, we forward the wakeup to any other waiters pending to avoid a missed wakeup. In userland: Bring over some fixes from DragonFlyBSD for the userland part of pthread_condvars, basically relax the consistency on the number of waiters and signals pending because it was both too strict and incorrect causing lost wakeups. Reviewed by: davidxu Approved by: re Modified: stable/6/lib/libthr/thread/thr_cond.c stable/6/lib/libthr/thread/thr_private.h stable/6/sys/kern/kern_umtx.c Modified: stable/6/lib/libthr/thread/thr_cond.c ============================================================================== --- stable/6/lib/libthr/thread/thr_cond.c Wed Oct 22 17:50:45 2008 (r184171) +++ stable/6/lib/libthr/thread/thr_cond.c Wed Oct 22 18:07:37 2008 (r184172) @@ -71,7 +71,7 @@ cond_init(pthread_cond_t *cond, const pt _thr_umtx_init(&pcond->c_lock); pcond->c_seqno = 0; pcond->c_waiters = 0; - pcond->c_wakeups = 0; + pcond->c_broadcast = 0; if (cond_attr == NULL || *cond_attr == NULL) { pcond->c_pshared = 0; pcond->c_clockid = CLOCK_REALTIME; @@ -122,7 +122,7 @@ _pthread_cond_destroy(pthread_cond_t *co else { /* Lock the condition variable structure: */ THR_LOCK_ACQUIRE(curthread, &(*cond)->c_lock); - if ((*cond)->c_waiters + (*cond)->c_wakeups != 0) { + if ((*cond)->c_waiters != 0) { THR_LOCK_RELEASE(curthread, &(*cond)->c_lock); return (EBUSY); } @@ -166,14 +166,13 @@ cond_cancel_handler(void *arg) cv = *(cci->cond); THR_LOCK_ACQUIRE(curthread, &cv->c_lock); - if (cv->c_seqno != cci->seqno && cv->c_wakeups != 0) { - if (cv->c_waiters > 0) { - cv->c_seqno++; - _thr_umtx_wake(&cv->c_seqno, 1); - } else - cv->c_wakeups--; - } else { - cv->c_waiters--; + if (--cv->c_waiters == 0) + cv->c_broadcast = 0; + if (cv->c_seqno != cci->seqno) { + _thr_umtx_wake(&cv->c_seqno, 1); + /* cv->c_seqno++; XXX why was this here? */ + _thr_umtx_wake(&cv->c_seqno, 1); + } THR_LOCK_RELEASE(curthread, &cv->c_lock); @@ -191,6 +190,7 @@ cond_wait_common(pthread_cond_t *cond, p long seq, oldseq; int oldcancel; int ret = 0; + int loops = -1; /* * If the condition variable is statically initialized, @@ -202,18 +202,24 @@ cond_wait_common(pthread_cond_t *cond, p cv = *cond; THR_LOCK_ACQUIRE(curthread, &cv->c_lock); + oldseq = cv->c_seqno; ret = _mutex_cv_unlock(mutex); if (ret) { THR_LOCK_RELEASE(curthread, &cv->c_lock); return (ret); } - oldseq = seq = cv->c_seqno; + seq = cv->c_seqno; cci.mutex = mutex; cci.cond = cond; cci.seqno = oldseq; cv->c_waiters++; - do { + /* + * loop if we have never been told to wake up + * or we lost a race. + */ + while (seq == oldseq /* || cv->c_wakeups == 0*/) { + loops++; THR_LOCK_RELEASE(curthread, &cv->c_lock); if (abstime != NULL) { @@ -232,24 +238,23 @@ cond_wait_common(pthread_cond_t *cond, p } else { ret = _thr_umtx_wait(&cv->c_seqno, seq, tsp); } + /* + * If we get back EINTR we want to loop as condvars + * do NOT return EINTR, they just restart. + */ THR_LOCK_ACQUIRE(curthread, &cv->c_lock); seq = cv->c_seqno; if (abstime != NULL && ret == ETIMEDOUT) break; - /* - * loop if we have never been told to wake up - * or we lost a race. - */ - } while (seq == oldseq || cv->c_wakeups == 0); - - if (seq != oldseq && cv->c_wakeups != 0) { - cv->c_wakeups--; - ret = 0; - } else { - cv->c_waiters--; } + + if (--cv->c_waiters == 0) + cv->c_broadcast = 0; + if (seq != oldseq) + ret = 0; + THR_LOCK_RELEASE(curthread, &cv->c_lock); _mutex_cv_lock(mutex); return (ret); @@ -298,7 +303,7 @@ cond_signal_common(pthread_cond_t *cond, { struct pthread *curthread = _get_curthread(); pthread_cond_t cv; - int ret = 0, oldwaiters; + int ret = 0; /* * If the condition variable is statically initialized, perform dynamic @@ -311,19 +316,15 @@ cond_signal_common(pthread_cond_t *cond, cv = *cond; /* Lock the condition variable structure. */ THR_LOCK_ACQUIRE(curthread, &cv->c_lock); + cv->c_seqno++; + if (cv->c_broadcast == 0) + cv->c_broadcast = broadcast; + if (cv->c_waiters) { - if (!broadcast) { - cv->c_wakeups++; - cv->c_waiters--; - cv->c_seqno++; + if (cv->c_broadcast) + _thr_umtx_wake(&cv->c_seqno, INT_MAX); + else _thr_umtx_wake(&cv->c_seqno, 1); - } else { - oldwaiters = cv->c_waiters; - cv->c_wakeups += cv->c_waiters; - cv->c_waiters = 0; - cv->c_seqno++; - _thr_umtx_wake(&cv->c_seqno, oldwaiters); - } } THR_LOCK_RELEASE(curthread, &cv->c_lock); return (ret); Modified: stable/6/lib/libthr/thread/thr_private.h ============================================================================== --- stable/6/lib/libthr/thread/thr_private.h Wed Oct 22 17:50:45 2008 (r184171) +++ stable/6/lib/libthr/thread/thr_private.h Wed Oct 22 18:07:37 2008 (r184172) @@ -166,7 +166,7 @@ struct pthread_cond { volatile umtx_t c_lock; volatile umtx_t c_seqno; volatile int c_waiters; - volatile int c_wakeups; + volatile int c_broadcast; int c_pshared; int c_clockid; }; Modified: stable/6/sys/kern/kern_umtx.c ============================================================================== --- stable/6/sys/kern/kern_umtx.c Wed Oct 22 17:50:45 2008 (r184171) +++ stable/6/sys/kern/kern_umtx.c Wed Oct 22 18:07:37 2008 (r184172) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,6 +82,8 @@ struct umtx_key { struct umtx_q { LIST_ENTRY(umtx_q) uq_next; /* Linked list for the hash. */ struct umtx_key uq_key; /* Umtx key. */ + int uq_flags; +#define UQF_UMTXQ 0x0001 struct thread *uq_thread; /* The thread waits on. */ LIST_ENTRY(umtx_q) uq_rqnext; /* Linked list for requeuing. */ vm_offset_t uq_addr; /* Umtx's virtual address. */ @@ -229,9 +232,7 @@ umtxq_insert(struct umtx_q *uq) mtx_assert(umtxq_mtx(chain), MA_OWNED); head = &umtxq_chains[chain].uc_queue; LIST_INSERT_HEAD(head, uq, uq_next); - mtx_lock_spin(&sched_lock); - uq->uq_thread->td_flags |= TDF_UMTXQ; - mtx_unlock_spin(&sched_lock); + uq->uq_flags |= UQF_UMTXQ; } /* @@ -241,12 +242,10 @@ static inline void umtxq_remove(struct umtx_q *uq) { mtx_assert(umtxq_mtx(umtxq_hash(&uq->uq_key)), MA_OWNED); - if (uq->uq_thread->td_flags & TDF_UMTXQ) { + if (uq->uq_flags & UQF_UMTXQ) { LIST_REMOVE(uq, uq_next); - /* turning off TDF_UMTXQ should be the last thing. */ - mtx_lock_spin(&sched_lock); - uq->uq_thread->td_flags &= ~TDF_UMTXQ; - mtx_unlock_spin(&sched_lock); + /* turning off UQF_UMTXQ should be the last thing. */ + uq->uq_flags &= ~UQF_UMTXQ; } } @@ -308,7 +307,7 @@ umtxq_sleep(struct thread *td, struct um static int umtx_key_get(struct thread *td, void *umtx, struct umtx_key *key) { -#if defined(UMTX_DYNAMIC_SHARED) || defined(UMTX_STATIC_SHARED) +#if defined(UMTX_STATIC_SHARED) vm_map_t map; vm_map_entry_t entry; vm_pindex_t pindex; @@ -321,20 +320,7 @@ umtx_key_get(struct thread *td, void *um &wired) != KERN_SUCCESS) { return EFAULT; } -#endif -#if defined(UMTX_DYNAMIC_SHARED) - key->type = UMTX_SHARED; - key->info.shared.offset = entry->offset + entry->start - - (vm_offset_t)umtx; - /* - * Add object reference, if we don't do this, a buggy application - * deallocates the object, the object will be reused by other - * applications, then unlock will wake wrong thread. - */ - vm_object_reference(key->info.shared.object); - vm_map_lookup_done(map, entry); -#elif defined(UMTX_STATIC_SHARED) if (VM_INHERIT_SHARE == entry->inheritance) { key->type = UMTX_SHARED; key->info.shared.offset = entry->offset + entry->start - @@ -380,74 +366,6 @@ umtxq_queue_me(struct thread *td, void * return (0); } -#if defined(UMTX_DYNAMIC_SHARED) -static void -fork_handler(void *arg, struct proc *p1, struct proc *p2, int flags) -{ - vm_map_t map; - vm_map_entry_t entry; - vm_object_t object; - vm_pindex_t pindex; - vm_prot_t prot; - boolean_t wired; - struct umtx_key key; - LIST_HEAD(, umtx_q) workq; - struct umtx_q *uq; - struct thread *td; - int onq; - - LIST_INIT(&workq); - - /* Collect threads waiting on umtxq */ - PROC_LOCK(p1); - FOREACH_THREAD_IN_PROC(p1, td) { - if (td->td_flags & TDF_UMTXQ) { - uq = td->td_umtxq; - if (uq) - LIST_INSERT_HEAD(&workq, uq, uq_rqnext); - } - } - PROC_UNLOCK(p1); - - LIST_FOREACH(uq, &workq, uq_rqnext) { - map = &p1->p_vmspace->vm_map; - if (vm_map_lookup(&map, uq->uq_addr, VM_PROT_WRITE, - &entry, &object, &pindex, &prot, &wired) != KERN_SUCCESS) { - continue; - } - key.type = UMTX_SHARED; - key.info.shared.object = object; - key.info.shared.offset = entry->offset + entry->start - - uq->uq_addr; - if (umtx_key_match(&key, &uq->uq_key)) { - vm_map_lookup_done(map, entry); - continue; - } - - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - if (uq->uq_thread->td_flags & TDF_UMTXQ) { - umtxq_remove(uq); - onq = 1; - } else - onq = 0; - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); - if (onq) { - vm_object_deallocate(uq->uq_key.info.shared.object); - uq->uq_key = key; - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_insert(uq); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); - vm_object_reference(uq->uq_key.info.shared.object); - } - vm_map_lookup_done(map, entry); - } -} -#endif - static int _do_lock(struct thread *td, struct umtx *umtx, long id, int timo) { @@ -526,7 +444,7 @@ _do_lock(struct thread *td, struct umtx * unlocking the umtx. */ umtxq_lock(&uq->uq_key); - if (old == owner && (td->td_flags & TDF_UMTXQ)) { + if (old == owner && (uq->uq_flags & UQF_UMTXQ)) { error = umtxq_sleep(td, &uq->uq_key, PCATCH, "umtx", timo); } @@ -705,7 +623,7 @@ _do_lock32(struct thread *td, uint32_t * * unlocking the umtx. */ umtxq_lock(&uq->uq_key); - if (old == owner && (td->td_flags & TDF_UMTXQ)) { + if (old == owner && (uq->uq_flags & UQF_UMTXQ)) { error = umtxq_sleep(td, &uq->uq_key, PCATCH, "umtx", timo); } @@ -825,35 +743,22 @@ do_wait(struct thread *td, struct umtx * tmp = fuword(&umtx->u_owner); else tmp = fuword32(&umtx->u_owner); + umtxq_lock(&uq->uq_key); if (tmp != id) { - umtxq_lock(&uq->uq_key); umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); } else if (timeout == NULL) { - umtxq_lock(&uq->uq_key); - if (td->td_flags & TDF_UMTXQ) + if (uq->uq_flags & UQF_UMTXQ) error = umtxq_sleep(td, &uq->uq_key, PCATCH, "ucond", 0); - if (!(td->td_flags & TDF_UMTXQ)) - error = 0; - else - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); } else { getnanouptime(&ts); timespecadd(&ts, timeout); TIMESPEC_TO_TIMEVAL(&tv, timeout); for (;;) { - umtxq_lock(&uq->uq_key); - if (td->td_flags & TDF_UMTXQ) { + if (uq->uq_flags & UQF_UMTXQ) { error = umtxq_sleep(td, &uq->uq_key, PCATCH, - "ucond", tvtohz(&tv)); - } - if (!(td->td_flags & TDF_UMTXQ)) { - umtxq_unlock(&uq->uq_key); - goto out; + "ucondt", tvtohz(&tv)); } - umtxq_unlock(&uq->uq_key); if (error != ETIMEDOUT) break; getnanouptime(&ts2); @@ -865,14 +770,28 @@ do_wait(struct thread *td, struct umtx * timespecsub(&ts3, &ts2); TIMESPEC_TO_TIMEVAL(&tv, &ts3); } - umtxq_lock(&uq->uq_key); - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); } -out: + if (error != 0) { + if ((uq->uq_flags & UQF_UMTXQ) == 0) { + /* + * If we concurrently got do_cv_signal()d + * and we got an error or UNIX signals or a timeout, + * then, perform another umtxq_signal to avoid + * consuming the wakeup. This may cause supurious + * wakeup for another thread which was just queued, + * but SUSV3 explicitly allows supurious wakeup to + * occur, and indeed a kernel based implementation + * can not avoid it. + */ + if (!umtxq_signal(&uq->uq_key, 1)) + error = 0; + } + if (error == ERESTART) + error = EINTR; + } + umtxq_remove(uq); + umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); - if (error == ERESTART) - error = EINTR; return (error); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 18:25:14 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2655610656A9; Wed, 22 Oct 2008 18:25:14 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131B38FC12; Wed, 22 Oct 2008 18:25:14 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MIPDsO035659; Wed, 22 Oct 2008 18:25:13 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MIPDSE035658; Wed, 22 Oct 2008 18:25:13 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810221825.m9MIPDSE035658@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Oct 2008 18:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184174 - in stable/6/release: . scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:25:14 -0000 Author: kensmith Date: Wed Oct 22 18:25:13 2008 New Revision: 184174 URL: http://svn.freebsd.org/changeset/base/184174 Log: MFS r184137 and r184166 from stable/7 Net effect is to add support for building DVD images when the MAKE_DVD knob is enabled, and enable it for amd64 and i386 architectures. Approved by: re (kib) Modified: stable/6/release/ (props changed) stable/6/release/Makefile stable/6/release/scripts/src-install.sh (props changed) Modified: stable/6/release/Makefile ============================================================================== --- stable/6/release/Makefile Wed Oct 22 18:20:45 2008 (r184173) +++ stable/6/release/Makefile Wed Oct 22 18:25:13 2008 (r184174) @@ -192,6 +192,7 @@ MNT= /mnt .undef MAKE_FLOPPIES .if ${TARGET_ARCH} == "i386" MAKE_FLOPPIES= true +MAKE_DVD= .if ${TARGET} == "pc98" SMALLFLOPPYSIZE= 1200 SMALLFLOPPYSPLITSIZE= 1152 @@ -230,6 +231,7 @@ MFSLABEL= auto SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "amd64" MAKE_FLOPPIES= true +MAKE_DVD= FLOPPYSIZE= 1440 FLOPPYSPLITSIZE= 1392 FLOPPYINODE= 40000 @@ -269,6 +271,9 @@ CD_BOOT= ${CD}/bootonly CD_DISC1= ${CD}/disc1 CD_DISC2= ${CD}/disc2 CD_DISC3= ${CD}/disc3 +.if defined(MAKE_DVD) +CD_DVD1= ${CD}/dvd1 +.endif .if !defined(NODOC) CD_DOCS= ${CD}/docs .endif @@ -488,6 +493,7 @@ release rerelease: KERNELS \ KERNELS_BASE \ KERNEL_FLAGS \ + MAKE_DVD \ MAKE_FLOPPIES \ MAKE_ISOS \ NOCDROM \ @@ -941,6 +947,18 @@ cdrom.1: find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \ fi \ done +.if defined(MAKE_DVD) + @echo "Building DVD filesystem image as well as CDROM" + @mkdir -p ${CD_DVD1}/${BUILDNAME} + @for i in ${DISTRIBUTIONS} ; \ + do \ + if [ -d ${RD}/trees/$${i} ] ; then \ + chflags -R noschg ${RD}/trees/$${i} || true ; \ + ( cd ${RD}/trees/$${i} && \ + find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \ + fi \ + done +.endif @echo "Copy GENERIC kernel to boot area" @cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel @rm -f ${CD_LIVEFS}/.profile @@ -958,6 +976,23 @@ cdrom.1: @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints .endif @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf +.if defined(MAKE_DVD) + @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel + @rm -f ${CD_DVD1}/boot/kernel/*.symbols + @rm -f ${CD_DVD1}/.profile + @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile + @ln -sf /rescue ${CD_DVD1}/stand + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf + @rm -f ${CD_DVD1}/boot/loader.conf + @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz + @echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf + @echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf + @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf +.if exists(${RD}/trees/base/boot/device.hints) + @rm -f ${CD_DVD1}/boot/device.hints + @cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints +.endif +.endif touch ${.TARGET} # Build disc1, disc2 and disc3 cdrom images @@ -998,11 +1033,37 @@ cdrom.2: @mkdir -p ${CD_DISC3} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC3}/cdrom.inf @echo "CD_VOLUME = 3" >> ${CD_DISC3}/cdrom.inf +.if defined(MAKE_DVD) +.if defined(MAKE_FLOPPIES) + @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1} +.endif + @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME} +.if !defined(NODOC) + @for i in ${DIST_DOCS_ARCH_INDEP}; do \ + cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ + cp ${RND}/${RELNOTES_LANG}/$$i/article.html \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ + done + @for i in ${DIST_DOCS_ARCH_DEP}; do \ + cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ + cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \ + ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \ + done + @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1} +.endif + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf + @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf +.endif .if !defined(NODOC) @echo "Building CDROM docs filesystem image" @mkdir -p ${CD_DOCS} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf @mkdir -p ${CD_DOCS}/usr/share/doc +.if defined(MAKE_DVD) + @mkdir -p ${CD_DVD1}/usr/share/doc +.endif @for i in `ls ${CD_LIVEFS}/usr/share/doc`; do \ if [ -L ${CD_LIVEFS}/usr/share/doc/$$i -o \ -d /usr/doc/$$i ]; then \ @@ -1010,6 +1071,10 @@ cdrom.2: ${CD_DOCS}/usr/share/doc; \ fi \ done +.if defined(MAKE_DVD) + @cd ${CD_DOCS}/usr/share/doc && find . -print | \ + cpio -dumpl ${CD_DVD1}/usr/share/doc +.endif .endif touch ${.TARGET} @@ -1043,6 +1108,9 @@ CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 .if exists(${CD_PACKAGE_TREE}/disc3) CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3 .endif +.if exists(${CD_PACKAGE_TREE}/dvd1) +CD_DVD_PKGS= ${CD_PACKAGE_TREE}/dvd1 +.endif .endif .endif @@ -1066,6 +1134,12 @@ iso.1: FreeBSD_Packages_2 \ ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ ${CD_DISC3_PKGS} +.if defined(MAKE_DVD) + @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + FreeBSD_Install \ + ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ + ${CD_DVD1_PKGS} +.endif .if !defined(NODOC) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Documentation \ From owner-svn-src-stable@FreeBSD.ORG Wed Oct 22 19:27:41 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453381065674; Wed, 22 Oct 2008 19:27:41 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 335A68FC1A; Wed, 22 Oct 2008 19:27:41 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MJRfiM036974; Wed, 22 Oct 2008 19:27:41 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MJRfEZ036973; Wed, 22 Oct 2008 19:27:41 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200810221927.m9MJRfEZ036973@svn.freebsd.org> From: Philip Paeps Date: Wed, 22 Oct 2008 19:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184175 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 19:27:41 -0000 Author: philip Date: Wed Oct 22 19:27:40 2008 New Revision: 184175 URL: http://svn.freebsd.org/changeset/base/184175 Log: MFC r183977: Adjust default keymaps for Ireland and Channel Islands. PR: conf/124411 Submitted by: Doctor Modiford Approved by: re (gnn) Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/keymap.c Modified: stable/7/usr.sbin/sysinstall/keymap.c ============================================================================== --- stable/7/usr.sbin/sysinstall/keymap.c Wed Oct 22 18:25:13 2008 (r184174) +++ stable/7/usr.sbin/sysinstall/keymap.c Wed Oct 22 19:27:40 2008 (r184175) @@ -82,6 +82,10 @@ keymapMenuSelect(dialogMenuItem *self) {"se", "swedish"}, {"ch", "swiss"}, {"gb", "uk"}, + {"gg", "uk"}, + {"ie", "uk"}, + {"im", "uk"}, + {"je", "uk"}, {NULL, NULL} }; const char *country, *lang; From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 00:54:09 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85864106567F; Thu, 23 Oct 2008 00:54:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 727768FC1A; Thu, 23 Oct 2008 00:54:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0s838043186; Thu, 23 Oct 2008 00:54:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0s81D043185; Thu, 23 Oct 2008 00:54:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810230054.m9N0s81D043185@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 23 Oct 2008 00:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184190 - in stable/7/sys: . dev/mii X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:54:09 -0000 Author: yongari Date: Thu Oct 23 00:54:07 2008 New Revision: 184190 URL: http://svn.freebsd.org/changeset/base/184190 Log: MFC r183966: Some 88E1149 PHY's page select is initialized to point to other bank instead of copper/fiber bank which in turn resulted in wrong registers were accessed during PHY operation. It is believed that page 0 should be used for copper PHY so reinitialize E1000_EADR to select default copper PHY. This fixes link establishment issue of nfe(4) on Sun Fire X4140. OpenBSD also has similimar patch but they just reset the E1000_EADR register to page 0. However some Marvell PHYs((88E3082, 88E1000) don't have the extended address register and the meaning of the register is quite different for each PHY model. So selecting copper PHY is limited to 88E1149 PHY which seems to be the only one that exhibits link establishment problem. If parent device know the type of PHY(either copper or fiber) that information should be notified to PHY driver but there is no good way to pass this information yet. Reported by: thompsa Reviewed by: thompsa Approved by: re (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/dev/mii/e1000phy.c Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Thu Oct 23 00:31:15 2008 (r184189) +++ stable/7/sys/dev/mii/e1000phy.c Thu Oct 23 00:54:07 2008 (r184190) @@ -152,6 +152,20 @@ e1000phy_attach(device_t dev) if (PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK) sc->mii_flags |= MIIF_HAVEFIBER; break; + case MII_MODEL_MARVELL_E1149: + /* + * Some 88E1149 PHY's page select is initialized to + * point to other bank instead of copper/fiber bank + * which in turn resulted in wrong registers were + * accessed during PHY operation. It is believed that + * page 0 should be used for copper PHY so reinitialize + * E1000_EADR to select default copper PHY. If parent + * device know the type of PHY(either copper or fiber), + * that information should be used to select default + * type of PHY. + */ + PHY_WRITE(sc, E1000_EADR, 0); + break; case MII_MODEL_MARVELL_E3082: /* 88E3082 10/100 Fast Ethernet PHY. */ sc->mii_anegticks = MII_ANEGTICKS; From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 00:56:01 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BCB81065670; Thu, 23 Oct 2008 00:56:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8905B8FC08; Thu, 23 Oct 2008 00:56:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0u19T043270; Thu, 23 Oct 2008 00:56:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0u1uJ043269; Thu, 23 Oct 2008 00:56:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810230056.m9N0u1uJ043269@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 23 Oct 2008 00:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184191 - in stable/6/sys: . dev/mii X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:56:01 -0000 Author: yongari Date: Thu Oct 23 00:56:01 2008 New Revision: 184191 URL: http://svn.freebsd.org/changeset/base/184191 Log: MFC r183966: Some 88E1149 PHY's page select is initialized to point to other bank instead of copper/fiber bank which in turn resulted in wrong registers were accessed during PHY operation. It is believed that page 0 should be used for copper PHY so reinitialize E1000_EADR to select default copper PHY. This fixes link establishment issue of nfe(4) on Sun Fire X4140. OpenBSD also has similimar patch but they just reset the E1000_EADR register to page 0. However some Marvell PHYs((88E3082, 88E1000) don't have the extended address register and the meaning of the register is quite different for each PHY model. So selecting copper PHY is limited to 88E1149 PHY which seems to be the only one that exhibits link establishment problem. If parent device know the type of PHY(either copper or fiber) that information should be notified to PHY driver but there is no good way to pass this information yet. Reported by: thompsa Reviewed by: thompsa Approved by: re (gnn) Modified: stable/6/sys/ (props changed) stable/6/sys/dev/mii/e1000phy.c Modified: stable/6/sys/dev/mii/e1000phy.c ============================================================================== --- stable/6/sys/dev/mii/e1000phy.c Thu Oct 23 00:54:07 2008 (r184190) +++ stable/6/sys/dev/mii/e1000phy.c Thu Oct 23 00:56:01 2008 (r184191) @@ -153,6 +153,20 @@ e1000phy_attach(device_t dev) if (PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK) sc->mii_flags |= MIIF_HAVEFIBER; break; + case MII_MODEL_MARVELL_E1149: + /* + * Some 88E1149 PHY's page select is initialized to + * point to other bank instead of copper/fiber bank + * which in turn resulted in wrong registers were + * accessed during PHY operation. It is believed that + * page 0 should be used for copper PHY so reinitialize + * E1000_EADR to select default copper PHY. If parent + * device know the type of PHY(either copper or fiber), + * that information should be used to select default + * type of PHY. + */ + PHY_WRITE(sc, E1000_EADR, 0); + break; case MII_MODEL_MARVELL_E3082: /* 88E3082 10/100 Fast Ethernet PHY. */ sc->mii_anegticks = MII_ANEGTICKS; From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 04:48:49 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED441065699; Thu, 23 Oct 2008 04:48:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7238FC14; Thu, 23 Oct 2008 04:48:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N4mnb8048068; Thu, 23 Oct 2008 04:48:49 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N4mn8c048065; Thu, 23 Oct 2008 04:48:49 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200810230448.m9N4mn8c048065@svn.freebsd.org> From: Tim Kientzle Date: Thu, 23 Oct 2008 04:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184195 - in stable/7/lib/libarchive: . test X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 04:48:49 -0000 Author: kientzle Date: Thu Oct 23 04:48:48 2008 New Revision: 184195 URL: http://svn.freebsd.org/changeset/base/184195 Log: MFC r184038: Restore mtime *after* restoring ACLs. Otherwise, setting the ACL changes the mtime. (Plus a new test to exercise basic ACL restore logic.) PR: kern/128203 Submitted by: Udo Schweigert Approved by: re (Kostik Belousov) Added: stable/7/lib/libarchive/test/test_acl_freebsd.c - copied unchanged from r184038, head/lib/libarchive/test/test_acl_freebsd.c Modified: stable/7/lib/libarchive/ (props changed) stable/7/lib/libarchive/archive_write_disk.c stable/7/lib/libarchive/test/Makefile Modified: stable/7/lib/libarchive/archive_write_disk.c ============================================================================== --- stable/7/lib/libarchive/archive_write_disk.c Thu Oct 23 02:16:38 2008 (r184194) +++ stable/7/lib/libarchive/archive_write_disk.c Thu Oct 23 04:48:48 2008 (r184195) @@ -641,10 +641,6 @@ _archive_write_finish_entry(struct archi int r2 = set_mode(a, a->mode); if (r2 < ret) ret = r2; } - if (a->todo & TODO_TIMES) { - int r2 = set_time(a); - if (r2 < ret) ret = r2; - } if (a->todo & TODO_ACLS) { int r2 = set_acls(a); if (r2 < ret) ret = r2; @@ -657,6 +653,10 @@ _archive_write_finish_entry(struct archi int r2 = set_fflags(a); if (r2 < ret) ret = r2; } + if (a->todo & TODO_TIMES) { + int r2 = set_time(a); + if (r2 < ret) ret = r2; + } /* If there's an fd, we can close it now. */ if (a->fd >= 0) { Modified: stable/7/lib/libarchive/test/Makefile ============================================================================== --- stable/7/lib/libarchive/test/Makefile Thu Oct 23 02:16:38 2008 (r184194) +++ stable/7/lib/libarchive/test/Makefile Thu Oct 23 04:48:48 2008 (r184195) @@ -9,6 +9,7 @@ LA_SRCS!=make -f ${LA_SRCDIR}/Makefile - TESTS= \ test_acl_basic.c \ + test_acl_freebsd.c \ test_acl_pax.c \ test_archive_api_feature.c \ test_bad_fd.c \ Copied: stable/7/lib/libarchive/test/test_acl_freebsd.c (from r184038, head/lib/libarchive/test/test_acl_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libarchive/test/test_acl_freebsd.c Thu Oct 23 04:48:48 2008 (r184195, copy of r184038, head/lib/libarchive/test/test_acl_freebsd.c) @@ -0,0 +1,243 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#if defined(__FreeBSD__) && __FreeBSD__ > 4 +#include + +struct myacl_t { + int type; /* Type of ACL: "access" or "default" */ + int permset; /* Permissions for this class of users. */ + int tag; /* Owner, User, Owning group, group, other, etc. */ + int qual; /* GID or UID of user/group, depending on tag. */ + const char *name; /* Name of user/group, depending on tag. */ +}; + +static struct myacl_t acls2[] = { + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER, 77, "user77" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0, + ARCHIVE_ENTRY_ACL_USER, 78, "user78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007, + ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_OTHER, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_MASK, -1, "" }, + { 0, 0, 0, 0, NULL } +}; + +static void +set_acls(struct archive_entry *ae, struct myacl_t *acls) +{ + int i; + + archive_entry_acl_clear(ae); + for (i = 0; acls[i].name != NULL; i++) { + archive_entry_acl_add_entry(ae, + acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual, + acls[i].name); + } +} + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + acl_tag_t tag_type; + acl_permset_t opaque_ps; + int permset = 0; + + acl_get_tag_type(aclent, &tag_type); + + /* translate the silly opaque permset to a bitmap */ + acl_get_permset(aclent, &opaque_ps); + if (acl_get_perm_np(opaque_ps, ACL_EXECUTE)) + permset |= ARCHIVE_ENTRY_ACL_EXECUTE; + if (acl_get_perm_np(opaque_ps, ACL_WRITE)) + permset |= ARCHIVE_ENTRY_ACL_WRITE; + if (acl_get_perm_np(opaque_ps, ACL_READ)) + permset |= ARCHIVE_ENTRY_ACL_READ; + + if (permset != myacl->permset) + return (0); + + switch (tag_type) { + case ACL_USER_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); + break; + case ACL_USER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER) + return (0); + if ((uid_t)myacl->qual != *(uid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_GROUP_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0); + break; + case ACL_GROUP: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP) + return (0); + if ((gid_t)myacl->qual != *(gid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_MASK: + if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0); + break; + case ACL_OTHER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0); + break; + } + return (1); +} + +static void +compare_acls(acl_t acl, struct myacl_t *myacls) +{ + int *marker; + int entry_id = ACL_FIRST_ENTRY; + int matched; + int i, n; + acl_entry_t acl_entry; + + /* Count ACL entries in myacls array and allocate an indirect array. */ + for (n = 0; myacls[n].name != NULL; ++n) + continue; + marker = malloc(sizeof(marker[0]) * n); + for (i = 0; i < n; i++) + marker[i] = i; + + /* + * Iterate over acls in system acl object, try to match each + * one with an item in the myacls array. + */ + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (acl_match(acl_entry, &myacls[marker[i]])) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + /* TODO: Print out more details in this case. */ + failure("ACL entry on file that shouldn't be there"); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry missing from file: " + "type=%d,permset=%d,tag=%d,qual=%d,name=``%s''\n", + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} + +#endif + + +/* + * Verify ACL restore-to-disk. This test is FreeBSD-specific. + */ + +DEFINE_TEST(test_acl_freebsd) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL restore test"); +#elif __FreeBSD__ < 5 + skipping("ACL restore supported only on FreeBSD 5.0 and later"); +#else + struct stat st; + struct archive *a; + struct archive_entry *ae; + int n, fd; + acl_t acl; + + /* + * First, do a quick manual set/read of ACL data to + * verify that the local filesystem does support ACLs. + * If it doesn't, we'll simply skip the remaining tests. + */ + acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx"); + assert((void *)acl != NULL); + /* Create a test file and try to set an ACL on it. */ + fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + n = -1; + if (assert(fd >= 0)) { + n = acl_set_fd(fd, acl); + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + } + + if (fd < 0 || n != 0) { + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + + /* Create a write-to-disk object. */ + assert(NULL != (a = archive_write_disk_new())); + archive_write_disk_set_options(a, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL); + + /* Populate an archive entry with some metadata, including ACL info */ + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "test0"); + archive_entry_set_mtime(ae, 123456, 7890); + archive_entry_set_size(ae, 0); + set_acls(ae, acls2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + + /* Verify the data on disk. */ + assertEqualInt(0, stat("test0", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("test0", ACL_TYPE_ACCESS); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls2); +#endif +} From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 04:50:06 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB466106567E; Thu, 23 Oct 2008 04:50:06 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B776D8FC13; Thu, 23 Oct 2008 04:50:06 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N4o6Wx048131; Thu, 23 Oct 2008 04:50:06 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N4o62U048127; Thu, 23 Oct 2008 04:50:06 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200810230450.m9N4o62U048127@svn.freebsd.org> From: Tim Kientzle Date: Thu, 23 Oct 2008 04:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184196 - in stable/6/lib/libarchive: . test X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 04:50:06 -0000 Author: kientzle Date: Thu Oct 23 04:50:06 2008 New Revision: 184196 URL: http://svn.freebsd.org/changeset/base/184196 Log: MFC r184038: Restore mtime *after* restoring ACLs. Otherwise, setting the ACL changes the mtime. (Plus a new test to exercise basic ACL restore logic.) PR: kern/128203 Submitted by: Udo Schweigert Approved by: re (Kostik Belousov) Added: stable/6/lib/libarchive/test/test_acl_freebsd.c - copied unchanged from r184038, head/lib/libarchive/test/test_acl_freebsd.c Modified: stable/6/lib/libarchive/ (props changed) stable/6/lib/libarchive/archive_write_disk.c stable/6/lib/libarchive/test/Makefile Modified: stable/6/lib/libarchive/archive_write_disk.c ============================================================================== --- stable/6/lib/libarchive/archive_write_disk.c Thu Oct 23 04:48:48 2008 (r184195) +++ stable/6/lib/libarchive/archive_write_disk.c Thu Oct 23 04:50:06 2008 (r184196) @@ -641,10 +641,6 @@ _archive_write_finish_entry(struct archi int r2 = set_mode(a, a->mode); if (r2 < ret) ret = r2; } - if (a->todo & TODO_TIMES) { - int r2 = set_time(a); - if (r2 < ret) ret = r2; - } if (a->todo & TODO_ACLS) { int r2 = set_acls(a); if (r2 < ret) ret = r2; @@ -657,6 +653,10 @@ _archive_write_finish_entry(struct archi int r2 = set_fflags(a); if (r2 < ret) ret = r2; } + if (a->todo & TODO_TIMES) { + int r2 = set_time(a); + if (r2 < ret) ret = r2; + } /* If there's an fd, we can close it now. */ if (a->fd >= 0) { Modified: stable/6/lib/libarchive/test/Makefile ============================================================================== --- stable/6/lib/libarchive/test/Makefile Thu Oct 23 04:48:48 2008 (r184195) +++ stable/6/lib/libarchive/test/Makefile Thu Oct 23 04:50:06 2008 (r184196) @@ -9,6 +9,7 @@ LA_SRCS!=make -f ${LA_SRCDIR}/Makefile - TESTS= \ test_acl_basic.c \ + test_acl_freebsd.c \ test_acl_pax.c \ test_archive_api_feature.c \ test_bad_fd.c \ Copied: stable/6/lib/libarchive/test/test_acl_freebsd.c (from r184038, head/lib/libarchive/test/test_acl_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/lib/libarchive/test/test_acl_freebsd.c Thu Oct 23 04:50:06 2008 (r184196, copy of r184038, head/lib/libarchive/test/test_acl_freebsd.c) @@ -0,0 +1,243 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#if defined(__FreeBSD__) && __FreeBSD__ > 4 +#include + +struct myacl_t { + int type; /* Type of ACL: "access" or "default" */ + int permset; /* Permissions for this class of users. */ + int tag; /* Owner, User, Owning group, group, other, etc. */ + int qual; /* GID or UID of user/group, depending on tag. */ + const char *name; /* Name of user/group, depending on tag. */ +}; + +static struct myacl_t acls2[] = { + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER, 77, "user77" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0, + ARCHIVE_ENTRY_ACL_USER, 78, "user78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007, + ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_OTHER, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_MASK, -1, "" }, + { 0, 0, 0, 0, NULL } +}; + +static void +set_acls(struct archive_entry *ae, struct myacl_t *acls) +{ + int i; + + archive_entry_acl_clear(ae); + for (i = 0; acls[i].name != NULL; i++) { + archive_entry_acl_add_entry(ae, + acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual, + acls[i].name); + } +} + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + acl_tag_t tag_type; + acl_permset_t opaque_ps; + int permset = 0; + + acl_get_tag_type(aclent, &tag_type); + + /* translate the silly opaque permset to a bitmap */ + acl_get_permset(aclent, &opaque_ps); + if (acl_get_perm_np(opaque_ps, ACL_EXECUTE)) + permset |= ARCHIVE_ENTRY_ACL_EXECUTE; + if (acl_get_perm_np(opaque_ps, ACL_WRITE)) + permset |= ARCHIVE_ENTRY_ACL_WRITE; + if (acl_get_perm_np(opaque_ps, ACL_READ)) + permset |= ARCHIVE_ENTRY_ACL_READ; + + if (permset != myacl->permset) + return (0); + + switch (tag_type) { + case ACL_USER_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); + break; + case ACL_USER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER) + return (0); + if ((uid_t)myacl->qual != *(uid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_GROUP_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0); + break; + case ACL_GROUP: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP) + return (0); + if ((gid_t)myacl->qual != *(gid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_MASK: + if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0); + break; + case ACL_OTHER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0); + break; + } + return (1); +} + +static void +compare_acls(acl_t acl, struct myacl_t *myacls) +{ + int *marker; + int entry_id = ACL_FIRST_ENTRY; + int matched; + int i, n; + acl_entry_t acl_entry; + + /* Count ACL entries in myacls array and allocate an indirect array. */ + for (n = 0; myacls[n].name != NULL; ++n) + continue; + marker = malloc(sizeof(marker[0]) * n); + for (i = 0; i < n; i++) + marker[i] = i; + + /* + * Iterate over acls in system acl object, try to match each + * one with an item in the myacls array. + */ + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (acl_match(acl_entry, &myacls[marker[i]])) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + /* TODO: Print out more details in this case. */ + failure("ACL entry on file that shouldn't be there"); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry missing from file: " + "type=%d,permset=%d,tag=%d,qual=%d,name=``%s''\n", + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} + +#endif + + +/* + * Verify ACL restore-to-disk. This test is FreeBSD-specific. + */ + +DEFINE_TEST(test_acl_freebsd) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL restore test"); +#elif __FreeBSD__ < 5 + skipping("ACL restore supported only on FreeBSD 5.0 and later"); +#else + struct stat st; + struct archive *a; + struct archive_entry *ae; + int n, fd; + acl_t acl; + + /* + * First, do a quick manual set/read of ACL data to + * verify that the local filesystem does support ACLs. + * If it doesn't, we'll simply skip the remaining tests. + */ + acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx"); + assert((void *)acl != NULL); + /* Create a test file and try to set an ACL on it. */ + fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + n = -1; + if (assert(fd >= 0)) { + n = acl_set_fd(fd, acl); + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + } + + if (fd < 0 || n != 0) { + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + + /* Create a write-to-disk object. */ + assert(NULL != (a = archive_write_disk_new())); + archive_write_disk_set_options(a, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL); + + /* Populate an archive entry with some metadata, including ACL info */ + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "test0"); + archive_entry_set_mtime(ae, 123456, 7890); + archive_entry_set_size(ae, 0); + set_acls(ae, acls2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + + /* Verify the data on disk. */ + assertEqualInt(0, stat("test0", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("test0", ACL_TYPE_ACCESS); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls2); +#endif +} From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 13:23:14 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED8E1065673; Thu, 23 Oct 2008 13:23:14 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCD2A8FC18; Thu, 23 Oct 2008 13:23:14 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NDNEKo057708; Thu, 23 Oct 2008 13:23:14 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NDNEaT057707; Thu, 23 Oct 2008 13:23:14 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810231323.m9NDNEaT057707@svn.freebsd.org> From: Ken Smith Date: Thu, 23 Oct 2008 13:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184201 - stable/6/release/scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 13:23:15 -0000 Author: kensmith Date: Thu Oct 23 13:23:14 2008 New Revision: 184201 URL: http://svn.freebsd.org/changeset/base/184201 Log: Adjust package set for 6.4-REL. Approved by: re (kib) Modified: stable/6/release/scripts/package-split.py Modified: stable/6/release/scripts/package-split.py ============================================================================== --- stable/6/release/scripts/package-split.py Thu Oct 23 10:38:04 2008 (r184200) +++ stable/6/release/scripts/package-split.py Thu Oct 23 13:23:14 2008 (r184201) @@ -26,13 +26,12 @@ else: # List of packages for disc1. This just includes packages sysinstall can # install as a distribution def disc1_packages(): - pkgs = ['lang/perl5.8'] - pkgs.extend(['x11/xorg', - 'x11-drivers/xorg-drivers', - 'x11-fonts/xorg-fonts', - 'x11-servers/xorg-nestserver', - 'x11-servers/xorg-vfbserver', - 'devel/imake']) + pkgs = ['archivers/unzip', + 'emulators/mtools', + 'lang/perl5.8', + 'misc/compat5x', + 'net/cvsup-without-gui', + 'net/rsync'] if arch == 'alpha': pkgs.append('emulators/osf1_base') elif arch == 'i386': @@ -49,42 +48,45 @@ def disc2_packages(): 'x11/kde-lite'] else: pkgs = ['x11/gnome2', - 'x11/kde3'] + 'x11/kdebase3', + 'x11/kdelibs3'] + pkgs.extend(['x11/xorg', + 'x11-drivers/xorg-drivers', + 'x11-fonts/xorg-fonts', + 'x11-servers/xorg-nestserver', + 'x11-servers/xorg-vfbserver', + 'devel/imake']) return pkgs def disc3_packages(): - pkgs = ['x11-wm/afterstep', + pkgs = ['x11/kde3', + 'x11-wm/afterstep', 'x11-wm/windowmaker', 'x11-wm/fvwm2', # "Nice to have" - 'archivers/unzip', 'astro/xearth', 'devel/gmake', 'editors/emacs', 'editors/vim-lite', 'editors/xemacs', - 'emulators/mtools', 'graphics/png', 'graphics/xv', 'irc/xchat', 'lang/php5', + 'mail/alpine', 'mail/exim', 'mail/fetchmail', 'mail/mutt', - 'mail/pine4', 'mail/popd', 'mail/xfmail', 'mail/postfix', - 'misc/compat5x', - 'net/cvsup-without-gui', - 'net/rsync', 'net/samba3', 'news/slrn', 'news/tin', 'ports-mgmt/portupgrade', 'print/a2ps-letter', 'print/apsfilter', - 'print/ghostscript-gnu-nox11', + 'print/ghostscript7-nox11', 'print/gv', 'print/psutils-letter', 'print/teTeX', From owner-svn-src-stable@FreeBSD.ORG Thu Oct 23 15:44:00 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FDA1106566C; Thu, 23 Oct 2008 15:44:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD2C8FC34; Thu, 23 Oct 2008 15:44:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NFi0hl060413; Thu, 23 Oct 2008 15:44:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NFi0E1060412; Thu, 23 Oct 2008 15:44:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810231544.m9NFi0E1060412@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 Oct 2008 15:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184204 - in stable/7/sys: . geom/part X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 15:44:00 -0000 Author: marcel Date: Thu Oct 23 15:44:00 2008 New Revision: 184204 URL: http://svn.freebsd.org/changeset/base/184204 Log: MFC rev 183455: Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORM if the probe succeeds. This guarantees that the BSD scheme wins over the MBR scheme when MBR gets to probe first. Approved by: re (kib@) Modified: stable/7/sys/ (props changed) stable/7/sys/geom/part/g_part_bsd.c Modified: stable/7/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/7/sys/geom/part/g_part_bsd.c Thu Oct 23 15:32:06 2008 (r184203) +++ stable/7/sys/geom/part/g_part_bsd.c Thu Oct 23 15:44:00 2008 (r184204) @@ -293,7 +293,7 @@ g_part_bsd_probe(struct g_part_table *ta magic2 = le32dec(buf + 132); g_free(buf); return ((magic1 == DISKMAGIC && magic2 == DISKMAGIC) - ? G_PART_PROBE_PRI_NORM : ENXIO); + ? G_PART_PROBE_PRI_HIGH : ENXIO); } static int From owner-svn-src-stable@FreeBSD.ORG Fri Oct 24 13:23:54 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82591065672; Fri, 24 Oct 2008 13:23:54 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C60548FC20; Fri, 24 Oct 2008 13:23:54 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9ODNswo090932; Fri, 24 Oct 2008 13:23:54 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9ODNsdU090931; Fri, 24 Oct 2008 13:23:54 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200810241323.m9ODNsdU090931@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 24 Oct 2008 13:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184225 - stable/7/lib/libfetch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 13:23:55 -0000 Author: ru Date: Fri Oct 24 13:23:54 2008 New Revision: 184225 URL: http://svn.freebsd.org/changeset/base/184225 Log: Don't fail mistakenly with -r when we already have the whole file. Approved by: re (kib) Modified: stable/7/lib/libfetch/ (props changed) stable/7/lib/libfetch/http.c Modified: stable/7/lib/libfetch/http.c ============================================================================== --- stable/7/lib/libfetch/http.c Fri Oct 24 07:58:38 2008 (r184224) +++ stable/7/lib/libfetch/http.c Fri Oct 24 13:23:54 2008 (r184225) @@ -1064,6 +1064,7 @@ http_request(struct url *URL, const char if (url->offset == size && url->length == 0) { /* asked for 0 bytes; fake it */ offset = url->offset; + clength = -1; conn->err = HTTP_OK; break; } else { From owner-svn-src-stable@FreeBSD.ORG Fri Oct 24 20:10:23 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A491065673; Fri, 24 Oct 2008 20:10:23 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED718FC1E; Fri, 24 Oct 2008 20:10:23 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OKANt1098125; Fri, 24 Oct 2008 20:10:23 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OKAMYC098120; Fri, 24 Oct 2008 20:10:22 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810242010.m9OKAMYC098120@svn.freebsd.org> From: Ken Smith Date: Fri, 24 Oct 2008 20:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184232 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 20:10:23 -0000 Author: kensmith Date: Fri Oct 24 20:10:22 2008 New Revision: 184232 URL: http://svn.freebsd.org/changeset/base/184232 Log: MFC r183921 and r184180 When we notice the INDEX had volume numbers (so the media the packages are coming from has multiple volumes) walk through the dependency tree for the packages selected by the user once for each volume, only installing packages on the current volume. If we can't install the package because its on a higher volume just note that we have looked at it during the pass for this volume to cut down on time spent checking dependencies. This stops the excessive disc swapping that users have complained (a lot...) about. Approved by: re (kib) Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/config.c stable/7/usr.sbin/sysinstall/globals.c stable/7/usr.sbin/sysinstall/index.c stable/7/usr.sbin/sysinstall/package.c stable/7/usr.sbin/sysinstall/sysinstall.h Modified: stable/7/usr.sbin/sysinstall/config.c ============================================================================== --- stable/7/usr.sbin/sysinstall/config.c Fri Oct 24 19:36:28 2008 (r184231) +++ stable/7/usr.sbin/sysinstall/config.c Fri Oct 24 20:10:22 2008 (r184232) @@ -737,6 +737,7 @@ configPackages(dialogMenuItem *self) while (1) { int ret, pos, scroll; + int current, low, high; /* Bring up the packages menu */ pos = scroll = 0; @@ -751,8 +752,14 @@ configPackages(dialogMenuItem *self) else if (DITEM_STATUS(ret) != DITEM_FAILURE) { dialog_clear(); restoreflag = 1; - for (tmp = Plist.kids; tmp && tmp->name; tmp = tmp->next) - (void)index_extract(mediaDevice, &Top, tmp, FALSE); + if (have_volumes) { + low = low_volume; + high = high_volume; + } else + low = high = 0; + for (current = low; current <= high; current++) + for (tmp = Plist.kids; tmp && tmp->name; tmp = tmp->next) + (void)index_extract(mediaDevice, &Top, tmp, FALSE, current); break; } } Modified: stable/7/usr.sbin/sysinstall/globals.c ============================================================================== --- stable/7/usr.sbin/sysinstall/globals.c Fri Oct 24 19:36:28 2008 (r184231) +++ stable/7/usr.sbin/sysinstall/globals.c Fri Oct 24 20:10:22 2008 (r184232) @@ -48,10 +48,13 @@ Boolean DialogActive; /* Is libdialog i Boolean ColorDisplay; /* Are we on a color display? */ Boolean OnVTY; /* Are we on a VTY? */ Boolean Restarting; /* Are we restarting sysinstall? */ +Boolean have_volumes; /* Media has more than one volume. */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ int StatusLine; /* Where to stick our status messages */ +int low_volume; /* Lowest volume number */ +int high_volume; /* Highest volume number */ jmp_buf BailOut; /* Beam me up, scotty! The natives are pissed! */ Chunk *HomeChunk; Modified: stable/7/usr.sbin/sysinstall/index.c ============================================================================== --- stable/7/usr.sbin/sysinstall/index.c Fri Oct 24 19:36:28 2008 (r184231) +++ stable/7/usr.sbin/sysinstall/index.c Fri Oct 24 20:10:22 2008 (r184232) @@ -225,7 +225,17 @@ new_index(char *name, char *pathto, char tmp->deps = _strdup(deps); tmp->depc = 0; tmp->installed = package_installed(name); + tmp->vol_checked = 0; tmp->volume = volume; + if (volume != 0) { + have_volumes = TRUE; + if (low_volume == 0) + low_volume = volume; + else if (low_volume > volume) + low_volume = volume; + if (high_volume < volume) + high_volume = volume; + } return tmp; } @@ -682,9 +692,11 @@ recycle: } int -index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) +index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended, + int current_volume) { int status = DITEM_SUCCESS; + Boolean notyet = FALSE; PkgNodePtr tmp2; IndexEntryPtr id = who->data; WINDOW *w; @@ -699,7 +711,7 @@ index_extract(Device *dev, PkgNodePtr to * a certain faulty INDEX file. */ - if (id->installed == 1) + if (id->installed == 1 || (have_volumes && id->vol_checked == current_volume)) return DITEM_SUCCESS; w = savescr(); @@ -712,9 +724,13 @@ index_extract(Device *dev, PkgNodePtr to if ((cp2 = index(cp, ' ')) != NULL) *cp2 = '\0'; if ((tmp2 = index_search(top, cp, NULL)) != NULL) { - status = index_extract(dev, top, tmp2, TRUE); + status = index_extract(dev, top, tmp2, TRUE, current_volume); if (DITEM_STATUS(status) != DITEM_SUCCESS) { - if (variable_get(VAR_NO_CONFIRM)) + /* package probably on a future disc volume */ + if (status & DITEM_CONTINUE) { + status = DITEM_SUCCESS; + notyet = TRUE; + } else if (variable_get(VAR_NO_CONFIRM)) msgNotify("Loading of dependent package %s failed", cp); else msgConfirm("Loading of dependent package %s failed", cp); @@ -732,10 +748,38 @@ index_extract(Device *dev, PkgNodePtr to cp = NULL; } } - /* Done with the deps? Load the real m'coy */ + + /* + * If iterating through disc volumes one at a time indicate failure if + * dependency install failed due to package being on a higher volume + * numbered disc, but that we should continue anyway. Note that this + * package has already been processed for this disc volume so we don't + * need to do it again. + */ + + if (notyet) { + restorescr(w); + id->vol_checked = current_volume; + return DITEM_FAILURE | DITEM_CONTINUE; + } + + /* + * Done with the deps? Try to load the real m'coy. If iterating + * through a multi-volume disc set fail the install if the package + * is on a higher numbered volume to cut down on disc switches the + * user needs to do, but indicate caller should continue processing + * despite error return. Note this package was processed for the + * current disc being checked. + */ + if (DITEM_STATUS(status) == DITEM_SUCCESS) { /* Prompt user if the package is not available on the current volume. */ if(mediaDevice->type == DEVICE_TYPE_CDROM) { + if (current_volume != 0 && id->volume > current_volume) { + restorescr(w); + id->vol_checked = current_volume; + return DITEM_FAILURE | DITEM_CONTINUE; + } while (id->volume != dev->volume) { if (!msgYesNo("This is disc #%d. Package %s is on disc #%d\n" "Would you like to switch discs now?\n", dev->volume, @@ -801,6 +845,8 @@ index_initialize(char *path) if (!index_initted) { w = savescr(); dialog_clear_norefresh(); + have_volumes = FALSE; + low_volume = high_volume = 0; /* Got any media? */ if (!mediaVerify()) { Modified: stable/7/usr.sbin/sysinstall/package.c ============================================================================== --- stable/7/usr.sbin/sysinstall/package.c Fri Oct 24 19:36:28 2008 (r184231) +++ stable/7/usr.sbin/sysinstall/package.c Fri Oct 24 20:10:22 2008 (r184232) @@ -55,7 +55,7 @@ int package_add(char *name) { PkgNodePtr tmp; - int i; + int i, current, low, high; if (!mediaVerify()) return DITEM_FAILURE; @@ -68,9 +68,16 @@ package_add(char *name) return i; tmp = index_search(&Top, name, &tmp); - if (tmp) - return index_extract(mediaDevice, &Top, tmp, FALSE); - else { + if (tmp) { + if (have_volumes) { + low = low_volume; + high = high_volume; + } else + low = high = 0; + for (current = low; current <= high; current++) + i = index_extract(mediaDevice, &Top, tmp, FALSE, current); + return i; + } else { msgConfirm("Sorry, package %s was not found in the INDEX.", name); return DITEM_FAILURE; } Modified: stable/7/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- stable/7/usr.sbin/sysinstall/sysinstall.h Fri Oct 24 19:36:28 2008 (r184231) +++ stable/7/usr.sbin/sysinstall/sysinstall.h Fri Oct 24 20:10:22 2008 (r184232) @@ -386,6 +386,7 @@ typedef struct _indexEntry { /* A single char *deps; /* packages this depends on */ int depc; /* how many depend on me */ int installed; /* indicates if it is installed */ + int vol_checked; /* disc volume last checked for */ char *maintainer; /* maintainer */ unsigned int volume; /* Volume of package */ } IndexEntry; @@ -418,6 +419,7 @@ extern Boolean RunningAsInit; /* Are w extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ +extern Boolean have_volumes; /* Media has multiple volumes */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ @@ -481,6 +483,8 @@ extern int FixItMode; extern const char * StartName; /* Which name we were started as */ extern const char * ProgName; /* Program's proper name */ extern int NCpus; /* # cpus on machine */ +extern int low_volume; /* Lowest volume number */ +extern int high_volume; /* Highest volume number */ /* Important chunks. */ extern Chunk *HomeChunk; @@ -672,7 +676,7 @@ void index_init(PkgNodePtr top, PkgNode void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); -int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); +int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended, int current_volume); int index_initialize(char *path); PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 25 01:21:29 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AAFE106566C; Sat, 25 Oct 2008 01:21:29 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91E38FC08; Sat, 25 Oct 2008 01:21:28 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P1LSdh003860; Sat, 25 Oct 2008 01:21:28 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P1LSRR003855; Sat, 25 Oct 2008 01:21:28 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810250121.m9P1LSRR003855@svn.freebsd.org> From: Ken Smith Date: Sat, 25 Oct 2008 01:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184237 - stable/6/usr.sbin/sysinstall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 01:21:29 -0000 Author: kensmith Date: Sat Oct 25 01:21:28 2008 New Revision: 184237 URL: http://svn.freebsd.org/changeset/base/184237 Log: MFS r184232: > MFC r183921 and r184180 > When we notice the INDEX had volume numbers (so the media the packages > are coming from has multiple volumes) walk through the dependency tree > for the packages selected by the user once for each volume, only > installing packages on the current volume. If we can't install the > package because its on a higher volume just note that we have looked > at it during the pass for this volume to cut down on time spent checking > dependencies. This stops the excessive disc swapping that users have > complained (a lot...) about. Approved by: re (kib) Modified: stable/6/usr.sbin/sysinstall/ (props changed) stable/6/usr.sbin/sysinstall/config.c stable/6/usr.sbin/sysinstall/globals.c stable/6/usr.sbin/sysinstall/index.c stable/6/usr.sbin/sysinstall/package.c stable/6/usr.sbin/sysinstall/sysinstall.h Modified: stable/6/usr.sbin/sysinstall/config.c ============================================================================== --- stable/6/usr.sbin/sysinstall/config.c Sat Oct 25 00:28:24 2008 (r184236) +++ stable/6/usr.sbin/sysinstall/config.c Sat Oct 25 01:21:28 2008 (r184237) @@ -785,6 +785,7 @@ configPackages(dialogMenuItem *self) while (1) { int ret, pos, scroll; + int current, low, high; /* Bring up the packages menu */ pos = scroll = 0; @@ -799,8 +800,14 @@ configPackages(dialogMenuItem *self) else if (DITEM_STATUS(ret) != DITEM_FAILURE) { dialog_clear(); restoreflag = 1; - for (tmp = Plist.kids; tmp && tmp->name; tmp = tmp->next) - (void)index_extract(mediaDevice, &Top, tmp, FALSE); + if (have_volumes) { + low = low_volume; + high = high_volume; + } else + low = high = 0; + for (current = low; current <= high; current++) + for (tmp = Plist.kids; tmp && tmp->name; tmp = tmp->next) + (void)index_extract(mediaDevice, &Top, tmp, FALSE, current); break; } } Modified: stable/6/usr.sbin/sysinstall/globals.c ============================================================================== --- stable/6/usr.sbin/sysinstall/globals.c Sat Oct 25 00:28:24 2008 (r184236) +++ stable/6/usr.sbin/sysinstall/globals.c Sat Oct 25 01:21:28 2008 (r184237) @@ -48,10 +48,13 @@ Boolean DialogActive; /* Is libdialog i Boolean ColorDisplay; /* Are we on a color display? */ Boolean OnVTY; /* Are we on a VTY? */ Boolean Restarting; /* Are we restarting sysinstall? */ +Boolean have_volumes; /* Media has more than one volume. */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ int StatusLine; /* Where to stick our status messages */ +int low_volume; /* Lowest volume number */ +int high_volume; /* Highest volume number */ jmp_buf BailOut; /* Beam me up, scotty! The natives are pissed! */ Chunk *HomeChunk; Modified: stable/6/usr.sbin/sysinstall/index.c ============================================================================== --- stable/6/usr.sbin/sysinstall/index.c Sat Oct 25 00:28:24 2008 (r184236) +++ stable/6/usr.sbin/sysinstall/index.c Sat Oct 25 01:21:28 2008 (r184237) @@ -225,7 +225,17 @@ new_index(char *name, char *pathto, char tmp->deps = _strdup(deps); tmp->depc = 0; tmp->installed = package_installed(name); + tmp->vol_checked = 0; tmp->volume = volume; + if (volume != 0) { + have_volumes = TRUE; + if (low_volume == 0) + low_volume = volume; + else if (low_volume > volume) + low_volume = volume; + if (high_volume < volume) + high_volume = volume; + } return tmp; } @@ -681,9 +691,11 @@ recycle: } int -index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) +index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended, + int current_volume) { int status = DITEM_SUCCESS; + Boolean notyet = FALSE; PkgNodePtr tmp2; IndexEntryPtr id = who->data; WINDOW *w; @@ -698,7 +710,7 @@ index_extract(Device *dev, PkgNodePtr to * a certain faulty INDEX file. */ - if (id->installed == 1) + if (id->installed == 1 || (have_volumes && id->vol_checked == current_volume)) return DITEM_SUCCESS; w = savescr(); @@ -711,9 +723,13 @@ index_extract(Device *dev, PkgNodePtr to if ((cp2 = index(cp, ' ')) != NULL) *cp2 = '\0'; if ((tmp2 = index_search(top, cp, NULL)) != NULL) { - status = index_extract(dev, top, tmp2, TRUE); + status = index_extract(dev, top, tmp2, TRUE, current_volume); if (DITEM_STATUS(status) != DITEM_SUCCESS) { - if (variable_get(VAR_NO_CONFIRM)) + /* package probably on a future disc volume */ + if (status & DITEM_CONTINUE) { + status = DITEM_SUCCESS; + notyet = TRUE; + } else if (variable_get(VAR_NO_CONFIRM)) msgNotify("Loading of dependent package %s failed", cp); else msgConfirm("Loading of dependent package %s failed", cp); @@ -731,10 +747,38 @@ index_extract(Device *dev, PkgNodePtr to cp = NULL; } } - /* Done with the deps? Load the real m'coy */ + + /* + * If iterating through disc volumes one at a time indicate failure if + * dependency install failed due to package being on a higher volume + * numbered disc, but that we should continue anyway. Note that this + * package has already been processed for this disc volume so we don't + * need to do it again. + */ + + if (notyet) { + restorescr(w); + id->vol_checked = current_volume; + return DITEM_FAILURE | DITEM_CONTINUE; + } + + /* + * Done with the deps? Try to load the real m'coy. If iterating + * through a multi-volume disc set fail the install if the package + * is on a higher numbered volume to cut down on disc switches the + * user needs to do, but indicate caller should continue processing + * despite error return. Note this package was processed for the + * current disc being checked. + */ + if (DITEM_STATUS(status) == DITEM_SUCCESS) { /* Prompt user if the package is not available on the current volume. */ if(mediaDevice->type == DEVICE_TYPE_CDROM) { + if (current_volume != 0 && id->volume > current_volume) { + restorescr(w); + id->vol_checked = current_volume; + return DITEM_FAILURE | DITEM_CONTINUE; + } while (id->volume != dev->volume) { if (!msgYesNo("This is disc #%d. Package %s is on disc #%d\n" "Would you like to switch discs now?\n", dev->volume, @@ -800,6 +844,8 @@ index_initialize(char *path) if (!index_initted) { w = savescr(); dialog_clear_norefresh(); + have_volumes = FALSE; + low_volume = high_volume = 0; /* Got any media? */ if (!mediaVerify()) { Modified: stable/6/usr.sbin/sysinstall/package.c ============================================================================== --- stable/6/usr.sbin/sysinstall/package.c Sat Oct 25 00:28:24 2008 (r184236) +++ stable/6/usr.sbin/sysinstall/package.c Sat Oct 25 01:21:28 2008 (r184237) @@ -55,7 +55,7 @@ int package_add(char *name) { PkgNodePtr tmp; - int i; + int i, current, low, high; if (!mediaVerify()) return DITEM_FAILURE; @@ -68,9 +68,16 @@ package_add(char *name) return i; tmp = index_search(&Top, name, &tmp); - if (tmp) - return index_extract(mediaDevice, &Top, tmp, FALSE); - else { + if (tmp) { + if (have_volumes) { + low = low_volume; + high = high_volume; + } else + low = high = 0; + for (current = low; current <= high; current++) + i = index_extract(mediaDevice, &Top, tmp, FALSE, current); + return i; + } else { msgConfirm("Sorry, package %s was not found in the INDEX.", name); return DITEM_FAILURE; } Modified: stable/6/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- stable/6/usr.sbin/sysinstall/sysinstall.h Sat Oct 25 00:28:24 2008 (r184236) +++ stable/6/usr.sbin/sysinstall/sysinstall.h Sat Oct 25 01:21:28 2008 (r184237) @@ -383,6 +383,7 @@ typedef struct _indexEntry { /* A single char *deps; /* packages this depends on */ int depc; /* how many depend on me */ int installed; /* indicates if it is installed */ + int vol_checked; /* disc volume last checked for */ char *maintainer; /* maintainer */ unsigned int volume; /* Volume of package */ } IndexEntry; @@ -415,6 +416,7 @@ extern Boolean RunningAsInit; /* Are w extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ +extern Boolean have_volumes; /* Media has multiple volumes */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ @@ -477,6 +479,8 @@ extern DMenu MenuFixit; /* Fixit flopp extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */ extern const char * StartName; /* Which name we were started as */ extern int NCpus; /* # cpus on machine */ +extern int low_volume; /* Lowest volume number */ +extern int high_volume; /* Highest volume number */ /* Important chunks. */ extern Chunk *HomeChunk; @@ -668,7 +672,7 @@ void index_init(PkgNodePtr top, PkgNode void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); -int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); +int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended, int current_volume); int index_initialize(char *path); PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 25 11:37:43 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45211106566B; Sat, 25 Oct 2008 11:37:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32BC68FC14; Sat, 25 Oct 2008 11:37:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PBbhjh031412; Sat, 25 Oct 2008 11:37:43 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PBbhnI031411; Sat, 25 Oct 2008 11:37:43 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810251137.m9PBbhnI031411@svn.freebsd.org> From: David Xu Date: Sat, 25 Oct 2008 11:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184259 - in stable/7/sys: . kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 11:37:43 -0000 Author: davidxu Date: Sat Oct 25 11:37:42 2008 New Revision: 184259 URL: http://svn.freebsd.org/changeset/base/184259 Log: Merge revision 184067 from head to stable/7: In realtimer_delete(), clear timer's value and interval to tell realtimer_expire() to not rearm the timer, otherwise there is a chance that a callout will be left there and be tiggered in future unexpectly. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_time.c Modified: stable/7/sys/kern/kern_time.c ============================================================================== --- stable/7/sys/kern/kern_time.c Sat Oct 25 10:55:49 2008 (r184258) +++ stable/7/sys/kern/kern_time.c Sat Oct 25 11:37:42 2008 (r184259) @@ -1225,6 +1225,12 @@ realtimer_delete(struct itimer *it) { mtx_assert(&it->it_mtx, MA_OWNED); + /* + * clear timer's value and interval to tell realtimer_expire + * to not rearm the timer. + */ + timespecclear(&it->it_time.it_value); + timespecclear(&it->it_time.it_interval); ITIMER_UNLOCK(it); callout_drain(&it->it_callout); ITIMER_LOCK(it); @@ -1374,9 +1380,11 @@ realtimer_expire(void *arg) callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, it); } + itimer_enter(it); ITIMER_UNLOCK(it); itimer_fire(it); ITIMER_LOCK(it); + itimer_leave(it); } else if (timespecisset(&it->it_time.it_value)) { ts = it->it_time.it_value; timespecsub(&ts, &cts); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 25 14:00:38 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C817106566B; Sat, 25 Oct 2008 14:00:38 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A8048FC1A; Sat, 25 Oct 2008 14:00:38 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PE0cwp033956; Sat, 25 Oct 2008 14:00:38 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PE0c3B033955; Sat, 25 Oct 2008 14:00:38 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200810251400.m9PE0c3B033955@svn.freebsd.org> From: Doug Rabson Date: Sat, 25 Oct 2008 14:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184260 - in stable/7/sys: . kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 14:00:38 -0000 Author: dfr Date: Sat Oct 25 14:00:37 2008 New Revision: 184260 URL: http://svn.freebsd.org/changeset/base/184260 Log: MFC: r184227 - don't use *statep without holding the vnode interlock This change is being merged earlier than originally planned at the request of the release engineers. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_lockf.c Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Sat Oct 25 11:37:42 2008 (r184259) +++ stable/7/sys/kern/kern_lockf.c Sat Oct 25 14:00:37 2008 (r184260) @@ -467,12 +467,15 @@ lf_advlockasync(struct vop_advlockasync_ /* * Avoid the common case of unlocking when inode has no locks. */ - if ((*statep) == NULL || LIST_EMPTY(&(*statep)->ls_active)) { + VI_LOCK(vp); + if ((*statep) == NULL) { if (ap->a_op != F_SETLK) { fl->l_type = F_UNLCK; + VI_UNLOCK(vp); return (0); } } + VI_UNLOCK(vp); /* * Map our arguments to an existing lock owner or create one From owner-svn-src-stable@FreeBSD.ORG Sat Oct 25 14:01:08 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCD8E10656A5; Sat, 25 Oct 2008 14:01:08 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAC798FC17; Sat, 25 Oct 2008 14:01:08 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PE183G034003; Sat, 25 Oct 2008 14:01:08 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PE18qX034002; Sat, 25 Oct 2008 14:01:08 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200810251401.m9PE18qX034002@svn.freebsd.org> From: Doug Rabson Date: Sat, 25 Oct 2008 14:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184261 - in stable/6/sys: . kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 14:01:08 -0000 Author: dfr Date: Sat Oct 25 14:01:08 2008 New Revision: 184261 URL: http://svn.freebsd.org/changeset/base/184261 Log: MFC: r184227 - don't use *statep without holding the vnode interlock This change is being merged earlier than originally planned at the request of the release engineers. Approved by: re (kib) Modified: stable/6/sys/ (props changed) stable/6/sys/kern/kern_lockf.c Modified: stable/6/sys/kern/kern_lockf.c ============================================================================== --- stable/6/sys/kern/kern_lockf.c Sat Oct 25 14:00:37 2008 (r184260) +++ stable/6/sys/kern/kern_lockf.c Sat Oct 25 14:01:08 2008 (r184261) @@ -467,12 +467,15 @@ lf_advlockasync(struct vop_advlockasync_ /* * Avoid the common case of unlocking when inode has no locks. */ - if ((*statep) == NULL || LIST_EMPTY(&(*statep)->ls_active)) { + VI_LOCK(vp); + if ((*statep) == NULL) { if (ap->a_op != F_SETLK) { fl->l_type = F_UNLCK; + VI_UNLOCK(vp); return (0); } } + VI_UNLOCK(vp); /* * Map our arguments to an existing lock owner or create one From owner-svn-src-stable@FreeBSD.ORG Sat Oct 25 21:42:43 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C970B1065680; Sat, 25 Oct 2008 21:42:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B41F08FC0C; Sat, 25 Oct 2008 21:42:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PLghLP054048; Sat, 25 Oct 2008 21:42:43 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PLghfx054036; Sat, 25 Oct 2008 21:42:43 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200810252142.m9PLghfx054036@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 25 Oct 2008 21:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184267 - in stable/7: share/man/man4 sys sys/conf sys/dev/ae sys/dev/mii sys/modules sys/modules/ae usr.sbin/sysinstall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 21:42:43 -0000 Author: stas Date: Sat Oct 25 21:42:43 2008 New Revision: 184267 URL: http://svn.freebsd.org/changeset/base/184267 Log: - MFC ae(4) Attansic FastEthernet controller driver. Approved by: re (kensmith), kib (mentor) Added: stable/7/share/man/man4/ae.4 - copied, changed from r183602, head/share/man/man4/ae.4 stable/7/sys/dev/ae/ - copied from r183567, head/sys/dev/ae/ stable/7/sys/modules/ae/ - copied from r183567, head/sys/modules/ae/ Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/Makefile stable/7/share/man/man4/vlan.4 stable/7/sys/ (props changed) stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/dev/ae/if_ae.c stable/7/sys/dev/mii/atphy.c stable/7/sys/dev/mii/miidevs stable/7/sys/modules/Makefile stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/devices.c Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/share/man/man4/Makefile Sat Oct 25 21:42:43 2008 (r184267) @@ -8,6 +8,7 @@ MAN= aac.4 \ acpi_video.4 \ adv.4 \ adw.4 \ + ae.4 \ age.4 \ agp.4 \ aha.4 \ Copied and modified: stable/7/share/man/man4/ae.4 (from r183602, head/share/man/man4/ae.4) ============================================================================== --- head/share/man/man4/ae.4 Sat Oct 4 14:21:54 2008 (r183602, copy source) +++ stable/7/share/man/man4/ae.4 Sat Oct 25 21:42:43 2008 (r184267) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd October 04, 2008 +.Dd October 4, 2008 .Dt AE 4 .Os .Sh NAME .Nm ae -.Nd Attansic/Atheros L2 FastEthernet controller driver +.Nd "Attansic/Atheros L2 FastEthernet controller driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -84,7 +84,8 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver is known to support the following hardware: +driver supports Attansic/Atheros L2 PCIe FastEthernet controllers, and +is known to support the following hardware: .Pp .Bl -bullet -compact .It @@ -149,4 +150,4 @@ driver and this manual page was written .An Stanislav Sedov .Aq stas@FreeBSD.org . It first appeared in -.Fx 8.0 . +.Fx 7.1 . Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/share/man/man4/vlan.4 Sat Oct 25 21:42:43 2008 (r184267) @@ -122,6 +122,7 @@ The whole issue is very specific to a pa .Pp By now, the list of physical interfaces able of full VLAN processing in the hardware is limited to the following devices: +.Xr ae 4 , .Xr age 4 , .Xr bce 4 , .Xr bge 4 , Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/sys/conf/NOTES Sat Oct 25 21:42:43 2008 (r184267) @@ -1716,6 +1716,8 @@ device puc # individual driver. device miibus +# ae: Support for gigabit ethernet adapters based on the Attansic/Atheros +# L2 PCI-Express FastEthernet controllers. # an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA, # PCI and ISA varieties. # awi: Support for IEEE 802.11 PC Card devices using the AMD Am79C930 and @@ -1864,6 +1866,7 @@ device wi device xe # PCI Ethernet NICs that use the common MII bus controller code. +device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/sys/conf/files Sat Oct 25 21:42:43 2008 (r184267) @@ -426,6 +426,7 @@ dev/advansys/adw_pci.c optional adw pci dev/advansys/adwcam.c optional adw dev/advansys/adwlib.c optional adw dev/advansys/adwmcode.c optional adw +dev/ae/if_ae.c optional ae pci dev/age/if_age.c optional age pci dev/aha/aha.c optional aha dev/aha/aha_isa.c optional aha isa Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Oct 3 10:31:31 2008 (r183567) +++ stable/7/sys/dev/ae/if_ae.c Sat Oct 25 21:42:43 2008 (r184267) @@ -380,10 +380,8 @@ ae_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { - ifp->if_capabilities |= IFCAP_WOL_MAGIC; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) sc->flags |= AE_FLAG_PMG; - } ifp->if_capenable = ifp->if_capabilities; /* @@ -1334,7 +1332,6 @@ ae_pm_init(ae_softc_t *sc) struct ifnet *ifp; uint32_t val; uint16_t pmstat; - struct mii_data *mii; int pmc; AE_LOCK_ASSERT(sc); @@ -1346,40 +1343,7 @@ ae_pm_init(ae_softc_t *sc) return; } - /* - * Configure WOL if enabled. - */ - if ((ifp->if_capenable & IFCAP_WOL) != 0) { - mii = device_get_softc(sc->miibus); - mii_pollstat(mii); - if ((mii->mii_media_status & IFM_AVALID) != 0 && - (mii->mii_media_status & IFM_ACTIVE) != 0) { - AE_WRITE_4(sc, AE_WOL_REG, AE_WOL_MAGIC | \ - AE_WOL_MAGIC_PME); - - /* - * Configure MAC. - */ - val = AE_MAC_RX_EN | AE_MAC_CLK_PHY | \ - AE_MAC_TX_CRC_EN | AE_MAC_TX_AUTOPAD | \ - ((AE_HALFBUF_DEFAULT << AE_HALFBUF_SHIFT) & \ - AE_HALFBUF_MASK) | \ - ((AE_MAC_PREAMBLE_DEFAULT << \ - AE_MAC_PREAMBLE_SHIFT) & AE_MAC_PREAMBLE_MASK) | \ - AE_MAC_BCAST_EN | AE_MAC_MCAST_EN; - if ((IFM_OPTIONS(mii->mii_media_active) & \ - IFM_FDX) != 0) - val |= AE_MAC_FULL_DUPLEX; - AE_WRITE_4(sc, AE_MAC_REG, val); - - } else { /* No link. */ - AE_WRITE_4(sc, AE_WOL_REG, AE_WOL_LNKCHG | \ - AE_WOL_LNKCHG_PME); - AE_WRITE_4(sc, AE_MAC_REG, 0); - } - } else { - ae_powersave_enable(sc); - } + ae_powersave_enable(sc); /* * PCIE hacks. Magic numbers. @@ -1397,8 +1361,6 @@ ae_pm_init(ae_softc_t *sc) pci_find_extcap(sc->dev, PCIY_PMG, &pmc); pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); - if ((ifp->if_capenable & IFCAP_WOL) != 0) - pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } Modified: stable/7/sys/dev/mii/atphy.c ============================================================================== --- stable/7/sys/dev/mii/atphy.c Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/sys/dev/mii/atphy.c Sat Oct 25 21:42:43 2008 (r184267) @@ -86,6 +86,7 @@ static int atphy_auto(struct mii_softc * static const struct mii_phydesc atphys[] = { MII_PHY_DESC(ATHEROS, F1), + MII_PHY_DESC(ATHEROS, F2), MII_PHY_END }; Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/sys/dev/mii/miidevs Sat Oct 25 21:42:43 2008 (r184267) @@ -121,6 +121,7 @@ model xxAMD 79C873 0x0000 Am79C873/DM91 /* Atheros Communications/Attansic PHYs. */ model ATHEROS F1 0x0001 Atheros F1 10/100/1000 PHY +model ATHEROS F2 0x0002 Atheros F2 10/100 PHY /* Broadcom Corp. PHYs. */ model BROADCOM 3C905B 0x0012 3c905B 10/100 internal PHY Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/sys/modules/Makefile Sat Oct 25 21:42:43 2008 (r184267) @@ -8,6 +8,7 @@ SUBDIR= ${_3dfx} \ accf_data \ accf_http \ ${_acpi} \ + ae \ age \ ${_agp} \ aha \ Modified: stable/7/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/7/usr.sbin/sysinstall/devices.c Sat Oct 25 20:42:10 2008 (r184266) +++ stable/7/usr.sbin/sysinstall/devices.c Sat Oct 25 21:42:43 2008 (r184267) @@ -93,6 +93,7 @@ static struct _devname { DISK("mfid%d", "LSI MegaRAID SAS array", 4), FLOPPY("fd%d", "floppy drive unit A", 4), SERIAL("cuad%d", "%s on device %s (COM%d)", 16), + NETWORK("ae", "Attansic/Atheros L2 FastEthernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), NETWORK("an", "Aironet 4500/4800 802.11 wireless adapter"), NETWORK("ath", "Atheros IEEE 802.11 wireless adapter"),