svn commit: r248783 - head/lib/libpmc

2013-03-27 Thread Bryan Venteicher
Author: bryanv
Date: Wed Mar 27 07:11:29 2013
New Revision: 248783
URL: http://svnweb.freebsd.org/changeset/base/248783

Log:
  Add missing space
  
  MFC after:3 days

Modified:
  head/lib/libpmc/pmc.sandybridgexeon.3

Modified: head/lib/libpmc/pmc.sandybridgexeon.3
==
--- head/lib/libpmc/pmc.sandybridgexeon.3   Wed Mar 27 03:38:58 2013
(r248782)
+++ head/lib/libpmc/pmc.sandybridgexeon.3   Wed Mar 27 07:11:29 2013
(r248783)
@@ -219,7 +219,7 @@ L1D.
 .It Li MISALIGN_MEM_REF.STORES
 .Pq Event 05H , Umask 02H
 Speculative cache-line split Store- address uops
-dispatchedto L1D.
+dispatched to L1D.
 .It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS
 .Pq Event 07H , Umask 01H
 False dependencies in MOB due to partial compare on
___
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: r248786 - head/sys/dev/sound/pci/hda

2013-03-27 Thread Alexander Motin
Author: mav
Date: Wed Mar 27 07:30:08 2013
New Revision: 248786
URL: http://svnweb.freebsd.org/changeset/base/248786

Log:
  Add Subsystem ID field to the quirk table.  Use it to identify Mac Pro 1,1,
  which requires OVREF to be set to get proper playback volume, but which has
  all zeroes in HDA controller subdevice IDs on PCI.
  
  MFC after:1 month
  Sponsored by:

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Mar 27 07:16:14 2013
(r248785)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Mar 27 07:30:08 2013
(r248786)
@@ -47,6 +47,7 @@ SND_DECLARE_FILE("$FreeBSD$");
 static const struct {
uint32_t model;
uint32_t id;
+   uint32_t subsystemid;
uint32_t set, unset;
uint32_t gpio;
 } hdac_quirks[] = {
@@ -55,77 +56,81 @@ static const struct {
 * on few codecs (especially ALC880) seems broken or
 * perhaps unsupported.
 */
-   { HDA_MATCH_ALL, HDA_MATCH_ALL,
+   { HDA_MATCH_ALL, HDA_MATCH_ALL, HDA_MATCH_ALL,
HDAA_QUIRK_FORCESTEREO | HDAA_QUIRK_IVREF, 0,
0 },
-   { ACER_ALL_SUBVENDOR, HDA_MATCH_ALL,
+   { ACER_ALL_SUBVENDOR, HDA_MATCH_ALL, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_G2K_SUBVENDOR, HDA_CODEC_ALC660,
+   { ASUS_G2K_SUBVENDOR, HDA_CODEC_ALC660, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_M5200_SUBVENDOR, HDA_CODEC_ALC880,
+   { ASUS_M5200_SUBVENDOR, HDA_CODEC_ALC880, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_A7M_SUBVENDOR, HDA_CODEC_ALC880,
+   { ASUS_A7M_SUBVENDOR, HDA_CODEC_ALC880, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_A7T_SUBVENDOR, HDA_CODEC_ALC882,
+   { ASUS_A7T_SUBVENDOR, HDA_CODEC_ALC882, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_W2J_SUBVENDOR, HDA_CODEC_ALC882,
+   { ASUS_W2J_SUBVENDOR, HDA_CODEC_ALC882, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { ASUS_U5F_SUBVENDOR, HDA_CODEC_AD1986A,
+   { ASUS_U5F_SUBVENDOR, HDA_CODEC_AD1986A, HDA_MATCH_ALL,
HDAA_QUIRK_EAPDINV, 0,
0 },
-   { ASUS_A8X_SUBVENDOR, HDA_CODEC_AD1986A,
+   { ASUS_A8X_SUBVENDOR, HDA_CODEC_AD1986A, HDA_MATCH_ALL,
HDAA_QUIRK_EAPDINV, 0,
0 },
-   { ASUS_F3JC_SUBVENDOR, HDA_CODEC_ALC861,
+   { ASUS_F3JC_SUBVENDOR, HDA_CODEC_ALC861, HDA_MATCH_ALL,
HDAA_QUIRK_OVREF, 0,
0 },
-   { UNIWILL_9075_SUBVENDOR, HDA_CODEC_ALC861,
+   { UNIWILL_9075_SUBVENDOR, HDA_CODEC_ALC861, HDA_MATCH_ALL,
HDAA_QUIRK_OVREF, 0,
0 },
-   /*{ ASUS_M2N_SUBVENDOR, HDA_CODEC_AD1988,
+   /*{ ASUS_M2N_SUBVENDOR, HDA_CODEC_AD1988, HDA_MATCH_ALL,
HDAA_QUIRK_IVREF80, HDAA_QUIRK_IVREF50 | HDAA_QUIRK_IVREF100,
0 },*/
-   { MEDION_MD95257_SUBVENDOR, HDA_CODEC_ALC880,
+   { MEDION_MD95257_SUBVENDOR, HDA_CODEC_ALC880, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(1) },
-   { LENOVO_3KN100_SUBVENDOR, HDA_CODEC_AD1986A,
+   { LENOVO_3KN100_SUBVENDOR, HDA_CODEC_AD1986A, HDA_MATCH_ALL,
HDAA_QUIRK_EAPDINV | HDAA_QUIRK_SENSEINV, 0,
0 },
-   { SAMSUNG_Q1_SUBVENDOR, HDA_CODEC_AD1986A,
+   { SAMSUNG_Q1_SUBVENDOR, HDA_CODEC_AD1986A, HDA_MATCH_ALL,
HDAA_QUIRK_EAPDINV, 0,
0 },
-   { APPLE_MB3_SUBVENDOR, HDA_CODEC_ALC885,
+   { APPLE_MB3_SUBVENDOR, HDA_CODEC_ALC885, HDA_MATCH_ALL,
HDAA_QUIRK_OVREF50, 0,
HDAA_GPIO_SET(0) },
-   { APPLE_INTEL_MAC, HDA_CODEC_STAC9221,
+   { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) | HDAA_GPIO_SET(1) },
-   { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206,
+   { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) },
-   { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X,
+   { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { DELL_V1400_SUBVENDOR, HDA_CODEC_STAC9228X,
+   { DELL_V1400_SUBVENDOR, HDA_CODEC_STAC9228X, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(2) },
-   { DELL_V1500_SUBVENDOR, HDA_CODEC_STAC9205X,
+   { DELL_V1500_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },
-   { HDA_MATCH_ALL, HDA_CODEC_AD1988,
+   { HDA_MATCH_ALL, HDA_CODEC_AD1988, HDA_MATCH_ALL,
HDAA_QUIRK_IVREF80, HDAA_QUIRK_IVREF50 | HDAA_QUIRK_IVREF100,
0 },
-   { HDA_MATCH_ALL, HDA_CODEC_AD1988B,
+   { HDA_MATCH_ALL, HDA_CODEC_AD1988B, HDA_MATC

svn commit: r248788 - in head: contrib/bind9 lib/bind lib/bind/dns lib/bind/dns/dns

2013-03-27 Thread Erwin Lansing
Author: erwin
Date: Wed Mar 27 10:11:43 2013
New Revision: 248788
URL: http://svnweb.freebsd.org/changeset/base/248788

Log:
  Update to 9.8.4-P2
  
  Removed the check for regex.h in configure in order
  to disable regex syntax checking, as it exposes
  BIND to a critical flaw in libregex on some
  platforms. [RT #32688]
  
  Security: CVE-2013-2266
  Approved by:  delphij (mentor)
  Sponsored by: DK Hostmaster A/S

Modified:
  head/contrib/bind9/CHANGES
  head/contrib/bind9/config.h.in
  head/contrib/bind9/configure.in
  head/contrib/bind9/version
  head/lib/bind/config.h
  head/lib/bind/dns/code.h
  head/lib/bind/dns/dns/enumclass.h
  head/lib/bind/dns/dns/enumtype.h
  head/lib/bind/dns/dns/rdatastruct.h
Directory Properties:
  head/contrib/bind9/   (props changed)

Modified: head/contrib/bind9/CHANGES
==
--- head/contrib/bind9/CHANGES  Wed Mar 27 07:58:29 2013(r248787)
+++ head/contrib/bind9/CHANGES  Wed Mar 27 10:11:43 2013(r248788)
@@ -1,3 +1,10 @@
+   --- 9.8.4-P2 released ---
+
+3516.  [security]  Removed the check for regex.h in configure in order
+   to disable regex syntax checking, as it exposes
+   BIND to a critical flaw in libregex on some
+   platforms. [RT #32688]
+
--- 9.8.4-P1 released ---
 
 3407.  [security]  Named could die on specific queries with dns64 enabled.

Modified: head/contrib/bind9/config.h.in
==
--- head/contrib/bind9/config.h.in  Wed Mar 27 07:58:29 2013
(r248787)
+++ head/contrib/bind9/config.h.in  Wed Mar 27 10:11:43 2013
(r248788)
@@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int
 /* Define if your OpenSSL version supports GOST. */
 #undef HAVE_OPENSSL_GOST
 
-/* Define to 1 if you have the  header file. */
-#undef HAVE_REGEX_H
-
 /* Define to 1 if you have the `setegid' function. */
 #undef HAVE_SETEGID
 

Modified: head/contrib/bind9/configure.in
==
--- head/contrib/bind9/configure.in Wed Mar 27 07:58:29 2013
(r248787)
+++ head/contrib/bind9/configure.in Wed Mar 27 10:11:43 2013
(r248788)
@@ -298,7 +298,7 @@ esac
 
 AC_HEADER_STDC
 
-AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h 
sys/param.h sys/sysctl.h net/if6.h,,,
+AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h 
sys/param.h sys/sysctl.h net/if6.h,,,
 [$ac_includes_default
 #ifdef HAVE_SYS_PARAM_H
 # include 

Modified: head/contrib/bind9/version
==
--- head/contrib/bind9/version  Wed Mar 27 07:58:29 2013(r248787)
+++ head/contrib/bind9/version  Wed Mar 27 10:11:43 2013(r248788)
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=8
 PATCHVER=4
 RELEASETYPE=-P
-RELEASEVER=1
+RELEASEVER=2

Modified: head/lib/bind/config.h
==
--- head/lib/bind/config.h  Wed Mar 27 07:58:29 2013(r248787)
+++ head/lib/bind/config.h  Wed Mar 27 10:11:43 2013(r248788)
@@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int
 /* Define if your OpenSSL version supports GOST. */
 /* #undef HAVE_OPENSSL_GOST */
 
-/* Define to 1 if you have the  header file. */
-#define HAVE_REGEX_H 1
-
 /* Define to 1 if you have the `setegid' function. */
 #define HAVE_SETEGID 1
 

Modified: head/lib/bind/dns/code.h
==
--- head/lib/bind/dns/code.hWed Mar 27 07:58:29 2013(r248787)
+++ head/lib/bind/dns/code.hWed Mar 27 10:11:43 2013(r248788)
@@ -1,7 +1,7 @@
 /* $FreeBSD$ */
 
 /*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1998-2003 Internet Software Consortium.
  *
  * Permission to use, copy, modify, and distribute this software for any

Modified: head/lib/bind/dns/dns/enumclass.h
==
--- head/lib/bind/dns/dns/enumclass.h   Wed Mar 27 07:58:29 2013
(r248787)
+++ head/lib/bind/dns/dns/enumclass.h   Wed Mar 27 10:11:43 2013
(r248788)
@@ -1,7 +1,7 @@
 /* $FreeBSD$ */
 
 /*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1998-2003 Internet Software Consortium.
  *
  * Permission to use, copy, modify, and distribute this software for any

Modified: head/lib/bind/dns/dns/enumtype.h
==
--- head/lib/bind/dns/dns/enumtype.hWed Mar 27 07:58:29 2013
(r248787)
+

svn commit: r248789 - head/sys/i386/include

2013-03-27 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 27 10:52:18 2013
New Revision: 248789
URL: http://svnweb.freebsd.org/changeset/base/248789

Log:
  Fix the VM_BCACHE_SIZE_MAX definition on i386 to match the maximal
  buffer map size, auto-tuned on the 4GB machine.  Having the maxbcache
  bigger than the buffer map causes the transient bio map sizing logic
  to assume that there is enough KVA to use approximately 90MB (buffer
  map is sized to 110MB, and maxbcache is 200MB).  The increase in the
  KVA usage caused other big KVA consumers, like nvidia.ko, to fail the
  initialization.
  
  Change the definition for both PAE and non-PAE cases, since PAE is
  even more KVA-starved.
  
  Reported and tested by:   David Wolfskill
  Discussed with:   alc
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/i386/include/param.h

Modified: head/sys/i386/include/param.h
==
--- head/sys/i386/include/param.h   Wed Mar 27 10:11:43 2013
(r248788)
+++ head/sys/i386/include/param.h   Wed Mar 27 10:52:18 2013
(r248789)
@@ -140,9 +140,12 @@
  * Ceiling on size of buffer cache (really only effects write queueing,
  * the VM page cache is not effected), can be changed via
  * the kern.maxbcache /boot/loader.conf variable.
+ *
+ * The value is equal to the size of the auto-tuned buffer map for
+ * the machine with 4GB of RAM, see vfs_bio.c:kern_vfs_bio_buffer_alloc().
  */
 #ifndef VM_BCACHE_SIZE_MAX
-#define VM_BCACHE_SIZE_MAX (200 * 1024 * 1024)
+#define VM_BCACHE_SIZE_MAX (7224 * 16 * 1024)
 #endif
 
 /*
___
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: r248790 - head/sys/kern

2013-03-27 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 27 10:56:15 2013
New Revision: 248790
URL: http://svnweb.freebsd.org/changeset/base/248790

Log:
  On i386, double the default size of the bio transient map.  With the
  maxbcache size fixed, the auto-tuned transient map is too small for
  real-world load on i386.
  
  Tested by:David Wolfskill
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Mar 27 10:52:18 2013(r248789)
+++ head/sys/kern/vfs_bio.c Wed Mar 27 10:56:15 2013(r248790)
@@ -520,6 +520,12 @@ bd_speedup(void)
mtx_unlock(&bdlock);
 }
 
+#ifdef __i386__
+#defineTRANSIENT_DENOM 5
+#else
+#defineTRANSIENT_DENOM 10
+#endif
+
 /*
  * Calculating buffer cache scaling values and reserve space for buffer
  * headers.  This is called during low level kernel initialization and
@@ -579,8 +585,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 * to the amount of the buffer mapped for typical UFS load.
 *
 * Clip the buffer map to reserve space for the transient
-* BIOs, if its extent is bigger than 90% of the maximum
-* buffer map extent on the platform.
+* BIOs, if its extent is bigger than 90% (80% on i386) of the
+* maximum buffer map extent on the platform.
 *
 * The fall-back to the maxbuf in case of maxbcache unset,
 * allows to not trim the buffer KVA for the architectures
@@ -589,7 +595,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
if (bio_transient_maxcnt == 0 && unmapped_buf_allowed) {
maxbuf_sz = maxbcache != 0 ? maxbcache : maxbuf * BKVASIZE;
buf_sz = (long)nbuf * BKVASIZE;
-   if (buf_sz < maxbuf_sz / 10 * 9) {
+   if (buf_sz < maxbuf_sz / TRANSIENT_DENOM *
+   (TRANSIENT_DENOM - 1)) {
/*
 * There is more KVA than memory.  Do not
 * adjust buffer map size, and assign the rest
@@ -599,10 +606,10 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
} else {
/*
 * Buffer map spans all KVA we could afford on
-* this platform.  Give 10% of the buffer map
-* to the transient bio map.
+* this platform.  Give 10% (20% on i386) of
+* the buffer map to the transient bio map.
 */
-   biotmap_sz = buf_sz / 10;
+   biotmap_sz = buf_sz / TRANSIENT_DENOM;
buf_sz -= biotmap_sz;
}
if (biotmap_sz / INT_MAX > MAXPHYS)
___
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: r248792 - in head/sys: kern sys

2013-03-27 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 27 11:34:27 2013
New Revision: 248792
URL: http://svnweb.freebsd.org/changeset/base/248792

Log:
  Add dev_strategy_csw() function, which is similar to dev_strategy()
  but assumes that a thread reference was already obtained on the passed
  device.  Use the function from physio(), to avoid two extra dev_mtx
  lock and unlock.  Note that physio() is always used as the cdevsw
  method, or is called from a cdevsw method, and the caller already owns
  the reference.
  
  dev_strategy() is left to keep KPI intact, but now it is implemented
  as a wrapper around dev_strategy_csw().
  
  Do some style cleanup in physio().
  
  Requested and reviewed by:kan (previous version)
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/kern/kern_physio.c
  head/sys/kern/vfs_bio.c
  head/sys/sys/conf.h

Modified: head/sys/kern/kern_physio.c
==
--- head/sys/kern/kern_physio.c Wed Mar 27 11:31:39 2013(r248791)
+++ head/sys/kern/kern_physio.c Wed Mar 27 11:34:27 2013(r248792)
@@ -34,11 +34,11 @@ __FBSDID("$FreeBSD$");
 int
 physio(struct cdev *dev, struct uio *uio, int ioflag)
 {
-   int i;
-   int error;
+   struct buf *bp;
+   struct cdevsw *csw;
caddr_t sa;
u_int iolen;
-   struct buf *bp;
+   int error, i, mapped;
 
/* Keep the process UPAGES from being swapped. XXX: why ? */
PHOLD(curproc);
@@ -91,11 +91,8 @@ physio(struct cdev *dev, struct uio *uio
 
bp->b_blkno = btodb(bp->b_offset);
 
+   csw = dev->si_devsw;
if (uio->uio_segflg == UIO_USERSPACE) {
-   struct cdevsw *csw;
-   int mapped;
-
-   csw = dev->si_devsw;
if (csw != NULL &&
 (csw->d_flags & D_UNMAPPED_IO) != 0)
mapped = 0;
@@ -107,7 +104,7 @@ physio(struct cdev *dev, struct uio *uio
}
}
 
-   dev_strategy(dev, bp);
+   dev_strategy_csw(dev, csw, bp);
if (uio->uio_rw == UIO_READ)
bwait(bp, PRIBIO, "physrd");
else

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Mar 27 11:31:39 2013(r248791)
+++ head/sys/kern/vfs_bio.c Wed Mar 27 11:34:27 2013(r248792)
@@ -3687,11 +3687,34 @@ void
 dev_strategy(struct cdev *dev, struct buf *bp)
 {
struct cdevsw *csw;
-   struct bio *bip;
int ref;
 
-   if ((!bp->b_iocmd) || (bp->b_iocmd & (bp->b_iocmd - 1)))
-   panic("b_iocmd botch");
+   KASSERT(dev->si_refcount > 0,
+   ("dev_strategy on un-referenced struct cdev *(%s) %p",
+   devtoname(dev), dev));
+
+   csw = dev_refthread(dev, &ref);
+   dev_strategy_csw(dev, csw, bp);
+   dev_relthread(dev, ref);
+}
+
+void
+dev_strategy_csw(struct cdev *dev, struct cdevsw *csw, struct buf *bp)
+{
+   struct bio *bip;
+
+   KASSERT(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE,
+   ("b_iocmd botch"));
+   KASSERT(((dev->si_flags & SI_ETERNAL) != 0 && csw != NULL) ||
+   dev->si_threadcount > 0,
+   ("dev_strategy_csw threadcount cdev *(%s) %p", devtoname(dev),
+   dev));
+   if (csw == NULL) {
+   bp->b_error = ENXIO;
+   bp->b_ioflags = BIO_ERROR;
+   bufdone(bp);
+   return;
+   }
for (;;) {
bip = g_new_bio();
if (bip != NULL)
@@ -3707,19 +3730,7 @@ dev_strategy(struct cdev *dev, struct bu
bip->bio_done = bufdonebio;
bip->bio_caller2 = bp;
bip->bio_dev = dev;
-   KASSERT(dev->si_refcount > 0,
-   ("dev_strategy on un-referenced struct cdev *(%s)",
-   devtoname(dev)));
-   csw = dev_refthread(dev, &ref);
-   if (csw == NULL) {
-   g_destroy_bio(bip);
-   bp->b_error = ENXIO;
-   bp->b_ioflags = BIO_ERROR;
-   bufdone(bp);
-   return;
-   }
(*csw->d_strategy)(bip);
-   dev_relthread(dev, ref);
 }
 
 /*

Modified: head/sys/sys/conf.h
==
--- head/sys/sys/conf.h Wed Mar 27 11:31:39 2013(r248791)
+++ head/sys/sys/conf.h Wed Mar 27 11:34:27 2013(r248792)
@@ -255,6 +255,7 @@ voiddev_ref(struct cdev *dev);
 void   dev_refl(struct cdev *dev);
 void   dev_rel(struct cdev *dev);
 void   dev_strategy(struct cdev *dev, struct buf *bp);
+void   dev_strategy_csw(struct cdev *dev, struct cdevsw *csw, struct buf *b

svn commit: r248794 - head/sys/kern

2013-03-27 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 27 11:47:52 2013
New Revision: 248794
URL: http://svnweb.freebsd.org/changeset/base/248794

Log:
  Fix a race with the vnode reclamation in the aio_qphysio().  Obtain
  the thread reference on the vp->v_rdev and use the returned struct
  cdev *dev instead of using vp->v_rdev.  Call dev_strategy_csw()
  instead of dev_strategy(), since we now own the reference.
  
  Since the csw was already calculated, test d_flags to avoid mapping
  the buffer if the driver supports unmapped requests [*].
  
  Suggested by: kan [*]
  Reviewed by:  kan (previous version)
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Wed Mar 27 11:42:36 2013(r248793)
+++ head/sys/kern/vfs_aio.c Wed Mar 27 11:47:52 2013(r248794)
@@ -1252,9 +1252,11 @@ aio_qphysio(struct proc *p, struct aiocb
struct file *fp;
struct buf *bp;
struct vnode *vp;
+   struct cdevsw *csw;
+   struct cdev *dev;
struct kaioinfo *ki;
struct aioliojob *lj;
-   int error;
+   int error, ref;
 
cb = &aiocbe->uaiocb;
fp = aiocbe->fd_file;
@@ -1282,9 +1284,6 @@ aio_qphysio(struct proc *p, struct aiocb
if (cb->aio_nbytes % vp->v_bufobj.bo_bsize)
return (-1);
 
-   if (cb->aio_nbytes > vp->v_rdev->si_iosize_max)
-   return (-1);
-
if (cb->aio_nbytes >
MAXPHYS - (((vm_offset_t) cb->aio_buf) & PAGE_MASK))
return (-1);
@@ -1293,6 +1292,15 @@ aio_qphysio(struct proc *p, struct aiocb
if (ki->kaio_buffer_count >= ki->kaio_ballowed_count)
return (-1);
 
+   ref = 0;
+   csw = devvn_refthread(vp, &dev, &ref);
+   if (csw == NULL)
+   return (ENXIO);
+   if (cb->aio_nbytes > dev->si_iosize_max) {
+   error = -1;
+   goto unref;
+   }
+
/* Create and build a buffer header for a transfer. */
bp = (struct buf *)getpbuf(NULL);
BUF_KERNPROC(bp);
@@ -1323,7 +1331,7 @@ aio_qphysio(struct proc *p, struct aiocb
/*
 * Bring buffer into kernel space.
 */
-   if (vmapbuf(bp, 1) < 0) {
+   if (vmapbuf(bp, (csw->d_flags & D_UNMAPPED_IO) == 0) < 0) {
error = EFAULT;
goto doerror;
}
@@ -1345,7 +1353,8 @@ aio_qphysio(struct proc *p, struct aiocb
TASK_INIT(&aiocbe->biotask, 0, biohelper, aiocbe);
 
/* Perform transfer. */
-   dev_strategy(vp->v_rdev, bp);
+   dev_strategy_csw(dev, csw, bp);
+   dev_relthread(dev, ref);
return (0);
 
 doerror:
@@ -1357,6 +1366,8 @@ doerror:
aiocbe->bp = NULL;
AIO_UNLOCK(ki);
relpbuf(bp, NULL);
+unref:
+   dev_relthread(dev, ref);
return (error);
 }
 
___
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: r248797 - head

2013-03-27 Thread Rene Ladan
Author: rene (doc,ports committer)
Date: Wed Mar 27 15:03:18 2013
New Revision: 248797
URL: http://svnweb.freebsd.org/changeset/base/248797

Log:
  Fix a typo, 'xdev-build' should be spelled with a 'd' at the end.
  
  Approved by:  cognet

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Mar 27 14:23:50 2013(r248796)
+++ head/Makefile.inc1  Wed Mar 27 15:03:18 2013(r248797)
@@ -1819,6 +1819,6 @@ _xi-links:
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
done
 .else
-xdev xdev-buil xdev-install:
+xdev xdev-build xdev-install:
@echo "*** Error: Both XDEV and XDEV_ARCH must be defined for 
\"${.TARGET}\" target"
 .endif
___
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: r248798 - head/tools/tools/tinybsd/conf/firewall

2013-03-27 Thread Rene Ladan
Author: rene (doc,ports committer)
Date: Wed Mar 27 15:10:40 2013
New Revision: 248798
URL: http://svnweb.freebsd.org/changeset/base/248798

Log:
  Properly spell "Class Based Queueing"
  
  PR:   www/177412
  Submitted by: Oliver Loch 
  Approved by:  cognet

Modified:
  head/tools/tools/tinybsd/conf/firewall/TINYBSD

Modified: head/tools/tools/tinybsd/conf/firewall/TINYBSD
==
--- head/tools/tools/tinybsd/conf/firewall/TINYBSD  Wed Mar 27 15:03:18 
2013(r248797)
+++ head/tools/tools/tinybsd/conf/firewall/TINYBSD  Wed Mar 27 15:10:40 
2013(r248798)
@@ -151,7 +151,7 @@ device  pfsync  
 device  carp#Common Address Redundancy Protocol
 
 options ALTQ
-options ALTQ_CBQ# Class Bases Queueing
+options ALTQ_CBQ# Class Based Queueing
 options ALTQ_RED# Random Early Detection
 options ALTQ_RIO# RED In/Out
 options ALTQ_HFSC   # Hierarchical Packet Scheduler
___
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: r248799 - head/sys/dev/fb

2013-03-27 Thread Jung-uk Kim
Author: jkim
Date: Wed Mar 27 18:06:28 2013
New Revision: 248799
URL: http://svnweb.freebsd.org/changeset/base/248799

Log:
  Limit the amount of video memory we map for the driver to the maximum value.
  This basically restores the spirit of r203535, which was partially reverted
  in r205557, while we still map fixed amount to work around transient issues
  we experienced with r203535.
  
  Prodded by:   avg
  Tested by:avg
  MFC after:1 week

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Mar 27 15:10:40 2013(r248798)
+++ head/sys/dev/fb/vesa.c  Wed Mar 27 18:06:28 2013(r248799)
@@ -89,6 +89,7 @@ static u_char *vesa_palette;
 static uint32_t vesa_palette_offs;
 
 static void *vesa_vmem_buf;
+static size_t vesa_vmem_max;
 
 static void *vesa_bios;
 static uint32_t vesa_bios_offs;
@@ -928,6 +929,8 @@ vesa_bios_init(void)
 #endif
continue;
}
+   if (bsize > vesa_vmem_max)
+   vesa_vmem_max = bsize;
 
/* expand the array if necessary */
if (modes >= vesa_vmode_max) {
@@ -1298,8 +1301,7 @@ vesa_set_mode(video_adapter_t *adp, int 
}
int10_set_mode(adp->va_initial_bios_mode);
if (adp->va_info.vi_flags & V_INFO_LINEAR)
-   pmap_unmapdev(adp->va_buffer,
-   vesa_adp_info->v_memsize * 64 * 1024);
+   pmap_unmapdev(adp->va_buffer, vesa_vmem_max);
/* 
 * Once (*prevvidsw->get_info)() succeeded, 
 * (*prevvidsw->set_mode)() below won't fail...
@@ -1337,8 +1339,7 @@ vesa_set_mode(video_adapter_t *adp, int 
adp->va_flags |= V_ADP_DAC8;
 
if (adp->va_info.vi_flags & V_INFO_LINEAR)
-   pmap_unmapdev(adp->va_buffer,
-   vesa_adp_info->v_memsize * 64 * 1024);
+   pmap_unmapdev(adp->va_buffer, vesa_vmem_max);
 
 #if VESA_DEBUG > 0
printf("VESA: mode set!\n");
@@ -1373,7 +1374,7 @@ vesa_set_mode(video_adapter_t *adp, int 
 #endif
vesa_adp->va_buffer =
(vm_offset_t)pmap_mapdev_attr(info.vi_buffer,
-   vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING);
+   vesa_vmem_max, PAT_WRITE_COMBINING);
vesa_adp->va_window = vesa_adp->va_buffer;
vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes;
vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes;
___
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: r248800 - head/sys/cam

2013-03-27 Thread Alexander Motin
Author: mav
Date: Wed Mar 27 18:55:01 2013
New Revision: 248800
URL: http://svnweb.freebsd.org/changeset/base/248800

Log:
  On SIM destruction free associated CCBs, preallocated inside xpt_get_ccb().
  Before this change they were just leaked.  Fortunately USB sticks now use
  only one CCB, and so leak was only 2KB per detach, while other bigger SIMs
  with much more allocated CCBs are rarely detached.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/cam_sim.c

Modified: head/sys/cam/cam_sim.c
==
--- head/sys/cam/cam_sim.c  Wed Mar 27 18:06:28 2013(r248799)
+++ head/sys/cam/cam_sim.c  Wed Mar 27 18:55:01 2013(r248800)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #define CAM_PATH_ANY (u_int32_t)-1
 
@@ -105,6 +106,7 @@ cam_sim_alloc(sim_action_func sim_action
 void
 cam_sim_free(struct cam_sim *sim, int free_devq)
 {
+   union ccb *ccb;
int error;
 
sim->refcount--;
@@ -115,6 +117,10 @@ cam_sim_free(struct cam_sim *sim, int fr
 
KASSERT(sim->refcount == 0, ("sim->refcount == 0"));
 
+   while ((ccb = (union ccb *)SLIST_FIRST(&sim->ccb_freeq)) != NULL) {
+   SLIST_REMOVE_HEAD(&sim->ccb_freeq, xpt_links.sle);
+   xpt_free_ccb(ccb);
+   }
if (free_devq)
cam_simq_free(sim->devq);
free(sim, M_CAMSIM);
___
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: r248802 - in head/contrib/binutils: bfd binutils

2013-03-27 Thread Dimitry Andric
Author: dim
Date: Wed Mar 27 19:21:36 2013
New Revision: 248802
URL: http://svnweb.freebsd.org/changeset/base/248802

Log:
  Similar to r239870 and r239872, teach the other binutils tools about the
  DW_FORM_flag_present dwarf attribute, so they do not print errors or
  warnings on files that contain it.  (This attribute can be emitted by
  newer versions of clang and gcc.)
  
  MFC after:1 week

Modified:
  head/contrib/binutils/bfd/dwarf2.c
  head/contrib/binutils/binutils/dwarf.c

Modified: head/contrib/binutils/bfd/dwarf2.c
==
--- head/contrib/binutils/bfd/dwarf2.c  Wed Mar 27 19:07:02 2013
(r248801)
+++ head/contrib/binutils/bfd/dwarf2.c  Wed Mar 27 19:21:36 2013
(r248802)
@@ -633,6 +633,9 @@ read_attribute_value (struct attribute *
   attr->u.val = read_1_byte (abfd, info_ptr);
   info_ptr += 1;
   break;
+case DW_FORM_flag_present:
+  attr->u.val = 1;
+  break;
 case DW_FORM_sdata:
   attr->u.sval = read_signed_leb128 (abfd, info_ptr, &bytes_read);
   info_ptr += bytes_read;

Modified: head/contrib/binutils/binutils/dwarf.c
==
--- head/contrib/binutils/binutils/dwarf.c  Wed Mar 27 19:07:02 2013
(r248801)
+++ head/contrib/binutils/binutils/dwarf.c  Wed Mar 27 19:21:36 2013
(r248802)
@@ -557,6 +557,7 @@ get_FORM_name (unsigned long form)
 case DW_FORM_ref8: return "DW_FORM_ref8";
 case DW_FORM_ref_udata:return "DW_FORM_ref_udata";
 case DW_FORM_indirect: return "DW_FORM_indirect";
+case DW_FORM_flag_present: return "DW_FORM_flag_present";
 default:
   {
static char buffer[100];
@@ -969,6 +970,10 @@ read_and_display_attr_value (unsigned lo
   data += offset_size;
   break;
 
+case DW_FORM_flag_present:
+  uvalue = 1;
+  break;
+
 case DW_FORM_ref1:
 case DW_FORM_flag:
 case DW_FORM_data1:
@@ -1030,6 +1035,7 @@ read_and_display_attr_value (unsigned lo
printf (" %#lx", uvalue);
   break;
 
+case DW_FORM_flag_present:
 case DW_FORM_flag:
 case DW_FORM_data1:
 case DW_FORM_data2:
___
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: r248803 - head/lib/libc/locale

2013-03-27 Thread Jilles Tjoelker
Author: jilles
Date: Wed Mar 27 21:31:40 2013
New Revision: 248803
URL: http://svnweb.freebsd.org/changeset/base/248803

Log:
  btowc(3), isblank(3): Correct prototypes for _l variants.
  
  MFC after:1 week

Modified:
  head/lib/libc/locale/btowc.3
  head/lib/libc/locale/isblank.3

Modified: head/lib/libc/locale/btowc.3
==
--- head/lib/libc/locale/btowc.3Wed Mar 27 19:21:36 2013
(r248802)
+++ head/lib/libc/locale/btowc.3Wed Mar 27 21:31:40 2013
(r248803)
@@ -42,9 +42,9 @@
 .In wchar.h
 .In xlocale.h
 .Ft wint_t
-.Fn btowc "int c"
+.Fn btowc_l "int c" "locale_t loc"
 .Ft int
-.Fn wctob "wint_t c"
+.Fn wctob_l "wint_t c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn btowc

Modified: head/lib/libc/locale/isblank.3
==
--- head/lib/libc/locale/isblank.3  Wed Mar 27 19:21:36 2013
(r248802)
+++ head/lib/libc/locale/isblank.3  Wed Mar 27 21:31:40 2013
(r248803)
@@ -41,7 +41,7 @@
 .Ft int
 .Fn isblank "int c"
 .Ft int
-.Fn isblank "int c" "locale_t loc"
+.Fn isblank_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isblank
___
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: r248804 - head/sys/kern

2013-03-27 Thread Jim Harris
Author: jimharris
Date: Wed Mar 27 23:07:43 2013
New Revision: 248804
URL: http://svnweb.freebsd.org/changeset/base/248804

Log:
  deferal -> deferral

Modified:
  head/sys/kern/subr_bus_dma.c

Modified: head/sys/kern/subr_bus_dma.c
==
--- head/sys/kern/subr_bus_dma.cWed Mar 27 21:31:40 2013
(r248803)
+++ head/sys/kern/subr_bus_dma.cWed Mar 27 23:07:43 2013
(r248804)
@@ -295,7 +295,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_
 
/*
 * Return ENOMEM to the caller so that it can pass it up the stack.
-* This error only happens when NOWAIT is set, so deferal is disabled.
+* This error only happens when NOWAIT is set, so deferral is disabled.
 */
if (error == ENOMEM)
return (error);
@@ -396,7 +396,7 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, 
(*callback)(callback_arg, segs, nsegs, error);
/*
 * Return ENOMEM to the caller so that it can pass it up the stack.
-* This error only happens when NOWAIT is set, so deferal is disabled.
+* This error only happens when NOWAIT is set, so deferral is disabled.
 */
if (error == ENOMEM)
return (error);
@@ -468,7 +468,7 @@ bus_dmamap_load_mem(bus_dma_tag_t dmat, 
 
/*
 * Return ENOMEM to the caller so that it can pass it up the stack.
-* This error only happens when NOWAIT is set, so deferal is disabled.
+* This error only happens when NOWAIT is set, so deferral is disabled.
 */
if (error == ENOMEM)
return (error);
___
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: r248805 - head

2013-03-27 Thread Warner Losh
Author: imp
Date: Thu Mar 28 02:44:15 2013
New Revision: 248805
URL: http://svnweb.freebsd.org/changeset/base/248805

Log:
  Update wiht the times.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSWed Mar 27 23:07:43 2013(r248804)
+++ head/MAINTAINERSThu Mar 28 02:44:15 2013(r248805)
@@ -30,7 +30,8 @@ contrib/openbsm   rwatson Pre-commit revie
 sys/security/audit rwatson Pre-commit review requested.
 ahc(4) gibbs   Pre-commit review requested.
 ahd(4) gibbs   Pre-commit review requested.
-NEWCARDimp Pre-commit review requested.
+PC Cardimp Pre-commit review requested.
+CardBusimp Pre-commit review requested.
 pci busimp,jhb Pre-commit review requested.
 cdboot jhb Pre-commit review requested.
 pxebootjhb Pre-commit review requested.
___
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: r248806 - head/share/mk

2013-03-27 Thread Mark Johnston
Author: markj
Date: Thu Mar 28 04:13:52 2013
New Revision: 248806
URL: http://svnweb.freebsd.org/changeset/base/248806

Log:
  Make sure that ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols are always
  deleted by a "make clean" when DEBUG_FLAGS is set.
  
  Reported by:  gleb
  Approved by:  emaste (co-mentor)

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkThu Mar 28 02:44:15 2013(r248805)
+++ head/share/mk/bsd.lib.mkThu Mar 28 04:13:52 2013(r248806)
@@ -202,6 +202,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
 .endif
 
 .if defined(DEBUG_FLAGS)
+CLEANFILES+=   ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols
 ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols
${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \
${SHLIB_NAME_FULL} ${.TARGET}
@@ -209,7 +210,7 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLI
 ${SHLIB_NAME}.symbols: ${SHLIB_NAME_FULL}
${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
 .endif
-.endif
+.endif #defined(SHLIB_NAME)
 
 .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && 
${MK_TOOLCHAIN} != "no"
 _LIBS+=lib${LIB}_pic.a
@@ -398,10 +399,7 @@ clean:
 .endif
rm -f ${SHLIB_LINK}
 .endif
-.if defined(LIB) && !empty(LIB)
-   rm -f lib${LIB}.so.* lib${LIB}.so
-.endif
-.endif
+.endif # defined(SHLIB_NAME)
 .if defined(WANT_LINT) && defined(LIB) && !empty(LIB)
rm -f ${LINTOBJS}
 .endif
___
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: r248809 - head/sys/mips/atheros

2013-03-27 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 28 05:43:03 2013
New Revision: 248809
URL: http://svnweb.freebsd.org/changeset/base/248809

Log:
  Fix the AR933x platform device start/stop code.
  
  This was ported from the AR724x code and I think that also doesn't
  quite work.  I'll investigate that soon.
  
  With this in place the system reset path works, so 'reset' from kdb
  actually resets the SoC.
  
  Tested:
  
  * AP121 test board

Modified:
  head/sys/mips/atheros/ar933x_chip.c

Modified: head/sys/mips/atheros/ar933x_chip.c
==
--- head/sys/mips/atheros/ar933x_chip.c Thu Mar 28 05:39:45 2013
(r248808)
+++ head/sys/mips/atheros/ar933x_chip.c Thu Mar 28 05:43:03 2013
(r248809)
@@ -119,25 +119,19 @@ ar933x_chip_detect_sys_frequency(void)
 static void
 ar933x_chip_device_stop(uint32_t mask)
 {
-   uint32_t mask_inv, reg;
+   uint32_t reg;
 
-   mask_inv = mask;
reg = ATH_READ_REG(AR933X_RESET_REG_RESET_MODULE);
-   reg |= mask;
-   reg &= ~mask_inv;
-   ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg);
+   ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg | mask);
 }
 
 static void
 ar933x_chip_device_start(uint32_t mask)
 {
-   uint32_t mask_inv, reg;
+   uint32_t reg;
 
-   mask_inv = mask;
reg = ATH_READ_REG(AR933X_RESET_REG_RESET_MODULE);
-   reg &= ~mask;
-   reg |= mask_inv;
-   ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg);
+   ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg & ~mask);
 }
 
 static int
___
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: r248815 - head/sys/vm

2013-03-27 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 28 06:39:27 2013
New Revision: 248815
URL: http://svnweb.freebsd.org/changeset/base/248815

Log:
  Release the v_writecount reference on the vnode in case of error,
  before the vnode is vput() in vm_mmap_vnode().  Error return means
  that there is no use reference on the vnode from the vm object
  reference, and failing to restore v_writecount breaks the invariant
  that v_writecount is less or equal to the usecount.
  
  The situation observed when nfs client returns ESTALE for
  VOP_GETATTR() after the open.
  
  In collaboration with:pho
  MFC after:1 week

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Thu Mar 28 06:31:04 2013(r248814)
+++ head/sys/vm/vm_mmap.c   Thu Mar 28 06:39:27 2013(r248815)
@@ -1345,6 +1345,10 @@ mark_atime:
vfs_mark_atime(vp, cred);
 
 done:
+   if (error != 0 && *writecounted) {
+   *writecounted = FALSE;
+   vnode_pager_update_writecount(obj, objsize, 0);
+   }
vput(vp);
return (error);
 }
___
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"