svn commit: r225163 - head/sys/net

2011-08-24 Thread Qing Li
Author: qingli
Date: Thu Aug 25 04:31:20 2011
New Revision: 225163
URL: http://svn.freebsd.org/changeset/base/225163

Log:
  When the RADIX_MPATH kernel option is enabled, the RADIX_MPATH code tries
  to find the first route node of an ECMP chain before executing the route
  command. If the system has a default route, and the specific route argument
  to the command does not exist in the routing table, then the default route
  would be reached. The current code does not verify the reached node matches
  the given route argument, therefore erroneous removed the entry. This patch
  fixes that bug.
  
  Approved by:  re
  MFC after:3 days

Modified:
  head/sys/net/radix_mpath.c

Modified: head/sys/net/radix_mpath.c
==
--- head/sys/net/radix_mpath.c  Thu Aug 25 01:47:26 2011(r225162)
+++ head/sys/net/radix_mpath.c  Thu Aug 25 04:31:20 2011(r225163)
@@ -96,10 +96,7 @@ rt_mpath_matchgate(struct rtentry *rt, s
 {
struct radix_node *rn;
 
-   if (!rn_mpath_next((struct radix_node *)rt))
-   return rt;
-
-   if (!gate)
+   if (!gate || !rt->rt_gateway)
return NULL;
 
/* beyond here, we use rn as the master copy */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r225153 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-08-24 Thread Pawel Jakub Dawidek
Author: pjd
Date: Wed Aug 24 22:07:38 2011
New Revision: 225153
URL: http://svn.freebsd.org/changeset/base/225153

Log:
  We need to unlock and destroy vnode attached to znode which we are freeing.
  
  Reviewed by:  kib
  Approved by:  re (bz)
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 
24 20:05:13 2011(r225152)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 
24 22:07:38 2011(r225153)
@@ -627,6 +627,18 @@ zfs_znode_dmu_fini(znode_t *zp)
zp->z_sa_hdl = NULL;
 }
 
+static void
+zfs_vnode_forget(vnode_t *vp)
+{
+
+   VOP_UNLOCK(vp, 0);
+   VI_LOCK(vp);
+   vp->v_usecount--;
+   vp->v_iflag |= VI_DOOMED;
+   vp->v_data = NULL;
+   vdropl(vp);
+}
+
 /*
  * Construct a new znode/vnode and intialize.
  *
@@ -688,6 +700,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
if (sa_bulk_lookup(zp->z_sa_hdl, bulk, count) != 0 || zp->z_gen == 0) {
if (hdl == NULL)
sa_handle_destroy(zp->z_sa_hdl);
+   zfs_vnode_forget(vp);
+   zp->z_vnode = NULL;
kmem_cache_free(znode_cache, zp);
return (NULL);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2011-08-24 Thread Konstantin Belousov
Author: kib
Date: Wed Aug 24 20:05:13 2011
New Revision: 225152
URL: http://svn.freebsd.org/changeset/base/225152

Log:
  Rtld links with the specially built pic static libc library to get some
  C runtime services, like printf(). Unfortunately, the multithread-safeness
  measures in the libc do not work in rtld environment.
  
  Rip the kernel printf() implementation and use it in the rtld instead of
  libc version. This printf does not require any shared global data and thus
  is mt-safe. Systematically use rtld_printf() and related functions, remove
  the calls to err(3).
  
  Note that stdio is still pulled from libc due to libmap implementaion using
  fopen(). This is safe but unoptimal, and can be changed later.
  
  Reported and tested by:   pgj
  Diagnosed and reviewed by:kan (previous version)
  Approved by:  re (bz)

Added:
  head/libexec/rtld-elf/rtld_printf.c   (contents, props changed)
  head/libexec/rtld-elf/rtld_printf.h   (contents, props changed)
Modified:
  head/libexec/rtld-elf/Makefile
  head/libexec/rtld-elf/debug.c
  head/libexec/rtld-elf/malloc.c
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h
  head/libexec/rtld-elf/rtld_lock.c
  head/libexec/rtld-elf/xmalloc.c

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Wed Aug 24 19:27:49 2011
(r225151)
+++ head/libexec/rtld-elf/Makefile  Wed Aug 24 20:05:13 2011
(r225152)
@@ -5,7 +5,7 @@ MK_SSP= no
 
 PROG?= ld-elf.so.1
 SRCS=  rtld_start.S \
-   reloc.c rtld.c rtld_lock.c map_object.c \
+   reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \
malloc.c xmalloc.c debug.c libmap.c
 MAN=   rtld.1
 CSTD?= gnu99

Modified: head/libexec/rtld-elf/debug.c
==
--- head/libexec/rtld-elf/debug.c   Wed Aug 24 19:27:49 2011
(r225151)
+++ head/libexec/rtld-elf/debug.c   Wed Aug 24 20:05:13 2011
(r225152)
@@ -34,6 +34,7 @@
 
 #include "debug.h"
 #include "rtld.h"
+#include "rtld_printf.h"
 
 static const char rel_header[] =
 " symbol name   r_info r_offset st_value st_sizeaddress
value\n"
@@ -49,9 +50,8 @@ debug_printf(const char *format, ...)
va_list ap;
va_start(ap, format);
 
-   fflush(stdout);
-   vfprintf(stderr, format, ap);
-   putc('\n', stderr);
+   rtld_vfdprintf(STDERR_FILENO, format, ap);
+   rtld_fdputchar(STDERR_FILENO, '\n');
 
va_end(ap);
 }
@@ -71,28 +71,28 @@ void
 dump_obj_relocations (Obj_Entry *obj)
 {
 
-printf("Object \"%s\", relocbase %p\n", obj->path, obj->relocbase);
+rtld_printf("Object \"%s\", relocbase %p\n", obj->path, obj->relocbase);
 
 if (obj->relsize) {
-printf("Non-PLT Relocations: %ld\n",
+rtld_printf("Non-PLT Relocations: %ld\n",
 (obj->relsize / sizeof(Elf_Rel)));
 dump_Elf_Rel(obj, obj->rel, obj->relsize);
 }
 
 if (obj->relasize) {
-printf("Non-PLT Relocations with Addend: %ld\n",
+rtld_printf("Non-PLT Relocations with Addend: %ld\n",
 (obj->relasize / sizeof(Elf_Rela)));
 dump_Elf_Rela(obj, obj->rela, obj->relasize);
 }
 
 if (obj->pltrelsize) {
-printf("PLT Relocations: %ld\n",
+rtld_printf("PLT Relocations: %ld\n",
 (obj->pltrelsize / sizeof(Elf_Rel)));
 dump_Elf_Rel(obj, obj->pltrel, obj->pltrelsize);
 }
 
 if (obj->pltrelasize) {
-printf("PLT Relocations with Addend: %ld\n",
+rtld_printf("PLT Relocations with Addend: %ld\n",
 (obj->pltrelasize / sizeof(Elf_Rela)));
 dump_Elf_Rela(obj, obj->pltrela, obj->pltrelasize);
 }
@@ -106,12 +106,12 @@ dump_Elf_Rel (Obj_Entry *obj, const Elf_
 const Elf_Sym *sym;
 Elf_Addr *dstaddr;
 
-printf("%s", rel_header);
+rtld_putstr(rel_header);
 rellim = (const Elf_Rel *)((const char *)rel0 + relsize);
 for (rel = rel0; rel < rellim; rel++) {
dstaddr = (Elf_Addr *)(obj->relocbase + rel->r_offset);
 sym = obj->symtab + ELF_R_SYM(rel->r_info);
-printf(rel_format,
+rtld_printf(rel_format,
obj->strtab + sym->st_name,
(u_long)rel->r_info, (u_long)rel->r_offset,
(u_long)sym->st_value, (int)sym->st_size,
@@ -128,12 +128,12 @@ dump_Elf_Rela (Obj_Entry *obj, const Elf
 const Elf_Sym *sym;
 Elf_Addr *dstaddr;
 
-printf("%s", rel_header);
+rtld_putstr(rel_header);
 relalim = (const Elf_Rela *)((const char *)rela0 + relasize);
 for (rela = rela0; rela < relalim; rela++) {
dstaddr = (Elf_Addr *)(obj->relocbase + rela->r_offset);
 sym = obj->symtab + ELF_R_SYM(rela->r_info);
-printf(rel_format,
+rtld_printf(rel_format,
obj->strtab + sym->s

svn commit: r225145 - head/sys/dev/ath

2011-08-24 Thread Adrian Chadd
Author: adrian
Date: Wed Aug 24 14:11:00 2011
New Revision: 225145
URL: http://svn.freebsd.org/changeset/base/225145

Log:
  Fix a missing initialisation of bt_flags when setting up the TDMA beacon.
  
  The AR5212 HAL didn't check this field; timers are enabled a different
  way.
  
  The AR5416 HAL however did, and since this field was uninitialised, it had
  whatever was on the stack at the time. This lead to "unpredictable"
  behaviour.
  
  This allows TDMA to work on the AR5416 and later chipsets.
  
  Thanks to:parad...@gmail.com
  Approved by:  re (kib, blanket)

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Wed Aug 24 14:09:32 2011(r225144)
+++ head/sys/dev/ath/if_ath.c   Wed Aug 24 14:11:00 2011(r225145)
@@ -5485,6 +5485,8 @@ ath_tdma_settimers(struct ath_softc *sc,
bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep;
bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep;
bt.bt_nextatim = nexttbtt+1;
+   /* Enables TBTT, DBA, SWBA timers by default */
+   bt.bt_flags = 0;
ath_hal_beaconsettimers(ah, &bt);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r225142 - head

2011-08-24 Thread Glen Barber
Author: gjb (doc committer)
Date: Wed Aug 24 12:18:29 2011
New Revision: 225142
URL: http://svn.freebsd.org/changeset/base/225142

Log:
  Reword sentence noting UPDATING entries prior to October 2007 are
  only available in older FreeBSD releases.
  
  PR:   159220
  Submitted by: arundel
  Patch by: Benjamin Kaduk (kaduk % mit ! edu)
  OK'd by:  imp (via -doc@)
  MFC after:1 week
  Approved by:  re (kib)

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Aug 24 09:54:21 2011(r225141)
+++ head/UPDATING   Wed Aug 24 12:18:29 2011(r225142)
@@ -1456,9 +1456,10 @@ COMMON ITEMS:
 FORMAT:
 
 This file contains a list, in reverse chronological order, of major
-breakages in tracking -current.  Not all things will be listed here,
-and it only starts on October 16, 2004.  Updating files can found in
-previous releases if your system is older than this.
+breakages in tracking -current.  It is not guaranteed to be a complete
+list of such breakages, and only contains entries since October 10, 2007.
+If you need to see UPDATING entries from before that date, you will need
+to fetch an UPDATING file from an older FreeBSD release.
 
 Copyright information:
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r222520 - head/sys/cam/ata

2011-08-24 Thread Slawa Olhovchenkov
On Tue, May 31, 2011 at 09:22:52AM +, Alexander Motin wrote:

> Author: mav
> Date: Tue May 31 09:22:52 2011
> New Revision: 222520
> URL: http://svn.freebsd.org/changeset/base/222520
> 
> Log:
>   Add quirks to hint 4K physical sector (Advanced Format) for ATA disks not
>   reporting it properly (none? of known disks now).
>   
>   Hitachi and WDC AF disks seem could be identified more or less formally.
>   For Seagate and Samsung enumerate some found models/series.
>   For other disks it can be forced with kern.cam.ada.X.quirks=1 tunable.

May be right time to introduce new module, 'quirks'?
For dynamic loading quirk tables for any drivers (ata, usb, umass etc.)?

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


svn commit: r225140 - head/sys/dev/ahci

2011-08-24 Thread Alexander Motin
Author: mav
Date: Wed Aug 24 09:08:07 2011
New Revision: 225140
URL: http://svn.freebsd.org/changeset/base/225140

Log:
  Add ID for ASMedia ASM1061 2-port PCIe 2.0 x1 6Gb/s SATA controller.
  
  Approved by:  re (blackend)
  MFC after:1 week

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cWed Aug 24 08:53:33 2011(r225139)
+++ head/sys/dev/ahci/ahci.cWed Aug 24 09:08:07 2011(r225140)
@@ -128,6 +128,7 @@ static struct {
{0x43931002, 0x00, "ATI IXP700",0},
{0x43941002, 0x00, "ATI IXP800",0},
{0x43951002, 0x00, "ATI IXP800",0},
+   {0x06121b21, 0x00, "ASMedia ASM1061",   0},
{0x26528086, 0x00, "Intel ICH6",AHCI_Q_NOFORCE},
{0x26538086, 0x00, "Intel ICH6M",   AHCI_Q_NOFORCE},
{0x26818086, 0x00, "Intel ESB2",0},
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r225139 - head/sys/net80211

2011-08-24 Thread Adrian Chadd
Author: adrian
Date: Wed Aug 24 08:53:33 2011
New Revision: 225139
URL: http://svn.freebsd.org/changeset/base/225139

Log:
  This patch fixes beacon frame sequence number generation. The code
  didn't set a sequence number; it didn't show up earlier because the
  hardware most people use for hostap (ie, AR5212 series stuff) sets the
  sequence numbers up in hardware. Later hardware (AR5416, etc) which
  can do 11n and aggregation require sequence numbers to be generated in
  software.
  
  Submitted by: parad...@gmail.com
  Approved by:  re (kib)

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cWed Aug 24 08:38:44 2011
(r225138)
+++ head/sys/net80211/ieee80211_output.cWed Aug 24 08:53:33 2011
(r225139)
@@ -2792,6 +2792,8 @@ ieee80211_beacon_update(struct ieee80211
struct ieee80211com *ic = ni->ni_ic;
int len_changed = 0;
uint16_t capinfo;
+   struct ieee80211_frame *wh;
+   ieee80211_seq seqno;
 
IEEE80211_LOCK(ic);
/*
@@ -2823,6 +2825,12 @@ ieee80211_beacon_update(struct ieee80211
return 1;   /* just assume length changed */
}
 
+   wh = mtod(m, struct ieee80211_frame *);
+   seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++;
+   *(uint16_t *)&wh->i_seq[0] =
+   htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+   M_SEQNO_SET(m, seqno);
+
/* XXX faster to recalculate entirely or just changes? */
capinfo = ieee80211_getcapinfo(vap, ni->ni_chan);
*bo->bo_caps = htole16(capinfo);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"