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

2009-05-22 Thread Kostik Belousov
On Fri, May 22, 2009 at 12:11:02AM +0200, Attilio Rao wrote:
> 2009/5/21 Kostik Belousov :
> > On Thu, May 21, 2009 at 07:05:17PM +0200, Attilio Rao wrote:
> >> 2009/5/21 Kostik Belousov :
> >> > On Thu, May 21, 2009 at 09:23:15AM -0700, Scott Long wrote:
> >> >> Kostik Belousov wrote:
> >> >> >We do have the KPI for the callers that cannot drop the locks and need
> >> >> >to do destroy_dev, destroy_dev_sched(9).
> >> >>
> >> >> Good to know, I'll look at destroy_dev_sched().  I'd rather not have to
> >> >> roll my own decoupled version.  And I understand the argument about
> >> >> destroy_dev being a drain point for the API.  However, what about
> >> >> create_dev()?  Making that non-blocking would help a lot.
> >> >
> >> > create_dev() can be made non-blocking, and this is the first argument pro
> >> > Attilio patch.
> >> >
> >> > From the quick look, all that is needed is to replace M_WAITOK with
> >> > M_NOWAIT inside prep_cdevsw() and devfs_alloc(). Untested patch below.
> >> >
> >> > diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
> >> > index 4041911..f470ee8 100644
> >> > --- a/sys/fs/devfs/devfs_devs.c
> >> > +++ b/sys/fs/devfs/devfs_devs.c
> >> > @@ -120,7 +120,7 @@ devfs_alloc(void)
> >> >        struct cdev *cdev;
> >> >        struct timespec ts;
> >> >
> >> > -       cdp = malloc(sizeof *cdp, M_CDEVP, M_USE_RESERVE | M_ZERO | 
> >> > M_WAITOK);
> >> > +       cdp = malloc(sizeof *cdp, M_CDEVP, M_USE_RESERVE | M_ZERO | 
> >> > M_NOWAIT);
> >> >
> >> >        cdp->cdp_dirents = &cdp->cdp_dirent0;
> >> >        cdp->cdp_dirent0 = NULL;
> >> > diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
> >> > index 284f482..acdd44a 100644
> >> > --- a/sys/kern/kern_conf.c
> >> > +++ b/sys/kern/kern_conf.c
> >> > @@ -559,7 +559,7 @@ prep_cdevsw(struct cdevsw *devsw)
> >> >                return;
> >> >        if (devsw->d_flags & D_NEEDGIANT) {
> >> >                dev_unlock();
> >> > -               dsw2 = malloc(sizeof *dsw2, M_DEVT, M_WAITOK);
> >> > +               dsw2 = malloc(sizeof *dsw2, M_DEVT, M_NOWAIT);
> >> >                dev_lock();
> >> >        } else
> >> >                dsw2 = NULL;
> >>
> >> You need to check return values here if it returns NULL.
> >>
> >> IMHO, having a non-sleepable version of destroy_dev(), create_dev()
> >> and such would be ideal.
> >> Ideally, we should resolve all the sleeping point and do the conversion.
> >> I'm unable to check the code right now.
> >
> > Sure. Something like this.
> >
> 
> At this point I wonder what's the purpose of maintaining the sleeping
> version for such functions?
They cannot fail, thus behaving in the way that all present consumers
of the function expect.


pgp07fbCW4cGG.pgp
Description: PGP signature


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

2009-05-22 Thread Robert Watson


On Fri, 22 May 2009, Attilio Rao wrote:


You need to check return values here if it returns NULL.

IMHO, having a non-sleepable version of destroy_dev(), create_dev() and 
such would be ideal. Ideally, we should resolve all the sleeping point and 
do the conversion. I'm unable to check the code right now.


Sure. Something like this.


At this point I wonder what's the purpose of maintaining the sleeping 
version for such functions?


Exceptional case error handling tends to be some of the buggiest code in our 
kernel, due to a nasty combination of added complexity and infrequent 
real-world execution.  It's what leads to an excess of gotos in the network 
stack, tricky unwinding of structure allocation, locking, and global variable 
manipulation, and races due to prematurely exposed partially initialized 
objects on the intersection of subsystems.  Where we can avoid dealing with 
failure unnecessarily, code is simpler and more likely to be correct.  At 
times, this is false economy, as some failures must happen and be handled 
gracefully (such as throughout the network stack during operations like 
m_pullup when driven by ithreads), but in many other cases the win is real.


Robert N M Watson
Computer Laboratory
University of Cambridge
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192577 - head/sys/sys

2009-05-22 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 22 09:59:34 2009
New Revision: 192577
URL: http://svn.freebsd.org/changeset/base/192577

Log:
  Add privileges for Capi4BSD to control:
  - controller reset/firmware loading.
  - controller level tracing and tracing of capi messages of applications
running with different user credentials.
  
  Reviewed by:  rwatson
  MFC after:2 weeks

Modified:
  head/sys/sys/priv.h

Modified: head/sys/sys/priv.h
==
--- head/sys/sys/priv.h Fri May 22 05:11:03 2009(r192576)
+++ head/sys/sys/priv.h Fri May 22 09:59:34 2009(r192577)
@@ -458,9 +458,15 @@
 #define PRIV_CPUCTL_UPDATE 641 /* Update cpu microcode. */
 
 /*
+ * Capi4BSD privileges.
+ */
+#definePRIV_C4B_RESET_CTLR 650 /* Load firmware, reset 
controller. */
+#definePRIV_C4B_TRACE  651 /* Unrestricted CAPI message 
tracing. */
+
+/*
  * Track end of privilege list.
  */
-#define_PRIV_HIGHEST   642
+#define_PRIV_HIGHEST   652
 
 /*
  * Validate that a named privilege is known by the privilege system.  Invalid
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Bruce Evans

On Thu, 21 May 2009, M. Warner Losh wrote:


In message: <20090521110115.ga50...@freebsd.org>
   Alexey Dokuchaev  writes:
: > Given how easy it is to "grep <> /usr/include/sys/errno.h" or
: > perl -e '$! = <>; print "$!\n";'
: > I'm not sure of the utility of this tool.
:
: User scripts should not depend on presence of system include files.
: Now, just to mention, Nick's suggestion about dropping extra noise
: actually good one.

There's also internationalization that actually happens too, right?
That doesn't happen with grep..


What about with "man errno".  Man pages are slightly more likely to be
present than application (not system) include files, and man should
support localization.  It gives more noise than grepping an include
file, but the noise might be signal and can be filtered.

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


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Dag-Erling Smørgrav
Peter Jeremy  writes:
> Given how easy it is to "grep <> /usr/include/sys/errno.h" or
>   perl -e '$! = <>; print "$!\n";'
> I'm not sure of the utility of this tool.  One downside is that
>   man perror
> will now return perror(1) instead of perror(3)

This is already the case for many system calls and library functions:

basename(3) bind(2) calendar(3) chdir(2) chflags(2) chmod(2) clear(3)
cpuset(2) crypt(3) dialog(3) dirname(3) echo(3) end(3) exec(3) exit(3)
fetch(3) fstat(2) fsync(2) getopt(3) glob(3) hash(3) hexdump(3)
history(3) intro(2) intro(3) kenv(2) kill(2) ktrace(2) link(2) lockf(3)
log(3) login(3) logout(3) md5(3) mkdir(2) mkfifo(2) mktemp(3) nice(3)
nl(3) printf(3) read(2) readlink(2) realpath(3) rmdir(2) rtprio(2)
setenv(3) setfib(2) sha256(3) sleep(3) stat(2) time(3) times(3) trace(3)
truncate(2) ulimit(3) umask(2) uname(3) unlink(2) unsetenv(3) unvis(3)
uuidgen(2) vis(3) wait(2) write(2)

It is easily solved by setting MANSECT in your environment and / or
configuring your editor to search sections 2 and 3 before section 1:

(defvar des-man-sections nil
  "Colon-separated list of manual sections to search")
(defun des-context-help ()
  "Bring up the man page for the word closest to the current point"
  (interactive)
  (if des-man-sections
  (man (format "-S%s %s" des-man-sections (current-word)))
(man (current-word
(defun des-man-page-hook ()
  (make-local-variable 'des-man-sections)
  (setq des-man-sections "3:2:9:4:5:1:8:7:6")
  (local-set-key [f1] 'des-context-help))
(add-hook 'c-mode-common-hook 'des-man-page-hook)

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread Dag-Erling Smørgrav
Rick Macklem  writes:
> Log:
>   Although it should never happen, all the nfsv4 server can do
>   when it runs out of clientids is reboot. I had replaced cpu_reboot()
>   with printf(), since cpu_reboot() doesn't exist for sparc64.
>   This change replaces the printf() with panic(), so the reboot
>   would occur for this highly unlikely occurrence.

Regardless of how improbable this is, wouldn't it be better (and
simpler) to just log an error message and deny further mount requests?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Gabor Kovesdan

Bruce Evans escribió:

On Thu, 21 May 2009, M. Warner Losh wrote:


In message: <20090521110115.ga50...@freebsd.org>
   Alexey Dokuchaev  writes:
: > Given how easy it is to "grep <> /usr/include/sys/errno.h" or
: > perl -e '$! = <>; print "$!\n";'
: > I'm not sure of the utility of this tool.
:
: User scripts should not depend on presence of system include files.
: Now, just to mention, Nick's suggestion about dropping extra noise
: actually good one.

There's also internationalization that actually happens too, right?
That doesn't happen with grep..


What about with "man errno".  Man pages are slightly more likely to be
present than application (not system) include files, and man should
support localization.  It gives more noise than grepping an include
file, but the noise might be signal and can be filtered.
Our man page toolset doesn't really support localization. I haven't done 
big investigations but I remember that lack of ISO8859-2 support 
prevented us from translating man pages into Hungarian. Beside this, it 
isn't a flexible way of listing the error messages there because you 
have to explicitly list them or make some magic to generate the man 
page. But what if a specific translation changes? What if a new 
translation is added? One will have to keep these in sync then. While 
retrieving those messages from C code is trivial and no such 
considerations are needed, so I vote for the perror utility.


--
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: ga...@freebsd.org .:|:. ga...@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org

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


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Robert Watson

On Fri, 22 May 2009, Bruce Evans wrote:


: actually good one.

There's also internationalization that actually happens too, right? That 
doesn't happen with grep..


What about with "man errno".  Man pages are slightly more likely to be 
present than application (not system) include files, and man should support 
localization.  It gives more noise than grepping an include file, but the 
noise might be signal and can be filtered.


For me, at least, a simple text -> errno name ("EPERM") would go a long way, 
since they aren't internationalized strings, and are therefore usable in 
scripts in useful ways.  On the topic of man pages though -- I was interested 
to see that Mac OS X does not ship with an errno(2), despite shipping with a 
BSD-derived errno.h.


Robert N M Watson
Computer Laboratory
University of Cambridge
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Gabor Kovesdan

Robert Watson escribió:

On Fri, 22 May 2009, Bruce Evans wrote:


: actually good one.

There's also internationalization that actually happens too, right? 
That doesn't happen with grep..


What about with "man errno".  Man pages are slightly more likely to 
be present than application (not system) include files, and man 
should support localization.  It gives more noise than grepping an 
include file, but the noise might be signal and can be filtered.


For me, at least, a simple text -> errno name ("EPERM") would go a 
long way, since they aren't internationalized strings, and are 
therefore usable in scripts in useful ways.  On the topic of man pages 
though -- I was interested to see that Mac OS X does not ship with an 
errno(2), despite shipping with a BSD-derived errno.h.
They didn't used to be internationalized strings but since my libc NLS 
commit they are. Now we have quite a few catalogs for common languages 
so it isn't so trivial any more...


--
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: ga...@freebsd.org .:|:. ga...@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org

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


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Bruce Evans

On Fri, 22 May 2009, Robert Watson wrote:


On Fri, 22 May 2009, Bruce Evans wrote:


What about with "man errno".  Man pages are slightly more likely to be 

...
...  On the topic of man pages though -- I was interested 
to see that Mac OS X does not ship with an errno(2), despite shipping with a 
BSD-derived errno.h.


Under FreeBSD, errno.2 is only a link to intro.2.  This link was there in
libc/sys/Makefile.inc rev.1.1.  More than half of intro.2 is about error
numbers.

I expected to find error numbers described in strerror.3 or perror.3.
perror.3 is only a link to sterror.3 (so is sys_errlist.3, which is
probably the right place for documenting the list).  strerror.3 refers
to intro.2 but not errno.2.  errno.2 is referred to mainly in au_token(3)
and its 46 links.

apropos(1) does an especially poor job for errno since it gets spammed
more than usual by links, and errno isn't a function.  It doesn't find
errno(2), intro(2) or strerror(2), but it finds au_bsm_to_errno(3) and
many other functions with errno in their name, and then gets spammed
by links to these; it finds pcap_strerror(3) due to errno in its
description, and it finds perl's Errno(3).

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


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Robert Watson


On Fri, 22 May 2009, Bruce Evans wrote:


On Fri, 22 May 2009, Robert Watson wrote:


On Fri, 22 May 2009, Bruce Evans wrote:


What about with "man errno".  Man pages are slightly more likely to be 

...
...  On the topic of man pages though -- I was interested to see that Mac 
OS X does not ship with an errno(2), despite shipping with a BSD-derived 
errno.h.


Under FreeBSD, errno.2 is only a link to intro.2.  This link was there in 
libc/sys/Makefile.inc rev.1.1.  More than half of intro.2 is about error 
numbers.


And, indeed, there is an intro(2) on Mac OS X that's based on ours (I 
believe), just not an errno(2) symlink.


Thanks,

Robert N M Watson
Computer Laboratory
University of Cambridge
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192578 - in head: etc/rc.d sbin sbin/idmapd sbin/mount_nfs sys sys/conf sys/fs/nfs sys/modules/nfs4client sys/modules/nfsclient sys/nfs4client sys/nfsclient sys/nlm sys/rpc

2009-05-22 Thread Robert Watson
Author: rwatson
Date: Fri May 22 12:35:12 2009
New Revision: 192578
URL: http://svn.freebsd.org/changeset/base/192578

Log:
  Remove the unmaintained University of Michigan NFSv4 client from 8.x
  prior to 8.0-RELEASE.  Rick Macklem's new and more feature-rich NFSv234
  client and server are replacing it.
  
  Discussed with:   rmacklem

Deleted:
  head/etc/rc.d/idmapd
  head/sbin/idmapd/
  head/sys/modules/nfs4client/
  head/sys/nfs4client/
  head/sys/rpc/rpcclnt.c
  head/sys/rpc/rpcclnt.h
Modified:
  head/sbin/Makefile
  head/sbin/mount_nfs/Makefile
  head/sbin/mount_nfs/mount_nfs.8
  head/sbin/mount_nfs/mount_nfs.c
  head/sys/Makefile
  head/sys/conf/files
  head/sys/conf/options
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfsport.h
  head/sys/modules/nfsclient/Makefile
  head/sys/nfsclient/bootp_subr.c
  head/sys/nfsclient/krpc_subr.c
  head/sys/nfsclient/nfs.h
  head/sys/nfsclient/nfs_bio.c
  head/sys/nfsclient/nfs_diskless.c
  head/sys/nfsclient/nfs_krpc.c
  head/sys/nfsclient/nfs_lock.c
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_node.c
  head/sys/nfsclient/nfs_socket.c
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c
  head/sys/nfsclient/nfsm_subs.h
  head/sys/nfsclient/nfsmount.h
  head/sys/nfsclient/nfsnode.h
  head/sys/nlm/nlm_advlock.c

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Fri May 22 09:59:34 2009(r192577)
+++ head/sbin/Makefile  Fri May 22 12:35:12 2009(r192578)
@@ -36,7 +36,6 @@ SUBDIR=   adjkerntz \
ggate \
growfs \
gvinum \
-   idmapd \
ifconfig \
init \
${_ipf} \

Modified: head/sbin/mount_nfs/Makefile
==
--- head/sbin/mount_nfs/MakefileFri May 22 09:59:34 2009
(r192577)
+++ head/sbin/mount_nfs/MakefileFri May 22 12:35:12 2009
(r192578)
@@ -5,15 +5,13 @@
 PROG=  mount_nfs
 SRCS=  mount_nfs.c getmntopts.c mounttab.c
 MAN=   mount_nfs.8
-MLINKS=mount_nfs.8 mount_nfs4.8
+MLINKS=mount_nfs.8
 
 MOUNT= ${.CURDIR}/../mount
 UMNTALL= ${.CURDIR}/../../usr.sbin/rpc.umntall
 CFLAGS+= -DNFS -I${MOUNT} -I${UMNTALL}
 WARNS?=3
 
-LINKS= ${BINDIR}/mount_nfs ${BINDIR}/mount_nfs4
-
 .PATH: ${MOUNT} ${UMNTALL}
 
 .include 

Modified: head/sbin/mount_nfs/mount_nfs.8
==
--- head/sbin/mount_nfs/mount_nfs.8 Fri May 22 09:59:34 2009
(r192577)
+++ head/sbin/mount_nfs/mount_nfs.8 Fri May 22 12:35:12 2009
(r192578)
@@ -36,7 +36,7 @@
 .Nd mount NFS file systems
 .Sh SYNOPSIS
 .Nm
-.Op Fl 234bcdiLlNPsTU
+.Op Fl 23bcdiLlNPsTU
 .Op Fl a Ar maxreadahead
 .Op Fl D Ar deadthresh
 .Op Fl g Ar maxgroups
@@ -157,8 +157,6 @@ then version 2).
 Note that NFS version 2 has a file size limit of 2 gigabytes.
 .It Cm nfsv3
 Use the NFS Version 3 protocol.
-.It Cm nfsv4
-Use the NFS Version 4 protocol.
 .It Cm noconn
 For UDP mount points, do not do a
 .Xr connect 2 .
@@ -303,9 +301,6 @@ Same as
 .It Fl 3
 Same as
 .Fl o Cm nfsv3
-.It Fl 4
-Same as
-.Fl o Cm nfsv4
 .It Fl D
 Same as
 .Fl o Cm deadthresh

Modified: head/sbin/mount_nfs/mount_nfs.c
==
--- head/sbin/mount_nfs/mount_nfs.c Fri May 22 09:59:34 2009
(r192577)
+++ head/sbin/mount_nfs/mount_nfs.c Fri May 22 12:35:12 2009
(r192578)
@@ -1,28 +1,4 @@
 /*
- * copyright (c) 2003
- * the regents of the university of michigan
- * all rights reserved
- * 
- * permission is granted to use, copy, create derivative works and redistribute
- * this software and such derivative works for any purpose, so long as the name
- * of the university of michigan is not used in any advertising or publicity
- * pertaining to the use or distribution of this software without specific,
- * written prior authorization.  if the above copyright notice or any other
- * identification of the university of michigan is included in any copy of any
- * portion of this software, then the disclaimer below must also be included.
- * 
- * this software is provided as is, without representation from the university
- * of michigan as to its fitness for any purpose, and without warranty by the
- * university of michigan of any kind, either express or implied, including
- * without limitation the implied warranties of merchantability and fitness for
- * a particular purpose. the regents of the university of michigan shall not be
- * liable for any damages, including special, indirect, incidental, or
- * consequential damages, with respect to any claim arising out of or in
- * connection with the use of the software, even if it has been or is hereafter
- * advised of the possibility of such damages.
- */
-
-/*
  * Copyright (c) 1992, 1993, 1994
  * The

Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-22 Thread Carlos A. M. dos Santos
On Thu, May 21, 2009 at 6:24 AM, Stanislav Sedov  wrote:
> On Wed, 20 May 2009 19:58:20 -0300
> "Carlos A. M. dos Santos"  mentioned:
>
>> On Wed, May 20, 2009 at 5:01 PM, Peter Jeremy
>>  wrote:
>> > On 2009-May-19 17:40:22 +, "George V. Neville-Neil"  
>> > wrote:
>> >>Log:
>> >>  Add a new program, perror, which takes an errno as a command line 
>> >> argument
>> >>  and outputs the associated textual message in the same way that
>> >>  perror(3) would if called within a program.
>>
>> Rename it to "strerror", please.
>
> Why?

Because the program mimics the behavior of strerror: given an error
number, return the corresponding string.

-- 
My preferred quotation of Robert Louis Stevenson is "You cannot
make an omelette without breaking eggs". Not because I like the
omelettes, but because I like the sound of eggs being broken.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2009-05-22 Thread John Baldwin
On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
> At this point I wonder what's the purpose of maintaining the sleeping
> version for such functions?

Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
much rather the solution for make_dev() be that the 1 or 2 places that need 
to do it with a mutex held instead queue a task to do the actual make_dev() 
in a taskqueue when no locks are held.  This is basically what 
destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
callback to be called on completion would be better.  Having a device driver 
do all the work to setup the hardware only to fail to create a node in /dev 
so that userland can actually use it is pretty rediculous and useless.

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


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

2009-05-22 Thread Robert Watson

On Fri, 22 May 2009, John Baldwin wrote:


On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
At this point I wonder what's the purpose of maintaining the sleeping 
version for such functions?


Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
much rather the solution for make_dev() be that the 1 or 2 places that need 
to do it with a mutex held instead queue a task to do the actual make_dev() 
in a taskqueue when no locks are held.  This is basically what 
destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
callback to be called on completion would be better.  Having a device driver 
do all the work to setup the hardware only to fail to create a node in /dev 
so that userland can actually use it is pretty rediculous and useless.


It's certainly true that we don't support failing calls to if_attach(), on the 
basis that backing out partially successful interface attaches isn't pretty. 
Likewise, if_detach() will drain task queues (etc), so also may sleep.  I 
think it's not unreasonable to require a full thread context for major 
interactions with device/interface registration, etc, and I don't see that 
changing for the network stack.  We're still shaking out bugs from code that 
thinks it's OK to free inpcbs in arbitrary contexts (which it's not, because 
we have to drain timers).


Robert N M Watson
Computer Laboratory
University of Cambridge
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2009-05-22 Thread Scott Long

John Baldwin wrote:

On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:

At this point I wonder what's the purpose of maintaining the sleeping
version for such functions?


Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
much rather the solution for make_dev() be that the 1 or 2 places that need 
to do it with a mutex held instead queue a task to do the actual make_dev() 
in a taskqueue when no locks are held.  This is basically what 
destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
callback to be called on completion would be better.  Having a device driver 
do all the work to setup the hardware only to fail to create a node in /dev 
so that userland can actually use it is pretty rediculous and useless.




It's a lot easier for me to handle a failure of make_dev in CAM than it 
is to decouple the call to it.  Please don't dictate policy.


Scott

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


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

2009-05-22 Thread Kostik Belousov
On Fri, May 22, 2009 at 07:44:18AM -0600, Scott Long wrote:
> John Baldwin wrote:
> >On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
> >>At this point I wonder what's the purpose of maintaining the sleeping
> >>version for such functions?
> >
> >Actually, I still very much do not like using M_NOWAIT needlessly.  I 
> >would much rather the solution for make_dev() be that the 1 or 2 places 
> >that need to do it with a mutex held instead queue a task to do the actual 
> >make_dev() in a taskqueue when no locks are held.  This is basically what 
> >destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
> >callback to be called on completion would be better.  Having a device 
> >driver do all the work to setup the hardware only to fail to create a node 
> >in /dev so that userland can actually use it is pretty rediculous and 
> >useless.
> >
> 
> It's a lot easier for me to handle a failure of make_dev in CAM than it 
> is to decouple the call to it.  Please don't dictate policy.

The second patch I posted yesterday allows to specify the flag that means
"no sleep, could fail" to make_dev. Without the flag, make_dev behaves
in the current fashion, i.e. sleep, cannot fail.

Is this solution suitable for your needs ?


pgpqOxAkw79SO.pgp
Description: PGP signature


svn commit: r192579 - in head/etc: defaults rc.d

2009-05-22 Thread Robert Watson
Author: rwatson
Date: Fri May 22 13:56:16 2009
New Revision: 192579
URL: http://svn.freebsd.org/changeset/base/192579

Log:
  Further idmapd garbage collection -- remove rc.d Makefile reference and
  default settings.
  
  Submitted by: Pawel Worach 

Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/Makefile

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Fri May 22 12:35:12 2009(r192578)
+++ head/etc/defaults/rc.conf   Fri May 22 13:56:16 2009(r192579)
@@ -300,8 +300,6 @@ nfs_client_enable="NO"  # This host is a
 nfs_access_cache="60"  # Client cache timeout in seconds
 nfs_server_enable="NO" # This host is an NFS server (or NO).
 nfs_server_flags="-u -t -n 4"  # Flags to nfsd (if enabled).
-idmapd_enable="NO" # Run the NFS4 id mapper (YES/NO).
-idmapd_flags=""# Additional flags for idmapd.
 mountd_enable="NO" # Run mountd (or NO).
 mountd_flags="-r"  # Flags to mountd (if NFS server enabled).
 weak_mountd_authentication="NO"# Allow non-root mount requests to be 
served.

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Fri May 22 12:35:12 2009(r192578)
+++ head/etc/rc.d/Makefile  Fri May 22 13:56:16 2009(r192579)
@@ -14,7 +14,7 @@ FILES=DAEMON FILESYSTEMS LOGIN NETWORKI
gbde geli geli2 gssd \
hcsecd \
hostapd hostid hostname \
-   idmapd inetd initrandom \
+   inetd initrandom \
ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \
ipnat ipsec ipxrouted \
jail \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192580 - head

2009-05-22 Thread Robert Watson
Author: rwatson
Date: Fri May 22 13:57:44 2009
New Revision: 192580
URL: http://svn.freebsd.org/changeset/base/192580

Log:
  Add University of Michigan removed files to ObsoleteFiles.inc.
  
  Submitted by: Pawel Worach 

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri May 22 13:56:16 2009(r192579)
+++ head/ObsoleteFiles.inc  Fri May 22 13:57:44 2009(r192580)
@@ -14,6 +14,11 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090522: removal of University of Michigan NFSv4 client
+OLD_FILES+=etc/rc.d/idmapd
+OLD_FILES+=sbin/idmapd
+OLD_FILES+=sbin/mount_nfs4
+OLD_FILES+=usr/share/man/man8/mount_nfs4.8.gz
 # 20090417: removal of legacy versions of USB network interface drivers
 OLD_FILES+=usr/include/legacy/dev/usb/if_auereg.h
 OLD_FILES+=usr/include/legacy/dev/usb/if_axereg.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem



On Fri, 22 May 2009, Dag-Erling Smørgrav wrote:


Rick Macklem  writes:

Log:
  Although it should never happen, all the nfsv4 server can do
  when it runs out of clientids is reboot. I had replaced cpu_reboot()
  with printf(), since cpu_reboot() doesn't exist for sparc64.
  This change replaces the printf() with panic(), so the reboot
  would occur for this highly unlikely occurrence.


Regardless of how improbable this is, wouldn't it be better (and
simpler) to just log an error message and deny further mount requests?


Well, it this really is an issue I can just take the check for the
wraparound out and let it continue on.

Why?

Because the likelyhood of a clientid issued 4billion time ago (many
many years aka centuries, in practice) being for a client that still
exists and hasn't rebooted or re-acquired a more recent clientid is
essentialy 0 as well.

In case you haven't done the calculation, 4billion seconds is 136 years.
Since I cannot image a server seeing anything close to 1 new clientid/sec
over an extended period (there could be a burst just after booting), the
wraparound will take centuries to happen (maybe highly unlikely wasn't a
strong enough term).

Just don't worry about it, rick
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r192561 - head/contrib/groff/font/devutf8

2009-05-22 Thread Dmitry Marakasov
* Dag-Erling Smorgrav (d...@freebsd.org) wrote:

> - negation and subtraction: U+2212

I'd warn against using unicode symbols where they're not absolutely
needed. If there's possibility for a piece of man for being copypasted
into e.g. code or command line, there should be plain ASCII. Especially
that goes to minus/negation/hyphen/dash:

Standard C Library (libc, -lc) (many)
or -1 if an error occurred. (poll)
-C NUM, --context=NUM (grep)
A `-' overrides a `0' (printf)

etc. - in all cases U+002D is preferred.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ruhttp://www.amdmi3.ru
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192581 - head/sys/fs/nfs

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 14:53:26 2009
New Revision: 192581
URL: http://svn.freebsd.org/changeset/base/192581

Log:
  Fix the comment in sys/fs/nfs/nfs.h to correctly reflect the
  current use of the R_xxx flags. This changed when the
  NFS_LEGACYRPC code was removed from the subsystem.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfs/nfs.h

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Fri May 22 13:57:44 2009(r192580)
+++ head/sys/fs/nfs/nfs.h   Fri May 22 14:53:26 2009(r192581)
@@ -477,7 +477,7 @@ struct nfssockreq {
  */
 TAILQ_HEAD(nfsreqhead, nfsreq);
 
-/* First 8 R_xxx flags defined in rpc/rpcclnt.h, the rest are here */
+/* This is the only nfsreq R_xxx flag still used. */
 #defineR_DONTRECOVER   0x0100  /* don't initiate recovery when 
this
   rpc gets a stale state reply */
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192582 - head/sys/fs/nfsclient

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 15:01:47 2009
New Revision: 192582
URL: http://svn.freebsd.org/changeset/base/192582

Log:
  Change the code in the experimental nfs client to avoid flushing
  writes upon close when a write delegation is held by the client.
  This should be safe to do, now that nfsv4 Close operations are
  delayed until ncl_inactive() is called for the vnode.
  
  Approved by:  kib (mentor)

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

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 22 14:53:26 2009
(r192581)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 22 15:01:47 2009
(r192582)
@@ -687,12 +687,8 @@ nfs_close(struct vop_close_args *ap)
int cm = newnfs_commit_on_close ? 1 : 0;
error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm);
/* np->n_flag &= ~NMODIFIED; */
-   } else if (NFS_ISV4(vp)) {
-   int cm;
-   if (newnfs_commit_on_close != 0)
-   cm = 1;
-   else
-   cm = nfscl_mustflush(vp);
+   } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) {
+   int cm = newnfs_commit_on_close ? 1 : 0;
error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm);
/* as above w.r.t. races when clearing NMODIFIED */
/* np->n_flag &= ~NMODIFIED; */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192583 - svnadmin/conf

2009-05-22 Thread Ed Schouten
Author: ed
Date: Fri May 22 15:05:05 2009
New Revision: 192583
URL: http://svn.freebsd.org/changeset/base/192583

Log:
  I'll be mentoring Jilles Tjoelker as well.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Fri May 22 15:01:47 2009(r192582)
+++ svnadmin/conf/mentors   Fri May 22 15:05:05 2009(r192583)
@@ -17,6 +17,7 @@ eri   mlaier  Co-mentor: thompsa
 fabientjkoshy
 ivoras gnn
 jamie  bz  Co-mentor: brooks
+jilles ed
 jinmei gnn
 lstewart   gnn
 rdivacky   ed
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192584 - head/sys/dev/cxgb

2009-05-22 Thread George V. Neville-Neil
Author: gnn
Date: Fri May 22 15:06:03 2009
New Revision: 192584
URL: http://svn.freebsd.org/changeset/base/192584

Log:
  Fix a possible panic cxgb_controller_attach() routine that would occur
  only if prepping the adapter failed.
  
  Slight adjustment to comments.
  
  Fix a bug whereby downing the interface didn't preven it from
  processing packets.
  
  Submitted by: Navdeep Parhar
  MFC after:1 week

Modified:
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==
--- head/sys/dev/cxgb/cxgb_main.c   Fri May 22 15:05:05 2009
(r192583)
+++ head/sys/dev/cxgb/cxgb_main.c   Fri May 22 15:06:03 2009
(r192584)
@@ -404,8 +404,9 @@ upgrade_fw(adapter_t *sc)
  *  5. Allocate the BAR for doing MSI-X.
  *  6. Setup the line interrupt iff MSI-X is not supported.
  *  7. Create the driver's taskq.
- *  8. Start the task queue threads.
- *  9. Update the firmware if required.
+ *  8. Start one task queue service thread.
+ *  9. Check if the firmware and SRAM are up-to-date.  They will be
+ * auto-updated later (before FULL_INIT_DONE), if required.
  * 10. Create a child device for each MAC (port)
  * 11. Initialize T3 private state.
  * 12. Trigger the LED
@@ -665,7 +666,7 @@ out:
 }
 
 /*
- * The cxgb_controlller_detach routine is called with the device is
+ * The cxgb_controller_detach routine is called with the device is
  * unloaded from the system.
  */
 
@@ -685,7 +686,7 @@ cxgb_controller_detach(device_t dev)
  * The cxgb_free() is called by the cxgb_controller_detach() routine
  * to tear down the structures that were built up in
  * cxgb_controller_attach(), and should be the final piece of work
- * done when fullly unloading the driver.
+ * done when fully unloading the driver.
  * 
  *
  *  1. Shutting down the threads started by the cxgb_controller_attach()
@@ -724,7 +725,8 @@ cxgb_free(struct adapter *sc)
bus_generic_detach(sc->dev);
 
for (i = 0; i < (sc)->params.nports; i++) {
-   if (device_delete_child(sc->dev, sc->portdev[i]) != 0)
+   if (sc->portdev[i] &&
+   device_delete_child(sc->dev, sc->portdev[i]) != 0)
device_printf(sc->dev, "failed to delete child port\n");
}
 
@@ -1768,7 +1770,7 @@ out:
 
 
 /*
- * Release resources when all the ports and offloading have been stopped.
+ * Bring down the interface but do not free any resources.
  */
 static void
 cxgb_down_locked(struct adapter *sc)
@@ -1903,6 +1905,7 @@ cxgb_init_locked(struct port_info *p)
callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
t3_sge_reset_adapter(sc);
 
+   sc->flags &= ~CXGB_SHUTDOWN;
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 }
@@ -1923,10 +1926,13 @@ static void
 cxgb_stop_locked(struct port_info *pi)
 {
struct ifnet *ifp;
+   adapter_t *sc = pi->adapter;
 
PORT_LOCK_ASSERT_OWNED(pi);
ADAPTER_LOCK_ASSERT_NOTOWNED(pi->adapter);

+   sc->flags |= CXGB_SHUTDOWN;
+
ifp = pi->ifp;
t3_port_intr_disable(pi->adapter, pi->port_id);
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192585 - head/sys/fs/nfsclient

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 15:08:12 2009
New Revision: 192585
URL: http://svn.freebsd.org/changeset/base/192585

Log:
  Modify the mount handling code in the experimental nfs client to
  use the newer nmount() style arguments, as is used by mount_nfs.c.
  This prepares the kernel code for the use of a mount_nfs.c with
  changes for the experimental client integrated into it.
  
  Approved by:  kib (mentor)

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

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cFri May 22 15:06:03 2009
(r192584)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cFri May 22 15:08:12 2009
(r192585)
@@ -93,6 +93,7 @@ static int nfs_tprintf_delay = NFS_TPRIN
 SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY,
 downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
 
+static voidnfs_sec_name(char *, int *);
 static voidnfs_decode_args(struct mount *mp, struct nfsmount *nmp,
struct nfs_args *argp, struct ucred *, struct thread *);
 static int mountnfs(struct nfs_args *, struct mount *,
@@ -508,6 +509,17 @@ nfs_mountdiskless(char *path,
 }
 
 static void
+nfs_sec_name(char *sec, int *flagsp)
+{
+   if (!strcmp(sec, "krb5"))
+   *flagsp |= NFSMNT_KERB;
+   else if (!strcmp(sec, "krb5i"))
+   *flagsp |= (NFSMNT_KERB | NFSMNT_INTEGRITY);
+   else if (!strcmp(sec, "krb5p"))
+   *flagsp |= (NFSMNT_KERB | NFSMNT_PRIVACY);
+}
+
+static void
 nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
 struct ucred *cred, struct thread *td)
 {
@@ -652,12 +664,14 @@ nfs_decode_args(struct mount *mp, struct
}
 }
 
-static const char *nfs_opts[] = { "from", "nfs_args",
+static const char *nfs_opts[] = { "from",
 "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
 "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
-"async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport",
-"readdirsize", "soft", "hard", "mntudp", "tcp", "wsize", "rsize",
-"retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", 
+"async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus",
+"readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize",
+"retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport",
+"readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec",
+"principal", "nfsv4", "gssname", "allgssname", "dirpath",
 NULL };
 
 /*
@@ -697,14 +711,15 @@ nfs_mount(struct mount *mp)
.acdirmax = NFS_MAXDIRATTRTIMO,
.dirlen = 0,
.krbnamelen = 0,
+   .srvkrbnamelen = 0,
};
-   int error;
-   struct sockaddr *nam;
+   int error = 0, ret, len;
+   struct sockaddr *nam = NULL;
struct vnode *vp;
struct thread *td;
char hst[MNAMELEN];
-   size_t len;
u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
+   char *opt, *name, *secname;
 
if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
error = EINVAL;
@@ -717,16 +732,171 @@ nfs_mount(struct mount *mp)
goto out;
}
 
-   error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, sizeof args);
-   if (error)
-   goto out;
+   nfscl_init();
 
-   if (args.version != NFS_ARGSVERSION) {
-   error = EPROGMISMATCH;
-   goto out;
+   /* Handle the new style options. */
+   if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOCONN;
+   if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOCONN;
+   if (vfs_getopt(mp->mnt_optnew, "nolockd", NULL, NULL) == 0)
+   args.flags |= NFSMNT_NOLOCKD;
+   if (vfs_getopt(mp->mnt_optnew, "lockd", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_NOLOCKD;
+   if (vfs_getopt(mp->mnt_optnew, "intr", NULL, NULL) == 0)
+   args.flags |= NFSMNT_INT;
+   if (vfs_getopt(mp->mnt_optnew, "rdirplus", NULL, NULL) == 0)
+   args.flags |= NFSMNT_RDIRPLUS;
+   if (vfs_getopt(mp->mnt_optnew, "resvport", NULL, NULL) == 0)
+   args.flags |= NFSMNT_RESVPORT;
+   if (vfs_getopt(mp->mnt_optnew, "noresvport", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_RESVPORT;
+   if (vfs_getopt(mp->mnt_optnew, "soft", NULL, NULL) == 0)
+   args.flags |= NFSMNT_SOFT;
+   if (vfs_getopt(mp->mnt_optnew, "hard", NULL, NULL) == 0)
+   args.flags &= ~NFSMNT_SOFT;
+   if (vfs_getopt(mp->mnt_optnew, "mntudp", NULL, NULL) == 0)
+   args.sotype = SOCK_DGRAM;
+   if (vfs_getopt(mp->mnt_optnew, "udp", NULL, NULL) == 0)
+   args.sotype = SOCK_DGRAM;
+   

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

2009-05-22 Thread M. Warner Losh
In message: <4a16ac32.2040...@samsco.org>
Scott Long  writes:
: John Baldwin wrote:
: > On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
: >> At this point I wonder what's the purpose of maintaining the sleeping
: >> version for such functions?
: > 
: > Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
: > much rather the solution for make_dev() be that the 1 or 2 places that need 
: > to do it with a mutex held instead queue a task to do the actual make_dev() 
: > in a taskqueue when no locks are held.  This is basically what 
: > destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
: > callback to be called on completion would be better.  Having a device 
driver 
: > do all the work to setup the hardware only to fail to create a node in /dev 
: > so that userland can actually use it is pretty rediculous and useless.
: > 
: 
: It's a lot easier for me to handle a failure of make_dev in CAM than it 
: is to decouple the call to it.  Please don't dictate policy.

On the other hand, we do dictate policy in things like busdma where
one has to do things in callbacks rather than inline.  This is for
fairly good reasons, and I'm having trouble seeing why the reasons
presented here for make_dev_sched() are any worse...

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


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 10:32:43 am Rick Macklem wrote:
> 
> On Fri, 22 May 2009, Dag-Erling Smørgrav wrote:
> 
> > Rick Macklem  writes:
> >> Log:
> >>   Although it should never happen, all the nfsv4 server can do
> >>   when it runs out of clientids is reboot. I had replaced cpu_reboot()
> >>   with printf(), since cpu_reboot() doesn't exist for sparc64.
> >>   This change replaces the printf() with panic(), so the reboot
> >>   would occur for this highly unlikely occurrence.
> >
> > Regardless of how improbable this is, wouldn't it be better (and
> > simpler) to just log an error message and deny further mount requests?
> >
> Well, it this really is an issue I can just take the check for the
> wraparound out and let it continue on.
> 
> Why?
> 
> Because the likelyhood of a clientid issued 4billion time ago (many
> many years aka centuries, in practice) being for a client that still
> exists and hasn't rebooted or re-acquired a more recent clientid is
> essentialy 0 as well.
> 
> In case you haven't done the calculation, 4billion seconds is 136 years.
> Since I cannot image a server seeing anything close to 1 new clientid/sec
> over an extended period (there could be a burst just after booting), the
> wraparound will take centuries to happen (maybe highly unlikely wasn't a
> strong enough term).
> 
> Just don't worry about it, rick

What about a malicious denial-of-service attack where a malicious client 
initiates an endless stream of connection attempts to force a panic?  I think 
that is where the concern lies.  I'm sure a malicious client could do it 
intentionally in less than 136 years, perhaps on the order of seconds and/or 
minutes? :)

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


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

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 9:44:18 am Scott Long wrote:
> John Baldwin wrote:
> > On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
> >> At this point I wonder what's the purpose of maintaining the sleeping
> >> version for such functions?
> > 
> > Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
> > much rather the solution for make_dev() be that the 1 or 2 places that need 
> > to do it with a mutex held instead queue a task to do the actual make_dev() 
> > in a taskqueue when no locks are held.  This is basically what 
> > destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
> > callback to be called on completion would be better.  Having a device 
> > driver 
> > do all the work to setup the hardware only to fail to create a node in /dev 
> > so that userland can actually use it is pretty rediculous and useless.
> > 
> 
> It's a lot easier for me to handle a failure of make_dev in CAM than it 
> is to decouple the call to it.  Please don't dictate policy.

But what is there for CAM to handle?  I would expect CAM to handle hardware
events such as the devices arriving or leaving.  A temporary memory shortage
it not a hardware event.  As a user, if I insert a USB stick when the system
happens to be temporarily low on memory, is it more useful for the cdev to
appear a few microseconds later from a deferred context once memory is
available or for no device to ever appear at all?

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


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread Dag-Erling Smørgrav
John Baldwin  writes:
> What about a malicious denial-of-service attack where a malicious client 
> initiates an endless stream of connection attempts to force a panic?  I think 
> that is where the concern lies.  I'm sure a malicious client could do it 
> intentionally in less than 136 years, perhaps on the order of seconds and/or 
> minutes? :)

Not quite - 49 days at 1,000 requests per second.  I agree that it's
very unlikely, but the idea of a cpu_reboot() just rubs me the wrong
way.

We're painting bikesheds here, though.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2009-05-22 Thread Scott Long

M. Warner Losh wrote:

In message: <4a16ac32.2040...@samsco.org>
Scott Long  writes:
: John Baldwin wrote:
: > On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
: >> At this point I wonder what's the purpose of maintaining the sleeping
: >> version for such functions?
: > 
: > Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
: > much rather the solution for make_dev() be that the 1 or 2 places that need 
: > to do it with a mutex held instead queue a task to do the actual make_dev() 
: > in a taskqueue when no locks are held.  This is basically what 
: > destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
: > callback to be called on completion would be better.  Having a device driver 
: > do all the work to setup the hardware only to fail to create a node in /dev 
: > so that userland can actually use it is pretty rediculous and useless.
: > 
: 
: It's a lot easier for me to handle a failure of make_dev in CAM than it 
: is to decouple the call to it.  Please don't dictate policy.


On the other hand, we do dictate policy in things like busdma where
one has to do things in callbacks rather than inline.  This is for
fairly good reasons, and I'm having trouble seeing why the reasons
presented here for make_dev_sched() are any worse...

Warner


Busdma isn't a good example anymore.  I've tried to be very responsive
and accommodating to requests for change; see the
bus_dmamap_load_mbuf_sg() routine for example.  It also lets you break
the "normal" semantics without penalty via BUS_DMA_NOWAIT.  About the
only thing left in busdma that is cumbersome without an alternative is
allocating static memory.  Even then, I provided an alternative for a
number of years, and not a single person used it, so it eventually got
removed.

Scott

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


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

2009-05-22 Thread Scott Long

John Baldwin wrote:

On Friday 22 May 2009 9:44:18 am Scott Long wrote:

John Baldwin wrote:

On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:

At this point I wonder what's the purpose of maintaining the sleeping
version for such functions?
Actually, I still very much do not like using M_NOWAIT needlessly.  I would 
much rather the solution for make_dev() be that the 1 or 2 places that need 
to do it with a mutex held instead queue a task to do the actual make_dev() 
in a taskqueue when no locks are held.  This is basically what 
destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
callback to be called on completion would be better.  Having a device driver 
do all the work to setup the hardware only to fail to create a node in /dev 
so that userland can actually use it is pretty rediculous and useless.


It's a lot easier for me to handle a failure of make_dev in CAM than it 
is to decouple the call to it.  Please don't dictate policy.


But what is there for CAM to handle?  I would expect CAM to handle hardware
events such as the devices arriving or leaving.  A temporary memory shortage
it not a hardware event.  As a user, if I insert a USB stick when the system
happens to be temporarily low on memory, is it more useful for the cdev to
appear a few microseconds later from a deferred context once memory is
available or for no device to ever appear at all?



John,

You yourself have been recently burned by not fully understanding the
complexity involved in CAM.  By changing all of the periph drivers to
conform to an artificial policy limitation of the make_dev call, I face
a significant amount of time and effort to rewrite and test code paths
that are, unfortunately, highly complex and very fragile.  Please just
make a simple concession.

Scott

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


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

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 11:37:38 am Scott Long wrote:
> John Baldwin wrote:
> > On Friday 22 May 2009 9:44:18 am Scott Long wrote:
> >> John Baldwin wrote:
> >>> On Thursday 21 May 2009 6:11:02 pm Attilio Rao wrote:
>  At this point I wonder what's the purpose of maintaining the sleeping
>  version for such functions?
> >>> Actually, I still very much do not like using M_NOWAIT needlessly.  I 
would 
> >>> much rather the solution for make_dev() be that the 1 or 2 places that 
need 
> >>> to do it with a mutex held instead queue a task to do the actual 
make_dev() 
> >>> in a taskqueue when no locks are held.  This is basically what 
> >>> destroy_dev_sched() is doing.  Perhaps a make_dev_sched() with a similar 
> >>> callback to be called on completion would be better.  Having a device 
driver 
> >>> do all the work to setup the hardware only to fail to create a node 
in /dev 
> >>> so that userland can actually use it is pretty rediculous and useless.
> >>>
> >> It's a lot easier for me to handle a failure of make_dev in CAM than it 
> >> is to decouple the call to it.  Please don't dictate policy.
> > 
> > But what is there for CAM to handle?  I would expect CAM to handle 
hardware
> > events such as the devices arriving or leaving.  A temporary memory 
shortage
> > it not a hardware event.  As a user, if I insert a USB stick when the 
system
> > happens to be temporarily low on memory, is it more useful for the cdev to
> > appear a few microseconds later from a deferred context once memory is
> > available or for no device to ever appear at all?
> > 
> 
> John,
> 
> You yourself have been recently burned by not fully understanding the
> complexity involved in CAM.  By changing all of the periph drivers to
> conform to an artificial policy limitation of the make_dev call, I face
> a significant amount of time and effort to rewrite and test code paths
> that are, unfortunately, highly complex and very fragile.  Please just
> make a simple concession.

Are you referring to the sysctl thing?  That was quite trivial to fix FWIW.  I 
also do not see why make_dev_sched() with a callback won't work?  We already 
have this exact policy limitation in many similar APIs such as if_attach().  
Another thing to consider is that if you hold a lock while calling into other 
subsystems, that can result in your lock being held for a relatively "long" 
time which increases the chances for lock contention.

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


svn commit: r192586 - in head: bin/cp lib/libc/posix1e sbin/restore sys/kern sys/sys sys/ufs/ufs

2009-05-22 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri May 22 15:56:43 2009
New Revision: 192586
URL: http://svn.freebsd.org/changeset/base/192586

Log:
  Make 'struct acl' larger, as required to support NFSv4 ACLs.  Provide
  compatibility interfaces in both kernel and libc.
  
  Reviewed by:  rwatson

Added:
  head/lib/libc/posix1e/acl_compat.c   (contents, props changed)
Modified:
  head/bin/cp/Makefile
  head/lib/libc/posix1e/Makefile.inc
  head/lib/libc/posix1e/Symbol.map
  head/lib/libc/posix1e/acl_delete.c
  head/lib/libc/posix1e/acl_entry.c
  head/lib/libc/posix1e/acl_get.c
  head/lib/libc/posix1e/acl_init.c
  head/lib/libc/posix1e/acl_set.c
  head/lib/libc/posix1e/acl_support.c
  head/lib/libc/posix1e/acl_support.h
  head/lib/libc/posix1e/acl_valid.c
  head/sbin/restore/Makefile
  head/sys/kern/subr_acl_posix1e.c
  head/sys/kern/vfs_acl.c
  head/sys/sys/acl.h
  head/sys/ufs/ufs/ufs_acl.c

Modified: head/bin/cp/Makefile
==
--- head/bin/cp/MakefileFri May 22 15:08:12 2009(r192585)
+++ head/bin/cp/MakefileFri May 22 15:56:43 2009(r192586)
@@ -3,6 +3,6 @@
 
 PROG=  cp
 SRCS=  cp.c utils.c
-CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED
+CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE
 
 .include 

Modified: head/lib/libc/posix1e/Makefile.inc
==
--- head/lib/libc/posix1e/Makefile.inc  Fri May 22 15:08:12 2009
(r192585)
+++ head/lib/libc/posix1e/Makefile.inc  Fri May 22 15:56:43 2009
(r192586)
@@ -2,8 +2,11 @@
 
 .PATH: ${.CURDIR}/posix1e
 
+CFLAGS+=-D_ACL_PRIVATE
+
 SRCS+= acl_calc_mask.c \
acl_copy.c  \
+   acl_compat.c\
acl_delete.c\
acl_delete_entry.c  \
acl_entry.c \

Modified: head/lib/libc/posix1e/Symbol.map
==
--- head/lib/libc/posix1e/Symbol.mapFri May 22 15:08:12 2009
(r192585)
+++ head/lib/libc/posix1e/Symbol.mapFri May 22 15:56:43 2009
(r192586)
@@ -21,15 +21,12 @@ FBSD_1.0 {
acl_get_link_np;
acl_get_fd;
acl_get_fd_np;
-   acl_get_perm_np;
acl_get_permset;
acl_get_qualifier;
acl_get_tag_type;
acl_init;
acl_dup;
-   acl_add_perm;
acl_clear_perms;
-   acl_delete_perm;
acl_set_file;
acl_set_link_np;
acl_set_fd;
@@ -67,3 +64,9 @@ FBSD_1.0 {
mac_set_link;
mac_set_proc;
 };
+
+FBSD_1.1 {
+   acl_add_perm;
+   acl_delete_perm;
+   acl_get_perm_np;
+};

Added: head/lib/libc/posix1e/acl_compat.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/posix1e/acl_compat.c  Fri May 22 15:56:43 2009
(r192586)
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 2008 Edward Tomasz Napierała 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * ALTHOUGH THIS SOFTWARE IS MADE OF WIN AND SCIENCE, IT IS PROVIDED BY THE
+ * AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+ * THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+
+/*
+ * Compatibility wrappers for applications compiled against libc from before
+ * NFSv4 ACLs were added.
+ */
+int
+__oldacl_get_perm_np(acl_permset_t permset_d, oldacl_perm_t perm)
+{
+
+   return (acl_get_perm_np(permset_d, perm));
+}
+
+int
+__oldacl_add_perm(acl_permset_t permset_d, oldacl_perm_t perm)
+{
+
+   return (acl_add_perm(permset_d, perm));
+}
+
+int
+__oldacl_delete_perm(acl_permset_t permset_d, oldacl_perm_t perm)
+{
+
+   return (acl

svn commit: r192587 - in stable/7: share/man/man4 sys sys/conf sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb

2009-05-22 Thread Antoine Brodin
Author: antoine
Date: Fri May 22 16:11:00 2009
New Revision: 192587
URL: http://svn.freebsd.org/changeset/base/192587

Log:
  MFC r191318 to stable/7:
vlan(4) no longer depends on miibus(4).
  
Reviewed by:jhb@
MFC after:  1 month

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/vlan.4
  stable/7/sys/   (props changed)
  stable/7/sys/conf/NOTES
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/share/man/man4/vlan.4
==
--- stable/7/share/man/man4/vlan.4  Fri May 22 15:56:43 2009
(r192586)
+++ stable/7/share/man/man4/vlan.4  Fri May 22 16:11:00 2009
(r192587)
@@ -36,7 +36,6 @@ To compile this driver into the kernel,
 place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
-.Cd "device miibus"
 .Cd "device vlan"
 .Ed
 .Pp
@@ -193,18 +192,7 @@ The MTU setting on
 .Nm
 can be corrected manually if used in conjunction with such a parent interface.
 .Sh SEE ALSO
-.Xr kqueue 2 ,
-.Xr miibus 4 ,
 .Xr ifconfig 8 ,
 .Xr sysctl 8
 .Sh BUGS
 No 802.1Q features except VLAN tagging are implemented.
-.Pp
-.Dv EVFILT_NETDEV
-events on a
-.Nm
-interface will be sent through
-.Xr kqueue 2
-only if the parent interface uses
-.Xr miibus 4
-for link state notification.

Modified: stable/7/sys/conf/NOTES
==
--- stable/7/sys/conf/NOTES Fri May 22 15:56:43 2009(r192586)
+++ stable/7/sys/conf/NOTES Fri May 22 16:11:00 2009(r192587)
@@ -710,7 +710,7 @@ device  mn  # Munich32x/Falc54 Nx64kbit/s
 #  Ethernets; it is MANDATORY when an Ethernet device driver is
 #  configured or token-ring is enabled.
 #  The `vlan' device implements the VLAN tagging of Ethernet frames
-#  according to IEEE 802.1Q.  It requires `device miibus'.
+#  according to IEEE 802.1Q.
 #  The `wlan' device provides generic code to support 802.11
 #  drivers, including host AP mode; it is MANDATORY for the wi,
 #  ath, and awi drivers and will eventually be required by all 802.11 drivers.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem



On Fri, 22 May 2009, John Baldwin wrote:



What about a malicious denial-of-service attack where a malicious client
initiates an endless stream of connection attempts to force a panic?  I think
that is where the concern lies.  I'm sure a malicious client could do it
intentionally in less than 136 years, perhaps on the order of seconds and/or
minutes? :)

Ok, I'll buy into this and change it back to a "printf()" and let it 
continue.


Btw, if a malicious client gets to do repeated SetClientIDs against
the server (which is what you are referring to, above), then other
ugly things will occur. There are high water marks set for concurrent
allocations of clientids (there is a malloc'd structure for each one
of them), but if that is set too high, the server will get wedged,
big time. As for what happens inside the krpc when a malicious client
does repeated TCP connection attempts, I have no idea, but suspect it
ain't gonna be pretty. Doug?

Your only defenses within the server are:
1 - requiring all clients to have use KerberosV. (If you do this, the
  malicious client will probably still slow the machine to a crawl, but
  shouldn't exhaust resources, at least not in the nfs code.)
2 - blocking IP#s at the nfs server. (Pretty much the same result as 1,
  but maybe less overhead for the case of a malicious client using bogus
  GSSAPI authenticators.)

I think blocking IP#s at some external firewall is going to be the only
way to survive such an attack, but I suppose it's nice if the server
doesn't reboot during the attack and just gets really really slow.

NFSv4.1 has a rather complex front end to sessions called SSV, in an
attempt to protect against such attacks, but it seems to me that it
will require so much overhead to implement that it may not work out
well anyhow. But until someone implements sessions, who knows.
(Although there are some sessions implementations out there, I don't
think anyone tested SSV at the last connectathon, but I wasn't there,
so this is just a hunch.)

I'll change it back to a printf(), because that won't do any
harm, rick
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192588 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 16:41:33 2009
New Revision: 192588
URL: http://svn.freebsd.org/changeset/base/192588

Log:
  Change the reboot panic that would have occurred if clientid
  numbers wrapped around to a printf() warning of a possible
  DOS attack, in the experimental nfsv4 server.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 16:11:00 2009
(r192587)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 16:41:33 2009
(r192588)
@@ -3705,12 +3705,8 @@ nfsrv_nextclientindex(void)
if (client_index != 0)
return (client_index);
 
-   /*
-* In practice we'll never get here, but the panic is here
-* just for fun. (client_index will not wrap around on any real server)
-*/
-   panic("nfsv4 server out of clientids");
-   return (0); /* Just to shut the compiler up */
+   printf("out of clientids, possible DOS attack\n");
+   return (client_index);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192589 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 16:46:01 2009
New Revision: 192589
URL: http://svn.freebsd.org/changeset/base/192589

Log:
  Change the comment at the beginning of the function to reflect the
  change from panic() to printf() done by r192588.

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 16:41:33 2009
(r192588)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 16:46:01 2009
(r192589)
@@ -3691,8 +3691,8 @@ nfsrv_docallback(struct nfsclient *clp, 
 /*
  * Return the next index# for a clientid. Mostly just increment and return
  * the next one, but... if the 32bit unsigned does actually wrap around,
- * reboot. This is here more for fun than practical purposes. At an
- * average rate of one new client per second, it will wrap around in
+ * it should be rebooted.
+ * At an average rate of one new client per second, it will wrap around in
  * approximately 136 years. (I think the server will have been shut
  * down or rebooted before then.)
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 12:19:32 pm Rick Macklem wrote:
> 
> On Fri, 22 May 2009, John Baldwin wrote:
> 
> >
> > What about a malicious denial-of-service attack where a malicious client
> > initiates an endless stream of connection attempts to force a panic?  I 
think
> > that is where the concern lies.  I'm sure a malicious client could do it
> > intentionally in less than 136 years, perhaps on the order of seconds 
and/or
> > minutes? :)
> >
> I think blocking IP#s at some external firewall is going to be the only
> way to survive such an attack, but I suppose it's nice if the server
> doesn't reboot during the attack and just gets really really slow.

Yes, I think that is very reasonable and I wouldn't expect anything more than 
that.  Thanks.

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


svn commit: r192590 - stable/7/sys/sys

2009-05-22 Thread Kip Macy
Author: kmacy
Date: Fri May 22 17:54:02 2009
New Revision: 192590
URL: http://svn.freebsd.org/changeset/base/192590

Log:
  some ports erroneously use the existence of AT_FDCWD to check for
  the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g
  
  Reported by: Dimitry Andric

Modified:
  stable/7/sys/sys/fcntl.h
  stable/7/sys/sys/namei.h

Modified: stable/7/sys/sys/fcntl.h
==
--- stable/7/sys/sys/fcntl.hFri May 22 16:46:01 2009(r192589)
+++ stable/7/sys/sys/fcntl.hFri May 22 17:54:02 2009(r192590)
@@ -110,7 +110,7 @@ typedef __pid_t pid_t;
  * to determine the target of relative file paths in the openat() and
  * similar syscalls.
  */
-#defineAT_FDCWD-100
+#defineAT_FDCWD_notyet -100
 
 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
 #defineO_NOCTTY0x8000  /* don't assign controlling 
terminal */

Modified: stable/7/sys/sys/namei.h
==
--- stable/7/sys/sys/namei.hFri May 22 16:46:01 2009(r192589)
+++ stable/7/sys/sys/namei.hFri May 22 17:54:02 2009(r192590)
@@ -154,11 +154,11 @@ struct nameidata {
  * Initialization of a nameidata structure.
  */
 #defineNDINIT(ndp, op, flags, segflg, namep, td)   
\
-   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td)
+   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, NULL, td)
 #defineNDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) 
\
NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td)
 #defineNDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td)  
\
-   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td)
+   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, vp, td)
 
 static __inline void
 NDINIT_ALL(struct nameidata *ndp,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192591 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 18:10:39 2009
New Revision: 192591
URL: http://svn.freebsd.org/changeset/base/192591

Log:
  Modified the printf message of r192590 to remove the
  possible DOS attack, as suggested by Sam.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 17:54:02 2009
(r192590)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 18:10:39 2009
(r192591)
@@ -3705,7 +3705,7 @@ nfsrv_nextclientindex(void)
if (client_index != 0)
return (client_index);
 
-   printf("out of clientids, possible DOS attack\n");
+   printf("out of clientids\n");
return (client_index);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192593 - head/sys/dev/cxgb

2009-05-22 Thread George V. Neville-Neil
Author: gnn
Date: Fri May 22 18:26:47 2009
New Revision: 192593
URL: http://svn.freebsd.org/changeset/base/192593

Log:
  Partial reversion of previous commit.  The CXGB_SHUTDOWN flag does NOT
  need to be inverted when doing an ifconfig down of an interface.
  
  Pointed out by:   Navdeep Parhar
  MFC after: 1 week

Modified:
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/cxgb_main.c
==
--- head/sys/dev/cxgb/cxgb_main.c   Fri May 22 18:19:20 2009
(r192592)
+++ head/sys/dev/cxgb/cxgb_main.c   Fri May 22 18:26:47 2009
(r192593)
@@ -1905,7 +1905,6 @@ cxgb_init_locked(struct port_info *p)
callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
t3_sge_reset_adapter(sc);
 
-   sc->flags &= ~CXGB_SHUTDOWN;
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 }
@@ -1926,13 +1925,10 @@ static void
 cxgb_stop_locked(struct port_info *pi)
 {
struct ifnet *ifp;
-   adapter_t *sc = pi->adapter;
 
PORT_LOCK_ASSERT_OWNED(pi);
ADAPTER_LOCK_ASSERT_NOTOWNED(pi->adapter);

-   sc->flags |= CXGB_SHUTDOWN;
-
ifp = pi->ifp;
t3_port_intr_disable(pi->adapter, pi->port_id);
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192595 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh secure/usr.sbin/sshd

2009-05-22 Thread Dag-Erling Smorgrav
Author: des
Date: Fri May 22 18:46:28 2009
New Revision: 192595
URL: http://svn.freebsd.org/changeset/base/192595

Log:
  Upgrade to OpenSSH 5.2p1.
  
  MFC after:3 months

Added:
  head/crypto/openssh/auth2-jpake.c
 - copied unchanged from r192577, vendor-crypto/openssh/dist/auth2-jpake.c
  head/crypto/openssh/jpake.c
 - copied unchanged from r192577, vendor-crypto/openssh/dist/jpake.c
  head/crypto/openssh/jpake.h
 - copied unchanged from r192577, vendor-crypto/openssh/dist/jpake.h
  head/crypto/openssh/schnorr.c   (contents, props changed)
 - copied, changed from r192577, vendor-crypto/openssh/dist/schnorr.c
Modified:
  head/crypto/openssh/   (props changed)
  head/crypto/openssh/ChangeLog
  head/crypto/openssh/PROTOCOL
  head/crypto/openssh/README
  head/crypto/openssh/addrmatch.c
  head/crypto/openssh/auth-options.c
  head/crypto/openssh/auth-pam.c   (contents, props changed)
  head/crypto/openssh/auth.c
  head/crypto/openssh/auth.h
  head/crypto/openssh/auth2-chall.c
  head/crypto/openssh/auth2.c
  head/crypto/openssh/canohost.c
  head/crypto/openssh/canohost.h
  head/crypto/openssh/channels.c
  head/crypto/openssh/channels.h
  head/crypto/openssh/cipher.c
  head/crypto/openssh/cipher.h
  head/crypto/openssh/clientloop.c
  head/crypto/openssh/compat.c
  head/crypto/openssh/compat.h
  head/crypto/openssh/config.guess
  head/crypto/openssh/config.h
  head/crypto/openssh/config.h.in
  head/crypto/openssh/defines.h
  head/crypto/openssh/dispatch.c
  head/crypto/openssh/kex.c
  head/crypto/openssh/kexgexs.c
  head/crypto/openssh/key.c
  head/crypto/openssh/loginrec.c
  head/crypto/openssh/misc.c
  head/crypto/openssh/monitor.c
  head/crypto/openssh/monitor.h
  head/crypto/openssh/monitor_fdpass.c
  head/crypto/openssh/monitor_wrap.c
  head/crypto/openssh/monitor_wrap.h
  head/crypto/openssh/myproposal.h
  head/crypto/openssh/nchan.c
  head/crypto/openssh/openbsd-compat/bsd-poll.c
  head/crypto/openssh/openbsd-compat/port-uw.c
  head/crypto/openssh/openbsd-compat/xcrypt.c
  head/crypto/openssh/openbsd-compat/xmmap.c
  head/crypto/openssh/packet.c
  head/crypto/openssh/pathnames.h
  head/crypto/openssh/readconf.c
  head/crypto/openssh/readconf.h
  head/crypto/openssh/scp.c
  head/crypto/openssh/servconf.c
  head/crypto/openssh/servconf.h
  head/crypto/openssh/serverloop.c
  head/crypto/openssh/session.c
  head/crypto/openssh/sftp-server-main.c
  head/crypto/openssh/sftp.1   (contents, props changed)
  head/crypto/openssh/sftp.c
  head/crypto/openssh/ssh-keygen.1   (contents, props changed)
  head/crypto/openssh/ssh-keygen.c
  head/crypto/openssh/ssh-keyscan.1   (contents, props changed)
  head/crypto/openssh/ssh-keyscan.c
  head/crypto/openssh/ssh.1
  head/crypto/openssh/ssh.c
  head/crypto/openssh/ssh2.h
  head/crypto/openssh/ssh_config
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/ssh_namespace.h
  head/crypto/openssh/sshconnect.c
  head/crypto/openssh/sshconnect2.c
  head/crypto/openssh/sshd.8
  head/crypto/openssh/sshd.c
  head/crypto/openssh/sshd_config
  head/crypto/openssh/sshd_config.5
  head/crypto/openssh/sshpty.c
  head/crypto/openssh/ttymodes.c
  head/crypto/openssh/uidswap.c
  head/crypto/openssh/version.h
  head/secure/lib/libssh/Makefile
  head/secure/usr.sbin/sshd/Makefile

Modified: head/crypto/openssh/ChangeLog
==
--- head/crypto/openssh/ChangeLog   Fri May 22 18:29:59 2009
(r192594)
+++ head/crypto/openssh/ChangeLog   Fri May 22 18:46:28 2009
(r192595)
@@ -1,3 +1,497 @@
+20090223
+ - (djm) OpenBSD CVS Sync
+   - d...@cvs.openbsd.org 2009/02/22 23:50:57
+ [ssh_config.5 sshd_config.5]
+ don't advertise experimental options
+   - d...@cvs.openbsd.org 2009/02/22 23:59:25
+ [sshd_config.5]
+ missing period
+   - d...@cvs.openbsd.org 2009/02/23 00:06:15
+ [version.h]
+ openssh-5.2
+ - (djm) [README] update for 5.2
+ - (djm) Release openssh-5.2p1
+
+20090222
+ - (djm) OpenBSD CVS Sync
+   - tob...@cvs.openbsd.org 2009/02/21 19:32:04
+ [misc.c sftp-server-main.c ssh-keygen.c]
+ Added missing newlines in error messages.
+ ok dtucker
+
+20090221
+ - (djm) OpenBSD CVS Sync
+   - d...@cvs.openbsd.org 2009/02/17 01:28:32
+ [ssh_config]
+ sync with revised default ciphers; pointed out by dkrause@
+   - d...@cvs.openbsd.org 2009/02/18 04:31:21
+ [schnorr.c]
+ signature should hash over the entire group, not just the generator
+ (this is still disabled code)
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   [contrib/suse/openssh.spec] Prepare for 5.2p1
+
+20090216
+ - (djm) [regress/conch-ciphers.sh regress/putty-ciphers.sh]
+   [regress/putty-kex.sh regress/putty-transfer.sh] Downgrade disabled
+   interop tests from FATAL error to a warning. Allows some interop
+   tests to proceed if others are missing necessary prerequisites.
+ - (djm) [configure.ac] support GNU/kFreeBSD and GNU/kOpensolaris
+ 

Re: svn commit: r192591 - head/sys/fs/nfsserver

2009-05-22 Thread Alexey Dokuchaev
On Fri, May 22, 2009 at 06:10:40PM +, Rick Macklem wrote:
> Author: rmacklem
> Date: Fri May 22 18:10:39 2009
> New Revision: 192591
> URL: http://svn.freebsd.org/changeset/base/192591
> 
> Log:
>   Modified the printf message of r192590 to remove the
>   possible DOS attack, as suggested by Sam.
>   
> - printf("out of clientids, possible DOS attack\n");
> + printf("out of clientids\n");

Previously, panic() message referred "nfs4", now it does not, making it
rather cryptic without grepping through the source code.

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


Re: svn commit: r192591 - head/sys/fs/nfsserver

2009-05-22 Thread Sam Leffler

Alexey Dokuchaev wrote:

On Fri, May 22, 2009 at 06:10:40PM +, Rick Macklem wrote:
  

Author: rmacklem
Date: Fri May 22 18:10:39 2009
New Revision: 192591
URL: http://svn.freebsd.org/changeset/base/192591

Log:
  Modified the printf message of r192590 to remove the
  possible DOS attack, as suggested by Sam.
  
-	printf("out of clientids, possible DOS attack\n");

+   printf("out of clientids\n");



Previously, panic() message referred "nfs4", now it does not, making it
rather cryptic without grepping through the source code.

.

I requested the printf identify the call site; e.g.

printf("%s: out of clientids\n", __func__);

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


svn commit: r192596 - head/sys/fs/nfsserver

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 19:05:48 2009
New Revision: 192596
URL: http://svn.freebsd.org/changeset/base/192596

Log:
  Change the printf of r192595 to identify the function,
  as requested by Sam.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 18:46:28 2009
(r192595)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Fri May 22 19:05:48 2009
(r192596)
@@ -3705,7 +3705,7 @@ nfsrv_nextclientindex(void)
if (client_index != 0)
return (client_index);
 
-   printf("out of clientids\n");
+   printf("%s: out of clientids\n", __func__);
return (client_index);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192590 - stable/7/sys/sys

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 1:54:03 pm Kip Macy wrote:
> Author: kmacy
> Date: Fri May 22 17:54:02 2009
> New Revision: 192590
> URL: http://svn.freebsd.org/changeset/base/192590
> 
> Log:
>   some ports erroneously use the existence of AT_FDCWD to check for
>   the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g
>   
>   Reported by: Dimitry Andric

I wonder if it wouldn't be appropriate to just remove the dirfd bits entirely 
from 7.x for now.  I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' 
member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc.  ZFS 
only really needed NDINIT_ATVP(), yes?

> Modified:
>   stable/7/sys/sys/fcntl.h
>   stable/7/sys/sys/namei.h
> 
> Modified: stable/7/sys/sys/fcntl.h
> 
==
> --- stable/7/sys/sys/fcntl.h  Fri May 22 16:46:01 2009(r192589)
> +++ stable/7/sys/sys/fcntl.h  Fri May 22 17:54:02 2009(r192590)
> @@ -110,7 +110,7 @@ typedef   __pid_t pid_t;
>   * to determine the target of relative file paths in the openat() and
>   * similar syscalls.
>   */
> -#define  AT_FDCWD-100
> +#define  AT_FDCWD_notyet -100
>  
>  /* Defined by POSIX 1003.1; BSD default, but must be distinct from 
O_RDONLY. */
>  #define  O_NOCTTY0x8000  /* don't assign controlling 
> terminal */
> 
> Modified: stable/7/sys/sys/namei.h
> 
==
> --- stable/7/sys/sys/namei.h  Fri May 22 16:46:01 2009(r192589)
> +++ stable/7/sys/sys/namei.h  Fri May 22 17:54:02 2009(r192590)
> @@ -154,11 +154,11 @@ struct nameidata {
>   * Initialization of a nameidata structure.
>   */
>  #define  NDINIT(ndp, op, flags, segflg, namep, td)   
> \
> - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td)
> + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, NULL, td)
>  #define  NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) 
> \
>   NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td)
>  #define  NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td)  
> \
> - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td)
> + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, vp, td)
>  
>  static __inline void
>  NDINIT_ALL(struct nameidata *ndp,
> 



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


svn commit: r192599 - in head: contrib/csup contrib/gcc/config/mips contrib/libpcap contrib/tcpdump lib/libc/nls sys/arm/xscale/ixp425 sys/cddl/boot/zfs

2009-05-22 Thread Dag-Erling Smorgrav
Author: des
Date: Fri May 22 20:07:39 2009
New Revision: 192599
URL: http://svn.freebsd.org/changeset/base/192599

Log:
  Expand $FreeBSD$

Modified:
  head/contrib/csup/rcstokenizer.l   (props changed)
  head/contrib/gcc/config/mips/freebsd.h   (props changed)
  head/contrib/libpcap/FREEBSD-Xlist   (props changed)
  head/contrib/tcpdump/FREEBSD-Xlist   (props changed)
  head/lib/libc/nls/be_BY.UTF-8.msg   (props changed)
  head/lib/libc/nls/uk_UA.UTF-8.msg   (props changed)
  head/sys/arm/xscale/ixp425/std.ixp435   (props changed)
  head/sys/cddl/boot/zfs/zfssubr.c   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192590 - stable/7/sys/sys

2009-05-22 Thread Dimitry Andric
On 2009-05-22 21:07, John Baldwin wrote:
>> Log:
>>   some ports erroneously use the existence of AT_FDCWD to check for
>>   the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g
>>   
>>   Reported by: Dimitry Andric
> 
> I wonder if it wouldn't be appropriate to just remove the dirfd bits entirely 
> from 7.x for now.  I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' 
> member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc.  ZFS 
> only really needed NDINIT_ATVP(), yes?

Are there any plans to MFC the *at() calls?  (I'd guess not, since it
looks like they change the ABI...)  
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192590 - stable/7/sys/sys

2009-05-22 Thread John Baldwin
On Friday 22 May 2009 4:08:31 pm Dimitry Andric wrote:
> On 2009-05-22 21:07, John Baldwin wrote:
> >> Log:
> >>   some ports erroneously use the existence of AT_FDCWD to check for
> >>   the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g
> >>   
> >>   Reported by: Dimitry Andric
> > 
> > I wonder if it wouldn't be appropriate to just remove the dirfd bits 
> > entirely 
> > from 7.x for now.  I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' 
> > member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc.  
> > ZFS 
> > only really needed NDINIT_ATVP(), yes?
> 
> Are there any plans to MFC the *at() calls?  (I'd guess not, since it
> looks like they change the ABI...) 

I don't think there are due to the ABI change, and if they were ever MFC'd,
the NDINIT, etc. bits could be restored as part of that merge.

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


Re: svn commit: r192590 - stable/7/sys/sys

2009-05-22 Thread Kostik Belousov
On Fri, May 22, 2009 at 04:21:14PM -0400, John Baldwin wrote:
> On Friday 22 May 2009 4:08:31 pm Dimitry Andric wrote:
> > On 2009-05-22 21:07, John Baldwin wrote:
> > >> Log:
> > >>   some ports erroneously use the existence of AT_FDCWD to check for
> > >>   the availability of the *at system calls so 
> > >> s/AT_FDCWD/AT_FDCWD_notyet/g
> > >>   
> > >>   Reported by: Dimitry Andric
> > > 
> > > I wonder if it wouldn't be appropriate to just remove the dirfd bits 
> > > entirely 
> > > from 7.x for now.  I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' 
> > > member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc.  
> > > ZFS 
> > > only really needed NDINIT_ATVP(), yes?
> > 
> > Are there any plans to MFC the *at() calls?  (I'd guess not, since it
> > looks like they change the ABI...) 
> 
> I don't think there are due to the ABI change, and if they were ever MFC'd,
> the NDINIT, etc. bits could be restored as part of that merge.
No, the MFC is posponed not due to KBI change. As I said, I already have
a permission from re@ to change nameidata.

Robert (Cc:ed) hold the MFC because the new fd argument of the at syscalls
is not audited.


pgpqmCRKDHZav.pgp
Description: PGP signature


svn commit: r192601 - head/sys/fs/nfsclient

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 20:55:29 2009
New Revision: 192601
URL: http://svn.freebsd.org/changeset/base/192601

Log:
  Fix the name of the module common to the client and server
  in the experimental nfs subsystem to the correct one for
  the MODULE_DEPEND() macro.
  
  Approved by:  kib (mentor)

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

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Fri May 22 20:08:13 2009
(r192600)
+++ head/sys/fs/nfsclient/nfs_clport.c  Fri May 22 20:55:29 2009
(r192601)
@@ -1267,5 +1267,5 @@ DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfscl, 1);
-MODULE_DEPEND(nfscl, newnfsd, 1, 1, 1);
+MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192602 - stable/7/usr.sbin/sysinstall

2009-05-22 Thread Colin Percival
Author: cperciva
Date: Fri May 22 21:26:34 2009
New Revision: 192602
URL: http://svn.freebsd.org/changeset/base/192602

Log:
  MFC r192130:
Allow a comma-separated list of network interfaces to be specified via the
netDev option in install.cfg.

Modified:
  stable/7/usr.sbin/sysinstall/   (props changed)
  stable/7/usr.sbin/sysinstall/tcpip.c

Modified: stable/7/usr.sbin/sysinstall/tcpip.c
==
--- stable/7/usr.sbin/sysinstall/tcpip.cFri May 22 20:55:29 2009
(r192601)
+++ stable/7/usr.sbin/sysinstall/tcpip.cFri May 22 21:26:34 2009
(r192602)
@@ -651,11 +651,26 @@ tcpDeviceSelect(void)
 {
 DMenu *menu;
 Device **devs, *rval;
+char *dev, *network_dev;
 int cnt;
 
+rval = NULL;
+
+if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) {
+   network_dev = variable_get(VAR_NETWORK_DEVICE);
+
+   while ((dev = strsep(&network_dev, ",")) != NULL) {
+   devs = deviceFind(dev, DEVICE_TYPE_NETWORK);
+   cnt = deviceCount(devs);
+   if (cnt) {
+   if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
+   return(devs[0]);
+   }
+   }
+}
+
 devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK);
 cnt = deviceCount(devs);
-rval = NULL;
 
 if (!cnt) {
msgConfirm("No network devices available!");
@@ -669,14 +684,6 @@ tcpDeviceSelect(void)
if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
rval = devs[0];
 }
-else if (variable_get(VAR_NONINTERACTIVE) && 
variable_get(VAR_NETWORK_DEVICE)) {
-   devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), 
DEVICE_TYPE_NETWORK);
-   cnt = deviceCount(devs);
-   if (cnt) {
-   if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
-   rval = devs[0];
-   }
-}
 else {
int status;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192603 - svnadmin/conf

2009-05-22 Thread Ed Schouten
Author: ed
Date: Fri May 22 21:44:15 2009
New Revision: 192603
URL: http://svn.freebsd.org/changeset/base/192603

Log:
  Add Jilles Tjoelker.
  
  Jilles will be working on bugbusting, mainly in the area of standards
  compliance.
  
  Approved by:  core

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessFri May 22 21:26:34 2009(r192602)
+++ svnadmin/conf/accessFri May 22 21:44:15 2009(r192603)
@@ -103,6 +103,7 @@ jeff
 jfv
 jhay
 jhb
+jilles
 jinmei
 jkim
 jkoshy
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192605 - in head/sys: kern net sys

2009-05-22 Thread Marko Zec
Author: zec
Date: Fri May 22 22:09:00 2009
New Revision: 192605
URL: http://svn.freebsd.org/changeset/base/192605

Log:
  Introduce the if_vmove() function, which will be used in the future
  for reassigning ifnets from one vnet to another.
  
  if_vmove() works by calling a restricted subset of actions normally
  executed by if_detach() on an ifnet in the current vnet, and then
  switches to the target vnet and executes an appropriate subset of
  if_attach() actions there.
  
  if_attach() and if_detach() have become wrapper functions around
  if_attach_internal() and if_detach_internal(), where the later
  variants have an additional argument, a flag indicating whether a
  full attach or detach sequence is to be executed, or only a
  restricted subset suitable for moving an ifnet from one vnet to
  another.  Hence, if_vmove() will not call if_detach() and if_attach()
  directly, but will call the if_detach_internal() and
  if_attach_internal() variants instead, with the vmove flag set.
  
  While here, staticize ifnet_setbyindex() since it is not referenced
  from outside of sys/net/if.c.
  
  Also rename ifccnt field in struct vimage to ifcnt, and do some minor
  whitespace garbage collection where appropriate.
  
  This change should have no functional impact on nooptions VIMAGE kernel
  builds.
  
  Reviewed by:  bz, rwatson, brooks?
  Approved by:  julian (mentor)

Modified:
  head/sys/kern/kern_vimage.c
  head/sys/net/if.c
  head/sys/net/if_var.h
  head/sys/sys/vimage.h

Modified: head/sys/kern/kern_vimage.c
==
--- head/sys/kern/kern_vimage.c Fri May 22 21:45:43 2009(r192604)
+++ head/sys/kern/kern_vimage.c Fri May 22 22:09:00 2009(r192605)
@@ -391,7 +391,7 @@ DB_SHOW_COMMAND(vnets, db_show_vnets)
 #endif
VNET_FOREACH(vnet_iter) {
db_printf("%p %3d %5d",
-   vnet_iter, vnet_iter->ifccnt, vnet_iter->sockcnt);
+   vnet_iter, vnet_iter->ifcnt, vnet_iter->sockcnt);
db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_NET]);
db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_INET]);
db_vnet_ptr(vnet_iter->mod_data[VNET_MOD_INET6]);

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Fri May 22 21:45:43 2009(r192604)
+++ head/sys/net/if.c   Fri May 22 22:09:00 2009(r192605)
@@ -142,6 +142,8 @@ static void do_link_state_change(void *,
 static int if_getgroup(struct ifgroupreq *, struct ifnet *);
 static int if_getgroupmembers(struct ifgroupreq *);
 static voidif_delgroups(struct ifnet *);
+static voidif_attach_internal(struct ifnet *, int);
+static voidif_detach_internal(struct ifnet *, int);
 
 #ifdef INET6
 /*
@@ -239,7 +241,7 @@ ifnet_byindex_ref(u_short idx)
return (ifp);
 }
 
-void
+static void
 ifnet_setbyindex(u_short idx, struct ifnet *ifp)
 {
INIT_VNET_NET(curvnet);
@@ -520,8 +522,8 @@ if_alloc(u_char type)
 
IF_ADDR_LOCK_INIT(ifp);
TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp);
-   IF_AFDATA_LOCK_INIT(ifp);
ifp->if_afdata_initialized = 0;
+   IF_AFDATA_LOCK_INIT(ifp);
TAILQ_INIT(&ifp->if_addrhead);
TAILQ_INIT(&ifp->if_prefixhead);
TAILQ_INIT(&ifp->if_multiaddrs);
@@ -546,7 +548,7 @@ if_alloc(u_char type)
 static void
 if_free_internal(struct ifnet *ifp)
 {
-   INIT_VNET_NET(ifp->if_vnet);
+   INIT_VNET_NET(curvnet); /* ifp->if_vnet is already NULL here */
 
KASSERT((ifp->if_flags & IFF_DYING),
("if_free_internal: interface not dying"));
@@ -653,7 +655,10 @@ ifq_detach(struct ifaltq *ifq)
 
 /*
  * Perform generic interface initalization tasks and attach the interface
- * to the list of "active" interfaces.
+ * to the list of "active" interfaces.  If vmove flag is set on entry
+ * to if_attach_internal(), perform only a limited subset of initialization
+ * tasks, given that we are moving from one vnet to another an ifnet which
+ * has already been fully initialized.
  *
  * XXX:
  *  - The decision to return void and thus require this function to
@@ -664,6 +669,13 @@ ifq_detach(struct ifaltq *ifq)
 void
 if_attach(struct ifnet *ifp)
 {
+
+   if_attach_internal(ifp, 0);
+}
+
+static void
+if_attach_internal(struct ifnet *ifp, int vmove)
+{
INIT_VNET_NET(curvnet);
unsigned socksize, ifasize;
int namelen, masklen;
@@ -692,60 +704,63 @@ if_attach(struct ifnet *ifp)
ifp->if_qflush = if_qflush;
}

+   if (!vmove) {
 #ifdef MAC
-   mac_ifnet_create(ifp);
+   mac_ifnet_create(ifp);
 #endif
 
-   if (IS_DEFAULT_VNET(curvnet)) {
-   ifdev_setbyindex(ifp->if_index, make_dev(&net_cdevsw,
-   ifp->if_index, UID_ROOT, GID_WHEEL, 0600, "%s/%s",
-   net_cdevsw.d_name, ifp->if_xname));

svn commit: r192607 - head/share/misc

2009-05-22 Thread Jilles Tjoelker
Author: jilles
Date: Fri May 22 22:13:29 2009
New Revision: 192607
URL: http://svn.freebsd.org/changeset/base/192607

Log:
  Add myself to the src committers graph.
  
  Approved by:  ed (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Fri May 22 22:09:05 2009
(r192606)
+++ head/share/misc/committers-src.dot  Fri May 22 22:13:29 2009
(r192607)
@@ -106,6 +106,7 @@ ivoras [label="Ivan voras\nivo...@freebs
 jake [label="Jake burkholder\nj...@freebsd.org\n2000/05/16"]
 jamie [label="Jamie gritton\nja...@freebsd.org\n2009/01/28"]
 jayanth [label="Jayanth vijayaraghavan\njaya...@freebsd.org\n2000/05/08"]
+jilles [label="Jilles tjoelker\njil...@freebsd.org\n2009/05/22"]
 jinmei [label="JINMEI tatuya\njin...@freebsd.org\n2007/03/17"]
 jdp [label="John polstra\n...@freebsd.org\n/??/??"]
 jhb [label="John baldwin\n...@freebsd.org\n1999/08/23"]
@@ -247,6 +248,8 @@ dwmalone -> fanf
 dwmalone -> peadar
 dwmalone -> snb
 
+ed -> jilles
+
 eivind -> des
 eivind -> rwatson
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192608 - head/sys/net

2009-05-22 Thread Marko Zec
Author: zec
Date: Fri May 22 22:22:21 2009
New Revision: 192608
URL: http://svn.freebsd.org/changeset/base/192608

Log:
  Set ifp->if_afdata_initialized to 0 while holding IF_AFDATA_LOCK on ifp,
  not after the lock has been released.
  
  Reviewed by:  bz
  Discussed with:   rwatson

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Fri May 22 22:13:29 2009(r192607)
+++ head/sys/net/if.c   Fri May 22 22:22:21 2009(r192608)
@@ -1022,8 +1022,8 @@ if_detach_internal(struct ifnet *ifp, in
(*dp->dom_ifdetach)(ifp,
ifp->if_afdata[dp->dom_family]);
}
-   IF_AFDATA_UNLOCK(ifp);
ifp->if_afdata_initialized = 0;
+   IF_AFDATA_UNLOCK(ifp);
 
if (!vmove)
ifq_detach(&ifp->if_snd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192611 - in stable/7: contrib/csup sys/contrib/rdma sys/contrib/rdma/krping

2009-05-22 Thread Dag-Erling Smorgrav
Author: des
Date: Fri May 22 22:57:05 2009
New Revision: 192611
URL: http://svn.freebsd.org/changeset/base/192611

Log:
  Expand $FreeBSD$

Modified:
  stable/7/contrib/csup/rcstokenizer.l   (props changed)
  stable/7/sys/contrib/rdma/core_priv.h   (props changed)
  stable/7/sys/contrib/rdma/ib_addr.h   (props changed)
  stable/7/sys/contrib/rdma/ib_cache.h   (props changed)
  stable/7/sys/contrib/rdma/ib_cm.h   (props changed)
  stable/7/sys/contrib/rdma/ib_fmr_pool.h   (props changed)
  stable/7/sys/contrib/rdma/ib_mad.h   (props changed)
  stable/7/sys/contrib/rdma/ib_marshall.h   (props changed)
  stable/7/sys/contrib/rdma/ib_pack.h   (props changed)
  stable/7/sys/contrib/rdma/ib_sa.h   (props changed)
  stable/7/sys/contrib/rdma/ib_smi.h   (props changed)
  stable/7/sys/contrib/rdma/ib_umem.h   (props changed)
  stable/7/sys/contrib/rdma/ib_user_cm.h   (props changed)
  stable/7/sys/contrib/rdma/ib_user_mad.h   (props changed)
  stable/7/sys/contrib/rdma/ib_user_sa.h   (props changed)
  stable/7/sys/contrib/rdma/ib_user_verbs.h   (props changed)
  stable/7/sys/contrib/rdma/ib_verbs.h   (props changed)
  stable/7/sys/contrib/rdma/iw_cm.h   (props changed)
  stable/7/sys/contrib/rdma/krping/getopt.c   (props changed)
  stable/7/sys/contrib/rdma/krping/getopt.h   (props changed)
  stable/7/sys/contrib/rdma/krping/krping.c   (props changed)
  stable/7/sys/contrib/rdma/krping/krping.h   (props changed)
  stable/7/sys/contrib/rdma/krping/krping_dev.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_addr.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_cache.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_cm.h   (props changed)
  stable/7/sys/contrib/rdma/rdma_cm_ib.h   (props changed)
  stable/7/sys/contrib/rdma/rdma_cma.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_device.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_iwcm.c   (props changed)
  stable/7/sys/contrib/rdma/rdma_user_cm.h   (props changed)
  stable/7/sys/contrib/rdma/rdma_verbs.c   (props changed)
  stable/7/sys/contrib/rdma/types.h   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192612 - head/sys/netinet

2009-05-22 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 22 23:03:15 2009
New Revision: 192612
URL: http://svn.freebsd.org/changeset/base/192612

Log:
  If including vnet.h one has to include opt_route.h as well. This is
  because struct vnet_net holds the rt_tables[][] for MRT and array size
  is compile time dependent.  If you had ROUTETABLES set to >1 after
  r192011 V_loif was pointing into nonsense leading to strange results
  or even panics for some people.
  
  Reviewed by:  mz

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Fri May 22 22:57:05 2009(r192611)
+++ head/sys/netinet/in.c   Fri May 22 23:03:15 2009(r192612)
@@ -34,6 +34,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_carp.h"
+#include "opt_route.h"
 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192612 - head/sys/netinet

2009-05-22 Thread Bjoern A. Zeeb

On Fri, 22 May 2009, Bjoern A. Zeeb wrote:


Author: bz
Date: Fri May 22 23:03:15 2009
New Revision: 192612
URL: http://svn.freebsd.org/changeset/base/192612

Log:
 If including vnet.h one has to include opt_route.h as well. This is
 because struct vnet_net holds the rt_tables[][] for MRT and array size
 is compile time dependent.  If you had ROUTETABLES set to >1 after
 r192011 V_loif was pointing into nonsense leading to strange results
 or even panics for some people.

 Reviewed by:   mz


Thanks to everyone who helped to debug this!

--
Bjoern A. Zeeb  The greatest risk is not taking one.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192613 - head/sys/fs/nfsclient

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Fri May 22 23:22:56 2009
New Revision: 192613
URL: http://svn.freebsd.org/changeset/base/192613

Log:
  Change the sysctl_base argument to svcpool_create() to NULL for
  client side callbacks so that leaf names are not re-used,
  since they are already being used by the server.
  
  Approved by:  kib (mentor)

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

Modified: head/sys/fs/nfsclient/nfs_clkrpc.c
==
--- head/sys/fs/nfsclient/nfs_clkrpc.c  Fri May 22 23:03:15 2009
(r192612)
+++ head/sys/fs/nfsclient/nfs_clkrpc.c  Fri May 22 23:22:56 2009
(r192613)
@@ -289,7 +289,7 @@ nfsrvd_cbinit(int terminating)
 
NFSD_UNLOCK();
 
-   nfscbd_pool = svcpool_create("nfscbd", 
SYSCTL_STATIC_CHILDREN(_vfs_newnfs));
+   nfscbd_pool = svcpool_create("nfscbd", NULL);
nfscbd_pool->sp_rcache = NULL;
nfscbd_pool->sp_assign = NULL;
nfscbd_pool->sp_done = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192194 - in head/sys: boot/i386/zfsboot boot/zfs cddl/boot/zfs

2009-05-22 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi, Doug,

Doug Rabson wrote:
> Author: dfr
> Date: Sat May 16 10:48:20 2009
> New Revision: 192194
> URL: http://svn.freebsd.org/changeset/base/192194
> 
> Log:
>   Add support for booting from raidz1 and raidz2 pools.
> 
> Modified:
>   head/sys/boot/i386/zfsboot/zfsboot.c
>   head/sys/boot/zfs/zfsimpl.c
>   head/sys/cddl/boot/zfs/README
>   head/sys/cddl/boot/zfs/zfsimpl.h
>   head/sys/cddl/boot/zfs/zfssubr.c

I think this commit has broken booting from mirrored zpool when raidz2
pool is exist.  In my setup it was 4 disks:

[li...@stortank] /usr/src/sys> gpart show
=>34  1953525101  da0  GPT  (932G)
  34 1281  freebsd-boot  (64K)
 162 20971522  freebsd-zfs  (1.0G)
 2097314 41943043  freebsd-swap  (2.0G)
 6291618  19472335174  freebsd-zfs  (929G)

=>34  1953525101  da1  GPT  (932G)
  34 1281  freebsd-boot  (64K)
 162 20971522  freebsd-zfs  (1.0G)
 2097314 41943043  freebsd-swap  (2.0G)
 6291618  19472335174  freebsd-zfs  (929G)

=>34  1953525101  da2  GPT  (932G)
  34 1281  freebsd-boot  (64K)
 162 20971522  freebsd-zfs  (1.0G)
 2097314 41943043  freebsd-swap  (2.0G)
 6291618  19472335174  freebsd-zfs  (929G)

=>34  1953525101  da3  GPT  (932G)
  34 1281  freebsd-boot  (64K)
 162 20971522  freebsd-zfs  (1.0G)
 2097314 41943043  freebsd-swap  (2.0G)
 6291618  19472335174  freebsd-zfs  (929G)

Where da?p2 are in a mirrored zpool and da?p4 are in a raid-z2 pool:

  pool: startpoint
 state: ONLINE
 scrub: none requested
config:

NAMESTATE READ WRITE CKSUM
startpoint  ONLINE   0 0 0
  mirrorONLINE   0 0 0
da0p2   ONLINE   0 0 0
da1p2   ONLINE   0 0 0
da2p2   ONLINE   0 0 0
da3p2   ONLINE   0 0 0

errors: No known data errors

  pool: stortank
 state: ONLINE
 scrub: none requested
config:

NAME STATE READ WRITE CKSUM
stortank ONLINE   0 0 0
  raidz2 ONLINE   0 0 0
label/disk0  ONLINE   0 0 0
label/disk1  ONLINE   0 0 0
label/disk2  ONLINE   0 0 0
label/disk3  ONLINE   0 0 0

It looks like that the gptzfsboot can recognize the mirrored
'startpoint' pool and load loader correctly (when I specify loader.old,
it worked just fine) but the loader can not.  I've tried to

Cheers,
- --
Xin LI http://www.delphij.net/
FreeBSD - The Power to Serve!
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkoXNNsACgkQi+vbBBjt66BrYACguD5mHU4PyUUINe1eJf69G6Vv
HL4An1I0fwokIF/Sc4fKCAgz3xH5Gwzq
=YgBz
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192614 - in stable/7/sys/cddl/contrib/opensolaris: common/atomic/ia64 uts/common/sys

2009-05-22 Thread Dag-Erling Smorgrav
Author: des
Date: Fri May 22 23:29:05 2009
New Revision: 192614
URL: http://svn.freebsd.org/changeset/base/192614

Log:
  Expand $FreeBSD$

Modified:
  stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S 
  (props changed)
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h   (props 
changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192615 - head/sys/nfsclient

2009-05-22 Thread Bjoern A. Zeeb
Author: bz
Date: Sat May 23 00:07:55 2009
New Revision: 192615
URL: http://svn.freebsd.org/changeset/base/192615

Log:
  It seems this file was ignored by MRT, rnh locking changes and new-arpv2.
  So let the V_irtualization people finally make the disabled debugging code
  compile again.
  
  MFC after:2 weeks
  X-MFC:MRT and adapt rnh locking

Modified:
  head/sys/nfsclient/bootp_subr.c

Modified: head/sys/nfsclient/bootp_subr.c
==
--- head/sys/nfsclient/bootp_subr.c Fri May 22 23:29:05 2009
(r192614)
+++ head/sys/nfsclient/bootp_subr.c Sat May 23 00:07:55 2009
(r192615)
@@ -242,7 +242,6 @@ static void bootpc_tag_helper(struct boo
 
 #ifdef BOOTP_DEBUG
 void bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma);
-void bootpboot_p_ma(struct sockaddr *ma);
 void bootpboot_p_rtentry(struct rtentry *rt);
 void bootpboot_p_tree(struct radix_node *rn);
 void bootpboot_p_rtlist(void);
@@ -326,24 +325,11 @@ bootpboot_p_sa(struct sockaddr *sa, stru
 }
 
 void
-bootpboot_p_ma(struct sockaddr *ma)
-{
-
-   if (ma == NULL) {
-   printf("");
-   return;
-   }
-   printf("%x", *(int *)ma);
-}
-
-void
 bootpboot_p_rtentry(struct rtentry *rt)
 {
 
bootpboot_p_sa(rt_key(rt), rt_mask(rt));
printf(" ");
-   bootpboot_p_ma(rt->rt_genmask);
-   printf(" ");
bootpboot_p_sa(rt->rt_gateway, NULL);
printf(" ");
printf("flags %x", (unsigned short) rt->rt_flags);
@@ -375,9 +361,9 @@ bootpboot_p_rtlist(void)
 {
 
printf("Routing table:\n");
-   RADIX_NODE_LOCK(V_rt_tables[AF_INET]);  /* could sleep XXX */
-   bootpboot_p_tree(V_rt_tables[AF_INET]->rnh_treetop);
-   RADIX_NODE_UNLOCK(V_rt_tables[AF_INET]);
+   RADIX_NODE_HEAD_RLOCK(V_rt_tables[0][AF_INET]); /* could sleep XXX */
+   bootpboot_p_tree(V_rt_tables[0][AF_INET]->rnh_treetop);
+   RADIX_NODE_HEAD_RUNLOCK(V_rt_tables[0][AF_INET]);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192616 - head/sys/fs/nfs

2009-05-22 Thread Rick Macklem
Author: rmacklem
Date: Sat May 23 00:40:17 2009
New Revision: 192616
URL: http://svn.freebsd.org/changeset/base/192616

Log:
  Fix the rpc_gss_secfind() call in nfs_commonkrpc.c so that
  the code will build when "options KGSSAPI" is specified
  without requiring the proposed changes that add host based
  initiator principal support. It will not handle the case where
  the client uses a host based initiator principal until those
  changes are committed. The code that uses those changes is
  #ifdef'd notyet until the krpc rpcsec_changes are committed.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cSat May 23 00:07:55 2009
(r192615)
+++ head/sys/fs/nfs/nfs_commonkrpc.cSat May 23 00:40:17 2009
(r192616)
@@ -299,8 +299,10 @@ nfs_getauth(struct nfssockreq *nrp, int 
 #ifdef KGSSAPI
rpc_gss_service_t svc;
AUTH *auth;
+#ifdef notyet
rpc_gss_options_req_t req_options;
 #endif
+#endif
 
switch (secflavour) {
 #ifdef KGSSAPI
@@ -317,6 +319,7 @@ nfs_getauth(struct nfssockreq *nrp, int 
svc = rpc_gss_svc_integrity;
else
svc = rpc_gss_svc_privacy;
+#ifdef notyet
req_options.req_flags = GSS_C_MUTUAL_FLAG;
req_options.time_req = 0;
req_options.my_cred = GSS_C_NO_CREDENTIAL;
@@ -326,8 +329,20 @@ nfs_getauth(struct nfssockreq *nrp, int 
auth = rpc_gss_secfind(nrp->nr_client, cred,
clnt_principal, srv_principal, mech_oid, svc,
&req_options);
-   return (auth);
+#else
+   /*
+* Until changes to the rpcsec_gss code are committed,
+* there is no support for host based initiator
+* principals. As such, that case cannot yet be handled.
+*/
+   if (clnt_principal == NULL)
+   auth = rpc_gss_secfind(nrp->nr_client, cred,
+   srv_principal, mech_oid, svc);
+   else
+   auth = NULL;
 #endif
+   return (auth);
+#endif /* KGSSAPI */
case AUTH_SYS:
default:
return (authunix_create(cred));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192617 - head/rescue/rescue

2009-05-22 Thread Kip Macy
Author: kmacy
Date: Sat May 23 00:47:23 2009
New Revision: 192617
URL: http://svn.freebsd.org/changeset/base/192617

Log:
  Add zfs/zpool to rescue programs
  
  PR:   bin/125878
  Submitted by: nork@
  MFC after:3 days

Modified:
  head/rescue/rescue/Makefile

Modified: head/rescue/rescue/Makefile
==
--- head/rescue/rescue/Makefile Sat May 23 00:40:17 2009(r192616)
+++ head/rescue/rescue/Makefile Sat May 23 00:47:23 2009(r192617)
@@ -72,7 +72,7 @@ CRUNCH_SRCDIRS+= bin
 CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo\
 ed expr getfacl hostname kenv kill ln ls mkdir mv  \
 pkill ps pwd realpath rm rmdir setfacl sh stty sync test
-CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil
+CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
 
 # Additional options for specific programs
 CRUNCH_ALIAS_test= [
@@ -128,6 +128,10 @@ CRUNCH_PROGS_sbin+= ping6
 .if ${MK_IPFILTER} != "no"
 CRUNCH_PROGS_sbin+= ipf
 .endif
+.if ${MK_ZFS} != "no"
+CRUNCH_PROGS_sbin+= zfs
+CRUNCH_PROGS_sbin+= zpool
+.endif
 
 # crunchgen does not like C++ programs; this should be fixed someday
 # CRUNCH_PROGS+= devd
@@ -136,6 +140,9 @@ CRUNCH_LIBS+= -lalias -lcam -lcurses -ld
 .if ${MK_IPX} != "no"
 CRUNCH_LIBS+= -lipx
 .endif
+.if ${MK_ZFS} != "no"
+CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl
+.endif
 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz
 
 .if ${MACHINE_ARCH} == "i386"
@@ -173,6 +180,10 @@ CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../.
 CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
 CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
 CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
+.if ${MK_ZFS} != "no"
+CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
+CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
+.endif
 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
 CRUNCH_ALIAS_restore= rrestore
 CRUNCH_ALIAS_dump= rdump
@@ -218,6 +229,8 @@ CRUNCH_PROGS_usr.sbin= chroot
 
 CRUNCH_PROGS_usr.sbin+= chown
 CRUNCH_ALIAS_chown= chgrp
+##
+CRUNCH_LIBS+= -lm
 
 ##
 #  The following is pretty nearly a generic crunchgen-handling makefile
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192623 - head/lib/libarchive

2009-05-22 Thread Tim Kientzle
Author: kientzle
Date: Sat May 23 04:31:05 2009
New Revision: 192623
URL: http://svn.freebsd.org/changeset/base/192623

Log:
  Include the 2 byte length field for the optional "extra data"
  field when computing the length of the gzip header.
  
  Thanks to Dag-Erling for pointing me to the OpenSSH tarballs,
  which are the first files I've seen that actually used this field.

Modified:
  head/lib/libarchive/archive_read_support_compression_gzip.c

Modified: head/lib/libarchive/archive_read_support_compression_gzip.c
==
--- head/lib/libarchive/archive_read_support_compression_gzip.c Sat May 23 
03:35:29 2009(r192622)
+++ head/lib/libarchive/archive_read_support_compression_gzip.c Sat May 23 
04:31:05 2009(r192623)
@@ -148,6 +148,7 @@ peek_at_header(struct archive_read_filte
if (p == NULL)
return (0);
len += ((int)p[len + 1] << 8) | (int)p[len];
+   len += 2;
}
 
/* Null-terminated optional filename. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192625 - in head: . lib/libc/stdtime usr.sbin/zic

2009-05-22 Thread Edwin Groothuis
Author: edwin
Date: Sat May 23 06:31:50 2009
New Revision: 192625
URL: http://svn.freebsd.org/changeset/base/192625

Log:
  MFV of tzcode2009e:
  
  Upgrade of the tzcode from 2004a to 2009e.
  
  Changes are numerous, but include...
  
  - New format of the output of zic, which supports both 32 and 64
bit time_t formats.
  
  - zdump on 64 bit platforms will actually produce some output instead
of doing nothing for a long time.
  
  - linux_base-fX, with X >= at least 8, will work without problems related
to the local time again.
  
  The original patch, based on the 2008e, has been running for a long
  time on both my laptop and desktop machine and have been tested by
  other people.
  
  After the installation of this code and the running of zic(8), you
  need to run tzsetup(8) again to install the new datafile.
  
  Approved by:  wollman@ for usr.sbin/zic
  MFC after:1 month

Deleted:
  head/usr.sbin/zic/Arts.htm
  head/usr.sbin/zic/tz-art.htm
  head/usr.sbin/zic/tz-link.htm
Modified:
  head/UPDATING
  head/lib/libc/stdtime/asctime.c
  head/lib/libc/stdtime/difftime.c
  head/lib/libc/stdtime/localtime.c
  head/lib/libc/stdtime/private.h
  head/lib/libc/stdtime/strftime.c
  head/lib/libc/stdtime/time2posix.3
  head/lib/libc/stdtime/tzfile.5
  head/lib/libc/stdtime/tzfile.h
  head/usr.sbin/zic/README
  head/usr.sbin/zic/Theory
  head/usr.sbin/zic/ialloc.c
  head/usr.sbin/zic/private.h
  head/usr.sbin/zic/scheck.c
  head/usr.sbin/zic/zdump.8
  head/usr.sbin/zic/zdump.c
  head/usr.sbin/zic/zic.8
  head/usr.sbin/zic/zic.c

Modified: head/UPDATING
==
--- head/UPDATING   Sat May 23 06:30:03 2009(r192624)
+++ head/UPDATING   Sat May 23 06:31:50 2009(r192625)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20090523:
+   The newly imported zic(8) produces a new format in the
+   output. Please run tzsetup(8) to install a newly /etc/localtime.
+
 20090520:
The sysctl tree for the usb stack has renamed from hw.usb2.* to
hw.usb.* and is now consistent again with previous releases.

Modified: head/lib/libc/stdtime/asctime.c
==
--- head/lib/libc/stdtime/asctime.c Sat May 23 06:30:03 2009
(r192624)
+++ head/lib/libc/stdtime/asctime.c Sat May 23 06:31:50 2009
(r192625)
@@ -1,12 +1,18 @@
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_ol...@nih.gov).
+** 1996-06-05 by Arthur David Olson.
+*/
+
+/*
+** Avoid the temptation to punt entirely to strftime;
+** the output of strftime is supposed to be locale specific
+** whereas the output of asctime is supposed to be constant.
 */
 
 #include 
 #ifndef lint
 #ifndef NOID
-static charelsieid[] __unused = "@(#)asctime.c 7.9";
+static charelsieid[] __unused = "@(#)asctime.c 8.2";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 __FBSDID("$FreeBSD$");
@@ -19,7 +25,57 @@ __FBSDID("$FreeBSD$");
 #include "tzfile.h"
 
 /*
-** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, Second Edition, 1996-07-12.
+** Some systems only handle "%.2d"; others only handle "%02d";
+** "%02.2d" makes (most) everybody happy.
+** At least some versions of gcc warn about the %02.2d;
+** we conditionalize below to avoid the warning.
+*/
+/*
+** All years associated with 32-bit time_t values are exactly four digits long;
+** some years associated with 64-bit time_t values are not.
+** Vintage programs are coded for years that are always four digits long
+** and may assume that the newline always lands in the same place.
+** For years that are less than four digits, we pad the output with
+** leading zeroes to get the newline in the traditional place.
+** The -4 ensures that we get four characters of output even if
+** we call a strftime variant that produces fewer characters for some years.
+** The ISO C 1999 and POSIX 1003.1-2004 standards prohibit padding the year,
+** but many implementations pad anyway; most likely the standards are buggy.
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT"%.3s %.3s%3d %2.2d:%2.2d:%2.2d %-4s\n"
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT"%.3s %.3s%3d %02.2d:%02.2d:%02.2d %-4s\n"
+#endif /* !defined __GNUC__ */
+/*
+** For years that are more than four digits we put extra spaces before the year
+** so that code trying to overwrite the newline won't end up overwriting
+** a digit within a year and truncating the year (operating on the assumption
+** that no output is better than wrong output).
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT_B  "%.3s %.3s%3d %2.2d:%2.2d:%2.2d %s\n"
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT_B  "%.3s %.3s%3d %02.2d:%02.2d:%02.2d %s\n"
+#endif /* !defined __GNUC__ */
+
+#define S

svn commit: r192626 - head/share/misc

2009-05-22 Thread Edwin Groothuis
Author: edwin
Date: Sat May 23 06:40:09 2009
New Revision: 192626
URL: http://svn.freebsd.org/changeset/base/192626

Log:
  [patch] update share/misc/iso639
  
  Updated against http://www.loc.gov/standards/iso639-2/langhome.html
  Snapshot was taken on 16 September 2008.
  
  PR:   conf/127422
  MFC after:1 week

Modified:
  head/share/misc/iso639

Modified: head/share/misc/iso639
==
--- head/share/misc/iso639  Sat May 23 06:31:50 2009(r192625)
+++ head/share/misc/iso639  Sat May 23 06:40:09 2009(r192626)
@@ -37,43 +37,48 @@ ab  abk abk Abkhazian
ace ace Achinese
ach ach Acoli
ada ada Adangme
+   ady ady Adyghe; Adygei
afa afa Afro-Asiatic (Other)
afh afh Afrihili
 af afr afr Afrikaans
-   aka aka Akan
+   ain ain Ainu
+ak aka aka Akan
akk akk Akkadian
 sq alb sqi Albanian
ale ale Aleut
alg alg Algonquian languages
+   alt alt Southern Altai
 am amh amh Amharic
ang ang English, Old (ca.450-1100)
+   anp anp Angika
apa apa Apache languages
 ar ara ara Arabic
-   arc arc Aramaic
+   arc arc Official Aramaic (700-300 BCE); Imperial Aramaic 
(700-300 BCE)
+an arg arg Aragonese
 hy arm hye Armenian
-   arn arn Araucanian
+   arn arn Mapudungun; Mapuche
arp arp Arapaho
art art Artificial (Other)
arw arw Arawak
 as asm asm Assamese
-   ast ast Asturian; Bable
+   ast ast Asturian; Bable; Leonese; Asturleonese
ath ath Athapascan languages
aus aus Australian languages
-   ava ava Avaric
+av ava ava Avaric
 ae ave ave Avestan
awa awa Awadhi
 ay aym aym Aymara
 az aze aze Azerbaijani
-   bad bad Banda
+   bad bad Banda languages
bai bai Bamileke languages
 ba bak bak Bashkir
bal bal Baluchi
-   bam bam Bambara
+bm bam bam Bambara
ban ban Balinese
 eu baq eus Basque
bas bas Basa
bat bat Baltic (Other)
-   bej bej Beja
+   bej bej Beja; Bedawiyet
 be bel bel Belarusian
bem bem Bemba
 bn ben ben Bengali
@@ -81,22 +86,23 @@ bn  ben ben Bengali
bho bho Bhojpuri
 bh bih bih Bihari
bik bik Bikol
-   bin bin Bini
+   bin bin Bini; Edo
 bi bis bis Bislama
bla bla Siksika
bnt bnt Bantu (Other)
 bs bos bos Bosnian
bra bra Braj
 br bre bre Breton
-   btk btk Batak (Indonesia)
+   btk btk Batak languages
bua bua Buriat
bug bug Buginese
 bg bul bul Bulgarian
 my bur mya Burmese
+   byn byn Blin; Bilin
cad cad Caddo
cai cai Central American Indian (Other)
-   car car Carib
-ca cat cat Catalan
+   car car Galibi Carib
+ca cat cat Catalan; Valencian
cau cau Caucasian (Other)
ceb ceb Cebuano
cel cel Celtic (Other)
@@ -109,9 +115,9 @@ zh  chi zho Chinese
chm chm Mari
chn chn Chinook jargon
cho cho Choctaw
-   chp chp Chipewyan
+   chp chp Chipewyan; Dene Suline
chr chr Cherokee
-cu chu chu Church Slavic
+cu chu chu Church Slavic; Old Slavonic; Church Slavonic; Old 
Bulgarian; Old Church Slavonic
 cv chv chv Chuvash
chy chy Cheyenne
cmc cmc Chamic languages
@@ -121,23 +127,27 @@ cocos cos Corsican
cpe cpe Creoles and pidgins, English based (Other)
cpf cpf Creoles and pidgins, French-based (Other)
cpp cpp Creoles and pidgins, Portuguese-based (Other)
-   cre cre Cree
+cr cre cre Cree
+   crh crh Crimean Tatar; Crimean Turkish
crp crp Creoles and pidgins (Other)
+   csb csb Kashubian
cus cus Cushitic (Other)
 cs cze ces Czech
dak dak Dakota
 da dan dan Danish
-   day day Dayak
+   dar dar Dargwa
+   day day Land Dayak languages
del del Delaware
den den Slave (Athapascan)
dgr dgr