svn commit: r206648 - head/sys/cam/scsi

2010-04-15 Thread Andriy Gapon
Author: avg
Date: Thu Apr 15 08:29:14 2010
New Revision: 206648
URL: http://svn.freebsd.org/changeset/base/206648

Log:
  scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and
  d_mediasize
  
  CD_FLAG_VALID_TOC is not required for setting those media properties.
  
  PR:   kern/145385
  Submitted by: Juergen Lock 
a slightly different version
  Tested by:Pavel Sukhoy ,
Markus Wild ,
Juergen Lock ,
uqs
  MFC after:1 week

Modified:
  head/sys/cam/scsi/scsi_cd.c

Modified: head/sys/cam/scsi/scsi_cd.c
==
--- head/sys/cam/scsi/scsi_cd.c Thu Apr 15 08:20:57 2010(r206647)
+++ head/sys/cam/scsi/scsi_cd.c Thu Apr 15 08:29:14 2010(r206648)
@@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph)
softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
cdprevent(periph, PR_ALLOW);
return (error);
-   } else
+   } else {
softc->flags |= CD_FLAG_VALID_MEDIA;
+   softc->disk->d_sectorsize = softc->params.blksize;
+   softc->disk->d_mediasize =
+   (off_t)softc->params.blksize * softc->params.disksize;
+   }
 
/*
 * Now we check the table of contents.  This (currently) is only
@@ -2863,9 +2867,6 @@ cdcheckmedia(struct cam_periph *periph)
}
 
softc->flags |= CD_FLAG_VALID_TOC;
-   softc->disk->d_sectorsize = softc->params.blksize;
-   softc->disk->d_mediasize =
-   (off_t)softc->params.blksize * softc->params.disksize;
 
 bailout:
 
___
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: r206649 - head/lib/libc/sys

2010-04-15 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 15 08:32:50 2010
New Revision: 206649
URL: http://svn.freebsd.org/changeset/base/206649

Log:
  Still reference struct __sigaction with clarification when this form
  of argument declaration is needed.
  
  Discussed with:   bde
  MFC after:3 days

Modified:
  head/lib/libc/sys/sigaction.2

Modified: head/lib/libc/sys/sigaction.2
==
--- head/lib/libc/sys/sigaction.2   Thu Apr 15 08:29:14 2010
(r206648)
+++ head/lib/libc/sys/sigaction.2   Thu Apr 15 08:32:50 2010
(r206649)
@@ -496,6 +496,16 @@ or
 .Dv SIG_IGN
 this way.
 .Pp
+If preprocessing symbol
+.Va _POSIX_C_SOURCE
+with the value >= 199309 is not defined, the following declaration for
+the handler shall be used:
+.Bl -tag -offset indent -width short
+.It Tn POSIX Dv SA_SIGINFO :
+.Ft void
+.Fn handler int "struct __sigaction *" "void *" ;
+.El
+.Pp
 If the
 .Dv SA_SIGINFO
 flag is not set, the handler function should match
___
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: r206650 - head/sys/geom

2010-04-15 Thread Andriy Gapon
Author: avg
Date: Thu Apr 15 08:39:56 2010
New Revision: 206650
URL: http://svn.freebsd.org/changeset/base/206650

Log:
  g_io_check: respond to zero pp->mediasize with ENXIO
  
  Previsouly this condition was reported with EIO by bio_offset > mediasize
  check.
  Perhaps that check should be extended to bio_offset+bio_length > mediasize.
  
  MFC after:1 week

Modified:
  head/sys/geom/geom_io.c

Modified: head/sys/geom/geom_io.c
==
--- head/sys/geom/geom_io.c Thu Apr 15 08:32:50 2010(r206649)
+++ head/sys/geom/geom_io.c Thu Apr 15 08:39:56 2010(r206650)
@@ -309,8 +309,8 @@ g_io_check(struct bio *bp)
case BIO_READ:
case BIO_WRITE:
case BIO_DELETE:
-   /* Zero sectorsize is a probably lack of media */
-   if (pp->sectorsize == 0)
+   /* Zero sectorsize or mediasize is probably a lack of media. */
+   if (pp->sectorsize == 0 || pp->mediasize == 0)
return (ENXIO);
/* Reject I/O not on sector boundary */
if (bp->bio_offset % pp->sectorsize)
___
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: r206651 - head/sys/cam/scsi

2010-04-15 Thread Andriy Gapon
Author: avg
Date: Thu Apr 15 09:22:14 2010
New Revision: 206651
URL: http://svn.freebsd.org/changeset/base/206651

Log:
  scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and
  d_mediasize
  
  [Forced commit to correct PR number.]
  CD_FLAG_VALID_TOC is not required for setting those media properties.
  
  PR:   kern/138789
  Submitted by: Juergen Lock 
a slightly different version
  Tested by:Pavel Sukhoy ,
Markus Wild ,
Juergen Lock ,
uqs
  MFC after:1 week

Modified:
  head/sys/cam/scsi/scsi_cd.c

Modified: head/sys/cam/scsi/scsi_cd.c
==
___
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: r206652 - head/sys/dev/siis

2010-04-15 Thread Alexander Motin
Author: mav
Date: Thu Apr 15 11:17:33 2010
New Revision: 206652
URL: http://svn.freebsd.org/changeset/base/206652

Log:
  Explicitly enable PCI busmastering on attach.
  Now SiI3124 with siis(4) successfully works on sparc64 (SunBlade 100).
  
  H/W donated by:   Gheorghe Ardelean

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

Modified: head/sys/dev/siis/siis.c
==
--- head/sys/dev/siis/siis.cThu Apr 15 09:22:14 2010(r206651)
+++ head/sys/dev/siis/siis.cThu Apr 15 11:17:33 2010(r206652)
@@ -164,6 +164,7 @@ siis_attach(device_t dev)
rman_fini(&ctlr->sc_iomem);
return (error);
}
+   pci_enable_busmaster(dev);
/* Reset controller */
siis_resume(dev);
/* Number of HW channels */
___
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: r206659 - head/sys/netipsec

2010-04-15 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Thu Apr 15 12:40:33 2010
New Revision: 206659
URL: http://svn.freebsd.org/changeset/base/206659

Log:
  Locks SPTREE when setting some SP entries to state DEAD.
  This can prevent kernel panics when updating SPs while
  there is some traffic for them.
  
  Obtained from: NETASQ
  MFC after: 1m

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Thu Apr 15 12:40:02 2010(r206658)
+++ head/sys/netipsec/key.c Thu Apr 15 12:40:33 2010(r206659)
@@ -1882,7 +1882,9 @@ key_spdadd(so, m, mhp)
newsp = key_getsp(&spidx);
if (mhp->msg->sadb_msg_type == SADB_X_SPDUPDATE) {
if (newsp) {
+   SPTREE_LOCK();
newsp->state = IPSEC_SPSTATE_DEAD;
+   SPTREE_UNLOCK();
KEY_FREESP(&newsp);
}
} else {
@@ -2117,7 +2119,9 @@ key_spddelete(so, m, mhp)
/* save policy id to buffer to be returned. */
xpl0->sadb_x_policy_id = sp->id;
 
+   SPTREE_LOCK();
sp->state = IPSEC_SPSTATE_DEAD;
+   SPTREE_UNLOCK();
KEY_FREESP(&sp);
 
 {
@@ -2184,7 +2188,9 @@ key_spddelete2(so, m, mhp)
return key_senderror(so, m, EINVAL);
}
 
+   SPTREE_LOCK();
sp->state = IPSEC_SPSTATE_DEAD;
+   SPTREE_UNLOCK();
KEY_FREESP(&sp);
 
 {
___
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: r206560 - head/sys/fs/devfs

2010-04-15 Thread Jaakko Heinonen
On 2010-04-14, Kostik Belousov wrote:
> First, I think we shall sort dirent->dd_dlist so that symlinks are
> located before any other entries, and allow for duplication of
> any name with the name of symlink.

What will happen when user deletes a symlink covering a device?
Uncovering the device may a bit surprising? If user created directories
will be allowed one day, they will face the same problem.

> I remember there was a PR to change devfs_symlink() so that symlink is
> added to dd_dlist into head, not to a tail, as it is done now.

kern/114057

> Assume that all full devfs pathes except symlinks are stored somewhere
> with type information for the component at the end.
> Then, just iterating this set at make_dev() time, we can verify that
> name is not a duplicate, and that the path components are not already
> used as device name (only as directories).
> The pathes storage need to be protected by dev_mtx. 
> 
> Possibly, the cdev_priv.c_dev.__si_namebuf may be reused at the
> cost of long check at the make_dev() time.

Could you elaborate on this? I am not sure if I understand what you mean
with __si_namebuf reuse.

> What do you think of this ?

I don't see anything obviously wrong with it.

-- 
Jaakko
___
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: r206560 - head/sys/fs/devfs

2010-04-15 Thread Kostik Belousov
On Thu, Apr 15, 2010 at 04:01:56PM +0300, Jaakko Heinonen wrote:
> On 2010-04-14, Kostik Belousov wrote:
> > First, I think we shall sort dirent->dd_dlist so that symlinks are
> > located before any other entries, and allow for duplication of
> > any name with the name of symlink.
> 
> What will happen when user deletes a symlink covering a device?
> Uncovering the device may a bit surprising? If user created directories
> will be allowed one day, they will face the same problem.
Yes, device will be uncovered if it is there, the same with the
directory.

Use case I have in mind when I wrote this is the following:
assume we have devices named dev1 and dev2, and two jails, j1 and j2,
each with its own devfs mount.
Also, assume that some program A has hardcoded /dev/dev1 as the name of
device to operate, and it is run both in j1 and j2. Further, j1 is given
access to /dev/dev1 only, while j2 is given access to /dev/dev2 only.
Then administrator of j1 can create a symlink /dev/dev -> dev1, while
administrator of j2 symlinks /dev/dev ->dev2, and both j1 and j2 would
operate properly.

This is not that perversed as it sounds, I think it is an essence of
symlink usage on devfs.
> 
> > I remember there was a PR to change devfs_symlink() so that symlink is
> > added to dd_dlist into head, not to a tail, as it is done now.
> 
> kern/114057
> 
> > Assume that all full devfs pathes except symlinks are stored somewhere
> > with type information for the component at the end.
> > Then, just iterating this set at make_dev() time, we can verify that
> > name is not a duplicate, and that the path components are not already
> > used as device name (only as directories).
> > The pathes storage need to be protected by dev_mtx. 
> > 
> > Possibly, the cdev_priv.c_dev.__si_namebuf may be reused at the
> > cost of long check at the make_dev() time.
> 
> Could you elaborate on this? I am not sure if I understand what you mean
> with __si_namebuf reuse.
I mean that we do not to create the structure that mirrors the directory/nodes
hierarchy for devfs dirents, but can dynamically parse __si_namebuf at
the make_dev() time, iterating over all nodes using cdevp_list.

For symlinks, it seems the easiest route is to have separate ref-counted
structures containing the pathes for owning directories.
> 
> > What do you think of this ?
> 
> I don't see anything obviously wrong with it.
> 
> -- 
> Jaakko


pgpctzhUaU8zL.pgp
Description: PGP signature


svn commit: r206662 - head/sys/dev/mxge

2010-04-15 Thread Andrew Gallatin
Author: gallatin
Date: Thu Apr 15 13:50:55 2010
New Revision: 206662
URL: http://svn.freebsd.org/changeset/base/206662

Log:
  Cleanup if_media handling in mxge(4)
  
  - Re-probe xfp / sfp+ socket on link events, in case user
  has changed transceiver
  - correctly report current media to avoid confusing lagg (reported by Panasas)
  - Report link speed  (submitted by yongari)
  
  Reviewed by: yongari (earlier version)
  
  MFC after: 7 days

Modified:
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/mxge/if_mxge_var.h

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Thu Apr 15 12:46:16 2010(r206661)
+++ head/sys/dev/mxge/if_mxge.c Thu Apr 15 13:50:55 2010(r206662)
@@ -883,6 +883,9 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t
case MXGEFW_CMD_ERROR_BUSY:
err = EBUSY;
break;
+   case MXGEFW_CMD_ERROR_I2C_ABSENT:
+   err = ENXIO;
+   break;
default:
device_printf(sc->dev, 
  "mxge: command %d "
@@ -2782,37 +2785,25 @@ static struct mxge_media_type mxge_sfp_m
 };
 
 static void
-mxge_set_media(mxge_softc_t *sc, int type)
+mxge_media_set(mxge_softc_t *sc, int media_type)
 {
-   sc->media_flags |= type;
-   ifmedia_add(&sc->media, sc->media_flags, 0, NULL);
-   ifmedia_set(&sc->media, sc->media_flags);
-}
 
+   
+   ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, 
+   0, NULL);
+   ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | media_type);
+   sc->current_media = media_type;
+   sc->media.ifm_media = sc->media.ifm_cur->ifm_media;
+}
 
-/*
- * Determine the media type for a NIC.  Some XFPs will identify
- * themselves only when their link is up, so this is initiated via a
- * link up interrupt.  However, this can potentially take up to
- * several milliseconds, so it is run via the watchdog routine, rather
- * than in the interrupt handler itself.   This need only be done
- * once, not each time the link is up.
- */
 static void
-mxge_media_probe(mxge_softc_t *sc)
+mxge_media_init(mxge_softc_t *sc)
 {
-   mxge_cmd_t cmd;
-   char *cage_type;
char *ptr;
-   struct mxge_media_type *mxge_media_types = NULL;
-   int i, err, ms, mxge_media_type_entries;
-   uint32_t byte;
-
-   sc->need_media_probe = 0;
+   int i;
 
-   /* if we've already set a media type, we're done */
-   if (sc->media_flags  != (IFM_ETHER | IFM_AUTO))
-   return;
+   ifmedia_removeall(&sc->media);
+   mxge_media_set(sc, IFM_AUTO);
 
/* 
 * parse the product code to deterimine the interface type
@@ -2823,6 +2814,7 @@ mxge_media_probe(mxge_softc_t *sc)
ptr = sc->product_code_string;
if (ptr == NULL) {
device_printf(sc->dev, "Missing product code\n");
+   return;
}
 
for (i = 0; i < 3; i++, ptr++) {
@@ -2835,17 +2827,44 @@ mxge_media_probe(mxge_softc_t *sc)
}
if (*ptr == 'C') {
/* -C is CX4 */
-   mxge_set_media(sc, IFM_10G_CX4);
-   return;
-   }
-   else if (*ptr == 'Q') {
+   sc->connector = MXGE_CX4;
+   mxge_media_set(sc, IFM_10G_CX4);
+   } else if (*ptr == 'Q') {
/* -Q is Quad Ribbon Fiber */
+   sc->connector = MXGE_QRF;
device_printf(sc->dev, "Quad Ribbon Fiber Media\n");
/* FreeBSD has no media type for Quad ribbon fiber */
-   return;
+   } else if (*ptr == 'R') {
+   /* -R is XFP */
+   sc->connector = MXGE_XFP;
+   } else if (*ptr == 'S' || *(ptr +1) == 'S') {
+   /* -S or -2S is SFP+ */
+   sc->connector = MXGE_SFP;
+   } else {
+   device_printf(sc->dev, "Unknown media type: %c\n", *ptr);
}
+}
 
-   if (*ptr == 'R') {
+/*
+ * Determine the media type for a NIC.  Some XFPs will identify
+ * themselves only when their link is up, so this is initiated via a
+ * link up interrupt.  However, this can potentially take up to
+ * several milliseconds, so it is run via the watchdog routine, rather
+ * than in the interrupt handler itself. 
+ */
+static void
+mxge_media_probe(mxge_softc_t *sc)
+{
+   mxge_cmd_t cmd;
+   char *cage_type;
+
+   struct mxge_media_type *mxge_media_types = NULL;
+   int i, err, ms, mxge_media_type_entries;
+   uint32_t byte;
+
+   sc->need_media_probe = 0;
+
+   if (sc->connector == MXGE_XFP) {
/* -R is XFP */
mxge_media_types = mxge_xfp_media_types;
mxge_media_type_entries = 
@@ -2853,9 +2872,7 @@ mxge_media_probe(mxge_softc_t *sc)
sizeof (mxge_xfp_media_types[0]);

svn commit: r206663 - head/sys/dev/mxge

2010-04-15 Thread Andrew Gallatin
Author: gallatin
Date: Thu Apr 15 14:26:52 2010
New Revision: 206663
URL: http://svn.freebsd.org/changeset/base/206663

Log:
  Add missing IFCAP_LINKSTATE to mxge
  
  Submitted by: yongari

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Thu Apr 15 13:50:55 2010(r206662)
+++ head/sys/dev/mxge/if_mxge.c Thu Apr 15 14:26:52 2010(r206663)
@@ -4759,7 +4759,7 @@ mxge_attach(device_t dev)
 
ifp->if_baudrate = IF_Gbps(10UL);
ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 |
-   IFCAP_VLAN_MTU;
+   IFCAP_VLAN_MTU | IFCAP_LINKSTATE;
 #ifdef INET
ifp->if_capabilities |= IFCAP_LRO;
 #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"


Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-15 Thread Attila Nagy

On 04/12/2010 06:37 PM, Luigi Rizzo wrote:

   Bring in geom_sched, support for scheduling disk I/O requests
   in a device independent manner. Also include an example anticipatory
   scheduler, gsched_rr, which gives very nice performance improvements
   in presence of competing random access patterns.

   This is joint work with Fabio Checconi, developed last year
   and presented at BSDCan 2009. You can find details in the
   README file or at
   
Are there any plans to bring in something like Linux's ionice (or even 
better solutions)? Is it possible to do it easily at all (the user and 
GEOM are seemingly very far from each other)?

___
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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-15 Thread Luigi Rizzo
On Thu, Apr 15, 2010 at 04:38:23PM +0200, Attila Nagy wrote:
> On 04/12/2010 06:37 PM, Luigi Rizzo wrote:
> >   Bring in geom_sched, support for scheduling disk I/O requests
> >   in a device independent manner. Also include an example anticipatory
> >   scheduler, gsched_rr, which gives very nice performance improvements
> >   in presence of competing random access patterns.
> >
> >   This is joint work with Fabio Checconi, developed last year
> >   and presented at BSDCan 2009. You can find details in the
> >   README file or at
> >   
> Are there any plans to bring in something like Linux's ionice (or even 
> better solutions)? Is it possible to do it easily at all (the user and 
> GEOM are seemingly very far from each other)?

I can easily[*] modify the I/O priority/weight of process or threads,
but you have to keep in mind that once a request is intercepted by
the filesystem code (e.g. for delayed writes, or avoid duplication
of pending reads), by the time it hits the disk it is not trivial
to tell who should be charged for it.

This is an area where we still need to experiment a bit
(especially to find on which process issues which request,
say for metadata, delayed writes, shared reads).

[*] the 'easy' way is put the information in an external hash table
and look it up using as a search key either of uid, gid, .  I think we did something like this in the GSOC2005
project on disk scheduling.  A more intrusive way involves extending
the struct thread with an extra field to store the io priority.

cheers
luigi
___
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: r206664 - head/usr.sbin/config

2010-04-15 Thread Warner Losh
Author: imp
Date: Thu Apr 15 15:10:46 2010
New Revision: 206664
URL: http://svn.freebsd.org/changeset/base/206664

Log:
  Allow option aliasing.  Lines of the form:
  
  OLD_OPT = NEW_OPT
  
  in options* files will now map OLD_OPT to NEW_OPT with a friendly
  message.  This is indented for situations where we need to preserve an
  interface in the config file in an upwards compatible fashion on a
  stable branch.
  
  Reviewed by:  nwhitehorn@
  MFC after:3 days

Modified:
  head/usr.sbin/config/config.h
  head/usr.sbin/config/mkoptions.c

Modified: head/usr.sbin/config/config.h
==
--- head/usr.sbin/config/config.h   Thu Apr 15 14:26:52 2010
(r206663)
+++ head/usr.sbin/config/config.h   Thu Apr 15 15:10:46 2010
(r206664)
@@ -129,6 +129,8 @@ SLIST_HEAD(opt_head, opt) opt, mkopt, rm
 struct opt_list {
char *o_name;
char *o_file;
+   int o_flags;
+#define OL_ALIAS   1
SLIST_ENTRY(opt_list) o_next;
 };
 

Modified: head/usr.sbin/config/mkoptions.c
==
--- head/usr.sbin/config/mkoptions.cThu Apr 15 14:26:52 2010
(r206663)
+++ head/usr.sbin/config/mkoptions.cThu Apr 15 15:10:46 2010
(r206664)
@@ -94,6 +94,17 @@ options(void)
SLIST_INSERT_HEAD(&opt, op, op_next);
 
read_options();
+   SLIST_FOREACH(op, &opt, op_next) {
+   SLIST_FOREACH(ol, &otab, o_next) {
+   if (eq(op->op_name, ol->o_name) &&
+   (ol->o_flags & OL_ALIAS)) {
+   printf("Mapping option %s to %s.\n",
+   op->op_name, ol->o_file);
+   op->op_name = ol->o_file;
+   break;
+   }
+   }
+   }
SLIST_FOREACH(ol, &otab, o_next)
do_option(ol->o_name);
SLIST_FOREACH(op, &opt, op_next) {
@@ -124,7 +135,6 @@ do_option(char *name)
int tidy;
 
file = tooption(name);
-
/*
 * Check to see if the option was specified..
 */
@@ -292,6 +302,7 @@ read_options(void)
struct opt_list *po;
int first = 1;
char genopt[MAXPATHLEN];
+   int flags = 0;
 
SLIST_INIT(&otab);
(void) snprintf(fname, sizeof(fname), "../../conf/options");
@@ -301,6 +312,7 @@ openit:
return;
}
 next:
+   flags = 0;
wd = get_word(fp);
if (wd == (char *)EOF) {
(void) fclose(fp);
@@ -332,6 +344,18 @@ next:
(void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s));
val = genopt;
free(s);
+   } else if (eq(val, "=")) {
+   val = get_word(fp);
+   if (val == (char *)EOF) {
+   printf("%s: unexpected end of file\n", fname);
+   exit(1);
+   }
+   if (val == 0) {
+   printf("%s: Expected a right hand side at %s\n", fname,
+   this);
+   exit(1);
+   }
+   flags |= OL_ALIAS;
}
val = ns(val);
 
@@ -348,6 +372,7 @@ next:
err(EXIT_FAILURE, "calloc");
po->o_name = this;
po->o_file = val;
+   po->o_flags = flags;
SLIST_INSERT_HEAD(&otab, po, o_next);
 
goto next;
___
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: r206665 - head/sys/geom/eli

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Apr 15 16:34:06 2010
New Revision: 206665
URL: http://svn.freebsd.org/changeset/base/206665

Log:
  Use lower priority for GELI worker threads. This improves system
  responsiveness under heavy GELI load.
  
  MFC after:3 days

Modified:
  head/sys/geom/eli/g_eli.c

Modified: head/sys/geom/eli/g_eli.c
==
--- head/sys/geom/eli/g_eli.c   Thu Apr 15 15:10:46 2010(r206664)
+++ head/sys/geom/eli/g_eli.c   Thu Apr 15 16:34:06 2010(r206665)
@@ -340,7 +340,7 @@ g_eli_worker(void *arg)
}
 #endif
thread_lock(curthread);
-   sched_prio(curthread, PRIBIO);
+   sched_prio(curthread, PUSER);
if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0)
sched_bind(curthread, wr->w_number);
thread_unlock(curthread);
@@ -361,8 +361,7 @@ g_eli_worker(void *arg)
mtx_unlock(&sc->sc_queue_mtx);
kproc_exit(0);
}
-   msleep(sc, &sc->sc_queue_mtx, PRIBIO | PDROP,
-   "geli:w", 0);
+   msleep(sc, &sc->sc_queue_mtx, PDROP, "geli:w", 0);
continue;
}
mtx_unlock(&sc->sc_queue_mtx);
___
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: r206666 - head/sbin/geom/misc

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Apr 15 16:35:34 2010
New Revision: 20
URL: http://svn.freebsd.org/changeset/base/20

Log:
  Flush disk write cache after storing and clearing metadata.

Modified:
  head/sbin/geom/misc/subr.c

Modified: head/sbin/geom/misc/subr.c
==
--- head/sbin/geom/misc/subr.c  Thu Apr 15 16:34:06 2010(r206665)
+++ head/sbin/geom/misc/subr.c  Thu Apr 15 16:35:34 2010(r20)
@@ -236,6 +236,7 @@ g_metadata_store(const char *name, u_cha
error = errno;
goto out;
}
+   (void)ioctl(fd, DIOCGFLUSH, NULL);
 out:
if (sector != NULL)
free(sector);
@@ -293,6 +294,7 @@ g_metadata_clear(const char *name, const
error = errno;
goto out;
}
+   (void)ioctl(fd, DIOCGFLUSH, NULL);
 out:
if (sector != NULL)
free(sector);
___
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: r206667 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Apr 15 16:40:54 2010
New Revision: 206667
URL: http://svn.freebsd.org/changeset/base/206667

Log:
  Fix 3-way deadlock that can happen because of ZFS and vnode lock
  order reversal.
  
  thread0 (vfs_fhtovp)  thread1 (vop_getattr)   thread2 (zfs_recv)
    -   --
vn_lock
  rrw_enter_read
rrw_enter_write (hangs)
rrw_enter_read (hangs)
  vn_lock (hangs)
  
  Submitted by: Attila Nagy 
  MFC after:3 days

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cThu Apr 
15 16:35:34 2010(r20)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cThu Apr 
15 16:40:54 2010(r206667)
@@ -868,13 +868,15 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
ZFS_ENTER_NOERROR(zfsvfs);
 
error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp);
+
+   ZFS_EXIT(zfsvfs);
+
if (error == 0) {
*vpp = ZTOV(rootzp);
error = vn_lock(*vpp, flags);
(*vpp)->v_vflag |= VV_ROOT;
}
 
-   ZFS_EXIT(zfsvfs);
return (error);
 }
 
@@ -1143,13 +1145,13 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla
VN_RELE(ZTOV(zp));
err = EINVAL;
}
+   ZFS_EXIT(zfsvfs);
if (err != 0)
*vpp = NULL;
else {
*vpp = ZTOV(zp);
vn_lock(*vpp, flags);
}
-   ZFS_EXIT(zfsvfs);
return (err);
 }
 
@@ -1237,8 +1239,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
} else {
VN_HOLD(*vpp);
}
-   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
ZFS_EXIT(zfsvfs);
+   vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
return (0);
}
 
@@ -1259,10 +1261,11 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
return (EINVAL);
}
 
+   ZFS_EXIT(zfsvfs);
+
*vpp = ZTOV(zp);
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
vnode_create_vobject(*vpp, zp->z_phys->zp_size, curthread);
-   ZFS_EXIT(zfsvfs);
return (0);
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Apr 
15 16:35:34 2010(r20)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Apr 
15 16:40:54 2010(r206667)
@@ -1209,15 +1209,17 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
ltype = VOP_ISLOCKED(dvp);
VOP_UNLOCK(dvp, 0);
}
+   ZFS_EXIT(zfsvfs);
error = vn_lock(*vpp, cnp->cn_lkflags);
if (cnp->cn_flags & ISDOTDOT)
vn_lock(dvp, ltype | LK_RETRY);
if (error != 0) {
VN_RELE(*vpp);
*vpp = NULL;
-   ZFS_EXIT(zfsvfs);
return (error);
}
+   } else {
+   ZFS_EXIT(zfsvfs);
}
 
 #ifdef FREEBSD_NAMECACHE
@@ -1237,8 +1239,6 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
}
 #endif
 
-   ZFS_EXIT(zfsvfs);
-
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: r206668 - head/etc/mtree

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Apr 15 16:43:43 2010
New Revision: 206668
URL: http://svn.freebsd.org/changeset/base/206668

Log:
  Use spaces instead of tab for indent here.

Modified:
  head/etc/mtree/BSD.include.dist

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Thu Apr 15 16:40:54 2010
(r206667)
+++ head/etc/mtree/BSD.include.dist Thu Apr 15 16:43:43 2010
(r206668)
@@ -104,8 +104,8 @@
 ..
 lmc
 ..
-   mfi
-   ..
+mfi
+..
 mpt
 mpilib
 ..
___
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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-15 Thread Ulrich Spörlein
On Thu, 15.04.2010 at 17:15:57 +0200, Luigi Rizzo wrote:
> On Thu, Apr 15, 2010 at 04:38:23PM +0200, Attila Nagy wrote:
> > On 04/12/2010 06:37 PM, Luigi Rizzo wrote:
> > >   Bring in geom_sched, support for scheduling disk I/O requests
> > >   in a device independent manner. Also include an example anticipatory
> > >   scheduler, gsched_rr, which gives very nice performance improvements
> > >   in presence of competing random access patterns.
> > >
> > >   This is joint work with Fabio Checconi, developed last year
> > >   and presented at BSDCan 2009. You can find details in the
> > >   README file or at
> > >   
> > Are there any plans to bring in something like Linux's ionice (or even 
> > better solutions)? Is it possible to do it easily at all (the user and 
> > GEOM are seemingly very far from each other)?
> 
> I can easily[*] modify the I/O priority/weight of process or threads,
> but you have to keep in mind that once a request is intercepted by
> the filesystem code (e.g. for delayed writes, or avoid duplication
> of pending reads), by the time it hits the disk it is not trivial
> to tell who should be charged for it.
> 
> This is an area where we still need to experiment a bit
> (especially to find on which process issues which request,
> say for metadata, delayed writes, shared reads).
> 
> [*] the 'easy' way is put the information in an external hash table
> and look it up using as a search key either of uid, gid,  thread *>.  I think we did something like this in the GSOC2005
> project on disk scheduling.  A more intrusive way involves extending
> the struct thread with an extra field to store the io priority.

What would already be helpful, is an I/O time measurement of the overall
system and have that displayed in, eg., vmstat like Linux and Solaris
do. It gives a better measure of if a system is CPU bound or I/O bound
or neither.

Can the scheduler help here?

Uli
___
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: r206669 - head/sbin/hastd

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Apr 15 17:04:08 2010
New Revision: 206669
URL: http://svn.freebsd.org/changeset/base/206669

Log:
  Increase ggate queue size to maximum value.
  HAST was not able to stand heavy random load.
  
  Reported by:  Hiroyuki Yamagami
  MFC after:3 days

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Thu Apr 15 16:43:43 2010(r206668)
+++ head/sbin/hastd/primary.c   Thu Apr 15 17:04:08 2010(r206669)
@@ -682,7 +682,7 @@ init_ggate(struct hast_resource *res)
ggiocreate.gctl_mediasize = res->hr_datasize;
ggiocreate.gctl_sectorsize = res->hr_local_sectorsize;
ggiocreate.gctl_flags = 0;
-   ggiocreate.gctl_maxcount = 128;
+   ggiocreate.gctl_maxcount = G_GATE_MAX_QUEUE_SIZE;
ggiocreate.gctl_timeout = 0;
ggiocreate.gctl_unit = G_GATE_NAME_GIVEN;
snprintf(ggiocreate.gctl_name, sizeof(ggiocreate.gctl_name), "hast/%s",
___
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: r206452 - head/sys/netinet

2010-04-15 Thread Bruce Simpson

On 04/10/10 13:05, Bruce M Simpson wrote:

Log:
   Fix a few issues related to the legacy 4.4 BSD multicast APIs.

   IPv4 addresses can and do change during normal operation. Testing by
   pfSense developers exposed an issue where OpenOSPFD was using the IPv4
   address to leave the OSPF link-scope multicast groups on a dynamic
   OpenVPN tun interface, rather than using RFC 3678 with the interface
   index, which won't be raced when the interface's addresses change.
   


I should point out that IP multicast is counter-intuitive in many areas. 
It seems that knowledge of how to work with it effectively is not that 
widespread. People who have a need to use it, often have very specific 
requirements.


IP multicast group membership is always scoped to physical links [1]. 
The 4.4BSD API originally used the "primary IP address" to identify each 
link. Unfortunately this is not a persistent identifier, especially so 
in the use-case which had problems.


In the updated API specified in RFC 3678, the primary key for multicast 
memberships, changes to the interface index. routed(8) in FreeBSD's SVN 
tree uses this new API; thanks to phk for reviewing and testing my change.


In the case of OpenOSPFD+OpenVPN, the issue manifested itself in 
situations where this "primary IP address" changed. OpenVPN shims 
address assignment as part of its wire protocol, which is where the 
address change originates.


This is purely a by-product of using an API which depends on using an 
IPv4 address as a key (IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP), when that 
key may change at any time.


There's some time domain uncertainty with that change. PF_ROUTE is an 
out-of-band mechanism used by OpenOSPFD to learn about the address 
change, and it is dispatched separately from the change itself; there 
may be queueing and context switches involved. It also creates some 
ambiguity for in_multi instances, which the kernel may not be able to 
resolve, if that key has been blown away. Fortunately, such ambiguity is 
private to each socket.


Furthermore, this makes IGMP somewhat unreliable, although mechanisms do 
exist in the protocol to work-around the end-station's identifier being 
lost in this way. The upstream IGMP querier (usually the mcast router) 
will hold state based on the end-station's "primary IP address", this 
will eventually time out due to unanswered queries.


MLD side-steps this by always requiring an IPv6 link-scope address in 
control traffic. Using the more recent multicast RFCs, supported now by 
Windows, Linux, OpenSolaris, and now FreeBSD, can side-step these 
issues; it is the preferred API.


P.S. HEAD was probably already resilient against this for joins. I plan 
to MFC a similar version of this change to 8 soon.


[1] sendto() to an IP multicast address, without an interface specified, 
makes no sense -- unless the host is also an mcast forwarder. You can 
get away with default route resolution through the routing tables up to 
a point, but if your box is multihomed, all bets are off.

___
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: r206671 - head/sys/kern

2010-04-15 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 15 17:17:02 2010
New Revision: 206671
URL: http://svn.freebsd.org/changeset/base/206671

Log:
  Fix typo.
  
  MFC after:3 days

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Apr 15 17:10:46 2010(r206670)
+++ head/sys/kern/vfs_cache.c   Thu Apr 15 17:17:02 2010(r206671)
@@ -610,7 +610,7 @@ cache_enter(dvp, vp, cnp)
 
CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp,
-   ("cahe_enter: Adding a doomed vnode"));
+   ("cache_enter: Adding a doomed vnode"));
 
if (!doingcache)
return;
___
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: r206672 - head/sys/dev/sge

2010-04-15 Thread Pyun YongHyeon
Author: yongari
Date: Thu Apr 15 17:24:21 2010
New Revision: 206672
URL: http://svn.freebsd.org/changeset/base/206672

Log:
  Fix include path.

Modified:
  head/sys/dev/sge/if_sge.c

Modified: head/sys/dev/sge/if_sge.c
==
--- head/sys/dev/sge/if_sge.c   Thu Apr 15 17:17:02 2010(r206671)
+++ head/sys/dev/sge/if_sge.c   Thu Apr 15 17:24:21 2010(r206672)
@@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "if_sgereg.h"
+#include 
 
 MODULE_DEPEND(sge, pci, 1, 1, 1);
 MODULE_DEPEND(sge, ether, 1, 1, 1);
___
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: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-15 Thread Poul-Henning Kamp
In message <20100415164922.gd92...@acme.spoerlein.net>, Ulrich =?utf-8?B?U3DDtn
JsZWlu?= writes:

>What would already be helpful, is an I/O time measurement of the overall
>system and have that displayed in, eg., vmstat like Linux and Solaris
>do. It gives a better measure of if a system is CPU bound or I/O bound
>or neither.

gstat(8) ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
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: r206675 - head/contrib/netcat

2010-04-15 Thread Xin LI
Author: delphij
Date: Thu Apr 15 19:15:05 2010
New Revision: 206675
URL: http://svn.freebsd.org/changeset/base/206675

Log:
  Diff reduction with OpenBSD:
  
   - Remove unused locally added variable;
   - Deprecate -o: it's the default behavior on OpenBSD.
  
  X-MFC:along with nc 4.7.

Modified:
  head/contrib/netcat/nc.1
  head/contrib/netcat/netcat.c

Modified: head/contrib/netcat/nc.1
==
--- head/contrib/netcat/nc.1Thu Apr 15 18:30:21 2010(r206674)
+++ head/contrib/netcat/nc.1Thu Apr 15 19:15:05 2010(r206675)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 23, 2010
+.Dd April 15, 2010
 .Dt NC 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Sh SYNOPSIS
 .Nm nc
 .Bk -words
-.Op Fl 46DdEhklnorStUuvz
+.Op Fl 46DdEhklnrStUuvz
 .Op Fl e Ar IPsec_policy
 .Op Fl I Ar length
 .Op Fl i Ar interval
@@ -159,15 +159,6 @@ socket option.
 .It Fl O Ar length
 Specifies the size of the TCP send buffer.
 When
-.It Fl o
-.Dq Once-only mode .
-By default,
-.Nm
-does not terminate on EOF condition on input,
-but continues until the network side has been closed down.
-Specifying
-.Fl o
-will make it terminate on EOF as well.
 .It Fl P Ar proxy_username
 Specifies a username to present to a proxy server that requires authentication.
 If no username is specified then authentication will not be attempted.

Modified: head/contrib/netcat/netcat.c
==
--- head/contrib/netcat/netcat.cThu Apr 15 18:30:21 2010
(r206674)
+++ head/contrib/netcat/netcat.cThu Apr 15 19:15:05 2010
(r206675)
@@ -72,14 +72,12 @@
 #define PORT_MAX_LEN   6
 
 /* Command Line Options */
-intEflag;  /* Use IPsec ESP */
 intdflag;  /* detached, no stdin */
 unsigned int iflag;/* Interval Flag */
 intjflag;  /* use jumbo frames if we can */
 intkflag;  /* More than one connect */
 intlflag;  /* Bind to local port */
 intnflag;  /* Don't do name look up */
-intoflag;  /* Once only: stop on EOF */
 intFreeBSD_Oflag;  /* Do not use TCP options */
 char   *Pflag; /* Proxy username */
 char   *pflag; /* Localport flag */
@@ -151,7 +149,7 @@ main(int argc, char *argv[])
sv = NULL;
 
while ((ch = getopt_long(argc, argv,
-   "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z",
+   "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z",
longopts, NULL)) != -1) {
switch (ch) {
case '4':
@@ -214,7 +212,7 @@ main(int argc, char *argv[])
nflag = 1;
break;
case 'o':
-   oflag = 1;
+   fprintf(stderr, "option -o is deprecated.\n");
break;
case 'P':
Pflag = optarg;
@@ -282,8 +280,6 @@ main(int argc, char *argv[])
case 'T':
Tflag = parse_iptos(optarg);
break;
-   case 0:
-   break;
default:
usage(1);
}
@@ -729,10 +725,9 @@ readwrite(int nfd)
}
 
if (!dflag && pfd[1].revents & POLLIN) {
-   if ((n = read(wfd, buf, plen)) < 0 ||
-   (oflag && n == 0)) {
+   if ((n = read(wfd, buf, plen)) < 0)
return;
-   } else if (n == 0) {
+   else if (n == 0) {
shutdown(nfd, SHUT_WR);
pfd[1].fd = -1;
pfd[1].events = 0;
@@ -945,7 +940,6 @@ help(void)
\t-nSuppress name/port resolutions\n\
\t--no-tcpopt   Disable TCP options\n\
\t-O length TCP send buffer length\n\
-   \t-oTerminate on EOF on input\n\
\t-P proxyuser\tUsername for proxy authentication\n\
\t-p port\t Specify local port for remote connects\n\
\t-rRandomize remote ports\n\
@@ -995,9 +989,9 @@ usage(int ret)
 {
fprintf(stderr,
 #ifdef IPSEC
-   "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i 
interval] [-O length]\n"
+   "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i 
interval] [-O length]\n"
 #else
-   "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O 
length]\n"
+   "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O 
length]\n"
 #endif
"\t 

svn commit: r206684 - head/sys/dev/hwpmc

2010-04-15 Thread Fabien Thomas
Author: fabient
Date: Thu Apr 15 19:45:03 2010
New Revision: 206684
URL: http://svn.freebsd.org/changeset/base/206684

Log:
  - Fix a typo OFFCORE_REQUESTS.ANY.RFO is B0H10H and not 80H10H.
  - Enable missing PARTIAL_ADDRESS_ALIAS for Core i7.
  
  MFC after: 3 days

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/pmc_events.h

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 15 19:31:21 2010
(r206683)
+++ head/sys/dev/hwpmc/hwpmc_core.c Thu Apr 15 19:45:03 2010
(r206684)
@@ -603,7 +603,7 @@ static struct iap_event_descr iap_events
 IAPDESCR(06H_0FH, 0x06, 0x0F, IAP_F_FM | IAP_F_I7O),
 
 IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2),
-IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM),
+IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | 
IAP_F_WM),
 IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2),
 IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2),
 IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA),
@@ -1053,6 +1053,7 @@ static struct iap_event_descr iap_events
 IAPDESCR(B0H_02H, 0xB0, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
 IAPDESCR(B0H_04H, 0xB0, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
 IAPDESCR(B0H_08H, 0xB0, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
+IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
 IAPDESCR(B0H_20H, 0xB0, 0x20, IAP_F_FM | IAP_F_I7O),
 IAPDESCR(B0H_40H, 0xB0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
 IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O),

Modified: head/sys/dev/hwpmc/pmc_events.h
==
--- head/sys/dev/hwpmc/pmc_events.h Thu Apr 15 19:31:21 2010
(r206683)
+++ head/sys/dev/hwpmc/pmc_events.h Thu Apr 15 19:45:03 2010
(r206684)
@@ -2207,7 +2207,7 @@ __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND.
 __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND.READ_CODE", IAP_EVENT_B0H_02H) \
 __PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND.RFO", IAP_EVENT_B0H_04H)   \
 __PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.READ", IAP_EVENT_B0H_08H) \
-__PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.RFO", IAP_EVENT_80H_10H)  \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY.RFO", IAP_EVENT_B0H_10H)  \
 __PMC_EV_ALIAS("OFFCORE_REQUESTS.L1D_WRITEBACK", IAP_EVENT_B0H_40H)\
 __PMC_EV_ALIAS("OFFCORE_REQUESTS.ANY", IAP_EVENT_B0H_80H)  \
 __PMC_EV_ALIAS("UOPS_EXECUTED.PORT0", IAP_EVENT_B1H_01H)   \
___
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: r206686 - head/etc

2010-04-15 Thread Doug Barton
Author: dougb
Date: Thu Apr 15 21:18:24 2010
New Revision: 206686
URL: http://svn.freebsd.org/changeset/base/206686

Log:
  If a service is running, make 'stop' work even if ${name}_enable
  is not set.
  
  PR:   conf/130414
  Submitted by: Dominic Fandrey 
  Reviewed by:  freebsd-rc@

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==
--- head/etc/rc.subrThu Apr 15 20:48:57 2010(r206685)
+++ head/etc/rc.subrThu Apr 15 21:18:24 2010(r206686)
@@ -646,12 +646,12 @@ run_rc_command()
if [ "$_elem" != "$rc_arg" ]; then
continue
fi
-   # if ${rcvar} is set, and $1 is not
-   # "rcvar", then run
+   # if ${rcvar} is set, $1 is not "rcvar"
+   # and ${rc_pid} is not set, then run
#   checkyesno ${rcvar}
# and return if that failed
#
-   if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
+   if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a -z "${rc_pid}" ]; 
then
if ! checkyesno ${rcvar}; then
if [ -n "${rc_quiet}" ]; then
return 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"


Re: svn commit: r205954 - head/include

2010-04-15 Thread David Schultz
On Wed, Mar 31, 2010, Juli Mallett wrote:
>   Be like stdlib.h and bring in a wchar_t definition and use it to prototype
>   wcstoimax and wcstoumax, rather than spelling it __wchar_t.  This is 
> necessary
>   to use these functions in C++ where wchar_t is different to __wchar_t and is
>   a built-in type.

I don't think this change is correct for C mode.  POSIX says
wchar_t is *supposed* to be defined by stdlib.h and wchar.h, but
its definition is namespace pollution elsewhere.

>   It may be better to use __wchar_t here and to simply define __wchar_t as 
> being
>   wchar_t in C++ mode rather than to bring in wchar_t

That may be better.
___
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: r206687 - head/usr.bin/indent

2010-04-15 Thread Andriy Gapon
Author: avg
Date: Thu Apr 15 21:41:07 2010
New Revision: 206687
URL: http://svn.freebsd.org/changeset/base/206687

Log:
  indent(1): don't treat bare '_t' as a type name when -ta is used
  
  It seems that identifier "_t" is sometimes used as a variable name,
  even in our tree.  Not that I endorse that, but still it's better
  to require at least one character before _t suffix to consider
  an identifier to be a type name.
  
  Reported by:  Alex Vasylenko 
  MFC after:1 week

Modified:
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/lexi.c
==
--- head/usr.bin/indent/lexi.c  Thu Apr 15 21:18:24 2010(r206686)
+++ head/usr.bin/indent/lexi.c  Thu Apr 15 21:41:07 2010(r206687)
@@ -251,9 +251,10 @@ lexi(void)
 
if (auto_typedefs) {
const char *q = s_token;
+   size_t q_len = strlen(q);
/* Check if we have an "_t" in the end */
-   if (q[0] && q[1] &&
-   (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+   if (q_len > 2 &&
+   (strcmp(q + q_len - 2, "_t") == 0)) {
ps.its_a_keyword = true;
ps.last_u_d = true;
goto found_auto_typedef;
___
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: r206688 - in head/sys/fs: nfs nfsclient

2010-04-15 Thread Rick Macklem
Author: rmacklem
Date: Thu Apr 15 22:57:30 2010
New Revision: 206688
URL: http://svn.freebsd.org/changeset/base/206688

Log:
  The experimental NFS client was not filling in recovery credentials
  for opens done locally in the client when a delegation for the file
  was held. This could cause the client to crash in crsetgroups() when
  recovering from a server crash/reboot. This patch fills in the
  recovery credentials for this case, in order to avoid the client crash.
  Also, add KASSERT()s to the credential copy functions, to catch any
  other cases where the credentials aren't filled in correctly.
  
  MFC after:1 week

Modified:
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfs/nfsclstate.h
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clrpcops.c
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfs/nfs_commonport.c
==
--- head/sys/fs/nfs/nfs_commonport.cThu Apr 15 21:41:07 2010
(r206687)
+++ head/sys/fs/nfs/nfs_commonport.cThu Apr 15 22:57:30 2010
(r206688)
@@ -225,6 +225,8 @@ void
 newnfs_copycred(struct nfscred *nfscr, struct ucred *cr)
 {
 
+   KASSERT(nfscr->nfsc_ngroups >= 0,
+   ("newnfs_copycred: negative nfsc_ngroups"));
cr->cr_uid = nfscr->nfsc_uid;
crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups);
 }

Modified: head/sys/fs/nfs/nfsclstate.h
==
--- head/sys/fs/nfs/nfsclstate.hThu Apr 15 21:41:07 2010
(r206687)
+++ head/sys/fs/nfs/nfsclstate.hThu Apr 15 22:57:30 2010
(r206688)
@@ -140,6 +140,7 @@ struct nfsclopen {
 #defineNFSCLOPEN_OK0
 #defineNFSCLOPEN_DOOPEN1
 #defineNFSCLOPEN_DOOPENDOWNGRADE 2
+#defineNFSCLOPEN_SETCRED   3
 
 struct nfscllockowner {
LIST_ENTRY(nfscllockowner) nfsl_list;

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Thu Apr 15 21:41:07 2010
(r206687)
+++ head/sys/fs/nfsclient/nfs_clport.c  Thu Apr 15 22:57:30 2010
(r206688)
@@ -978,6 +978,8 @@ newnfs_copyincred(struct ucred *cr, stru
 {
int i;
 
+   KASSERT(cr->cr_ngroups >= 0,
+   ("newnfs_copyincred: negative cr_ngroups"));
nfscr->nfsc_uid = cr->cr_uid;
nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, NFS_MAXGRPS + 1);
for (i = 0; i < nfscr->nfsc_ngroups; i++)

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==
--- head/sys/fs/nfsclient/nfs_clrpcops.cThu Apr 15 21:41:07 2010
(r206687)
+++ head/sys/fs/nfsclient/nfs_clrpcops.cThu Apr 15 22:57:30 2010
(r206688)
@@ -278,7 +278,13 @@ else printf(" fhl=0\n");
error = EIO;
}
newnfs_copyincred(cred, &op->nfso_cred);
-   }
+   } else if (ret == NFSCLOPEN_SETCRED)
+   /*
+* This is a new local open on a delegation. It needs
+* to have credentials so that an open can be done
+* against the server during recovery.
+*/
+   newnfs_copyincred(cred, &op->nfso_cred);
 
/*
 * nfso_opencnt is the count of how many VOP_OPEN()s have

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 21:41:07 2010
(r206687)
+++ head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 22:57:30 2010
(r206688)
@@ -274,8 +274,13 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i
*owpp = owp;
if (opp != NULL)
*opp = op;
-   if (retp != NULL)
-   *retp = NFSCLOPEN_OK;
+   if (retp != NULL) {
+   if (nfhp != NULL && dp != NULL && nop == NULL)
+   /* new local open on delegation */
+   *retp = NFSCLOPEN_SETCRED;
+   else
+   *retp = NFSCLOPEN_OK;
+   }
 
/*
 * Now, check the mode on the open and return the appropriate
___
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: r206689 - head/contrib/netcat

2010-04-15 Thread Xin LI
Author: delphij
Date: Thu Apr 15 23:21:24 2010
New Revision: 206689
URL: http://svn.freebsd.org/changeset/base/206689

Log:
  Utilize IP_BINDANY which provided the same semantics of OpenBSD's
  SO_BINDANY.

Modified:
  head/contrib/netcat/netcat.c

Modified: head/contrib/netcat/netcat.c
==
--- head/contrib/netcat/netcat.cThu Apr 15 22:57:30 2010
(r206688)
+++ head/contrib/netcat/netcat.cThu Apr 15 23:21:24 2010
(r206689)
@@ -570,10 +570,8 @@ remote_connect(const char *host, const c
if (sflag || pflag) {
struct addrinfo ahints, *ares;
 
-#ifdef SO_BINDANY
-   /* try SO_BINDANY, but don't insist */
-   setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on));
-#endif
+   /* try IP_BINDANY, but don't insist */
+   setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on));
memset(&ahints, 0, sizeof(struct addrinfo));
ahints.ai_family = res0->ai_family;
ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
___
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: r206690 - head/sys/fs/nfsclient

2010-04-15 Thread Rick Macklem
Author: rmacklem
Date: Thu Apr 15 23:56:05 2010
New Revision: 206690
URL: http://svn.freebsd.org/changeset/base/206690

Log:
  Add mutex lock calls to 2 cases in the experimental NFS client's
  renew thread where they were missing.
  
  MFC after:1 week

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 23:21:24 2010
(r206689)
+++ head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 15 23:56:05 2010
(r206690)
@@ -2318,7 +2318,9 @@ nfscl_renewthread(struct nfsclclient *cl
int error, cbpathdown, islept, igotlock, ret, clearok;
 
cred = newnfs_getcred();
+   NFSLOCKCLSTATE();
clp->nfsc_flags |= NFSCLFLAGS_HASTHREAD;
+   NFSUNLOCKCLSTATE();
for(;;) {
newnfs_setroot(cred);
cbpathdown = 0;
@@ -2331,9 +2333,11 @@ nfscl_renewthread(struct nfsclclient *cl
error = nfsrpc_renew(clp, cred, p);
if (error == NFSERR_CBPATHDOWN)
cbpathdown = 1;
-   else if (error == NFSERR_STALECLIENTID)
+   else if (error == NFSERR_STALECLIENTID) {
+   NFSLOCKCLSTATE();
clp->nfsc_flags |= NFSCLFLAGS_RECOVER;
-   else if (error == NFSERR_EXPIRED)
+   NFSUNLOCKCLSTATE();
+   } else if (error == NFSERR_EXPIRED)
(void) nfscl_hasexpired(clp, clidrev, p);
}
 
___
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: r206695 - in head: . sys/mips/include sys/mips/mips

2010-04-15 Thread Juli Mallett
Author: jmallett
Date: Fri Apr 16 02:56:24 2010
New Revision: 206695
URL: http://svn.freebsd.org/changeset/base/206695

Log:
  Remove some unused header files.

Deleted:
  head/sys/mips/include/archtype.h
  head/sys/mips/include/defs.h
  head/sys/mips/include/queue.h
  head/sys/mips/include/rm7000.h
  head/sys/mips/include/segments.h
Modified:
  head/ObsoleteFiles.inc
  head/sys/mips/mips/trap.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Apr 16 02:16:58 2010(r206694)
+++ head/ObsoleteFiles.inc  Fri Apr 16 02:56:24 2010(r206695)
@@ -14,6 +14,14 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100415: [mips] removed unused headers
+.if ${TARGET_ARCH} == "mips"
+OLD_FILES+=usr/include/machine/archtype.h
+OLD_FILES+=usr/include/machine/segments.h
+OLD_FILES+=usr/include/machine/rm7000.h
+OLD_FILES+=usr/include/machine/defs.h
+OLD_FILES+=usr/include/machine/queue.h
+.endif
 # 20100326: [ia64] removed 
 .if ${TARGET_ARCH} == "ia64"
 OLD_FILES+=usr/include/machine/nexusvar.h

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Fri Apr 16 02:16:58 2010(r206694)
+++ head/sys/mips/mips/trap.c   Fri Apr 16 02:56:24 2010(r206695)
@@ -83,8 +83,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 #ifdef DDB
___
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: r206696 - head/sbin/hastd

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Apr 16 06:47:29 2010
New Revision: 206696
URL: http://svn.freebsd.org/changeset/base/206696

Log:
  Fix control socket leak when worker process exits.
  
  Submitted by: Mikolaj Golub 
  MFC after:3 days

Modified:
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Fri Apr 16 02:56:24 2010(r206695)
+++ head/sbin/hastd/hastd.c Fri Apr 16 06:47:29 2010(r206696)
@@ -137,6 +137,7 @@ child_exit(void)
pjdlog_error("Worker process failed (pid=%u, 
status=%d).",
(unsigned int)pid, WEXITSTATUS(status));
}
+   proto_close(res->hr_ctrl);
res->hr_workerpid = 0;
if (res->hr_role == HAST_ROLE_PRIMARY) {
sleep(1);
___
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: r206697 - head/sbin/hastd

2010-04-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Apr 16 06:49:12 2010
New Revision: 206697
URL: http://svn.freebsd.org/changeset/base/206697

Log:
  Fix log size calculation which caused message truncation.
  
  Submitted by: Mikolaj Golub 
  MFC after:3 days

Modified:
  head/sbin/hastd/pjdlog.c

Modified: head/sbin/hastd/pjdlog.c
==
--- head/sbin/hastd/pjdlog.cFri Apr 16 06:47:29 2010(r206696)
+++ head/sbin/hastd/pjdlog.cFri Apr 16 06:49:12 2010(r206697)
@@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debugle
 
len = snprintf(log, sizeof(log), "%s", pjdlog_prefix);
if ((size_t)len < sizeof(log))
-   len = vsnprintf(log + len, sizeof(log) - len, fmt, ap);
+   len += vsnprintf(log + len, sizeof(log) - len, fmt, ap);
if (error != -1 && (size_t)len < sizeof(log)) {
(void)snprintf(log + len, sizeof(log) - len, ": %s.",
strerror(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"