From owner-p4-projects@FreeBSD.ORG Sat May 24 19:54:49 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C02D910656B2; Sat, 24 May 2008 19:54:48 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C64C1065684 for ; Sat, 24 May 2008 19:54:48 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8015C8FC2B for ; Sat, 24 May 2008 19:54:48 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4OJsmBE082219 for ; Sat, 24 May 2008 19:54:48 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4OJsmkH082217 for perforce@freebsd.org; Sat, 24 May 2008 19:54:48 GMT (envelope-from jb@freebsd.org) Date: Sat, 24 May 2008 19:54:48 GMT Message-Id: <200805241954.m4OJsmkH082217@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 142226 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2008 19:54:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=142226 Change 142226 by jb@freebsd3 on 2008/05/24 19:54:03 IFC Affected files ... .. //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#77 integrate .. //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml#44 integrate .. //depot/projects/dtrace/doc/en_US.ISO8859-1/share/sgml/authors.ent#36 integrate .. //depot/projects/dtrace/doc/mn_MN.UTF-8/books/handbook/mac/chapter.sgml#2 integrate .. //depot/projects/dtrace/doc/share/pgpkeys/manolis.key#1 branch .. //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys-developers.sgml#36 integrate .. //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys.ent#35 integrate .. //depot/projects/dtrace/doc/share/sgml/freebsd.dsl#6 integrate .. //depot/projects/dtrace/src/include/protocols/dumprestore.h#5 integrate .. //depot/projects/dtrace/src/sbin/dump/dump.h#6 integrate .. //depot/projects/dtrace/src/sbin/dump/itime.c#4 integrate .. //depot/projects/dtrace/src/sbin/dump/main.c#7 integrate .. //depot/projects/dtrace/src/share/misc/committers-doc.dot#6 integrate .. //depot/projects/dtrace/src/sys/amd64/amd64/exception.S#10 integrate .. //depot/projects/dtrace/src/sys/amd64/amd64/local_apic.c#15 integrate .. //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#25 integrate .. //depot/projects/dtrace/src/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c#3 integrate .. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#3 integrate .. //depot/projects/dtrace/src/sys/dev/usb/uxb360gp_rdesc.h#4 integrate .. //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc.h#4 integrate .. //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc_vfsops.c#8 integrate .. //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc_vnops.c#9 integrate .. //depot/projects/dtrace/src/sys/i386/i386/exception.s#15 integrate .. //depot/projects/dtrace/src/sys/i386/i386/local_apic.c#17 integrate .. //depot/projects/dtrace/src/sys/i386/i386/trap.c#32 integrate .. //depot/projects/dtrace/src/sys/i386/isa/clock.c#16 integrate .. //depot/projects/dtrace/src/sys/kern/kern_exec.c#28 integrate .. //depot/projects/dtrace/src/sys/kern/kern_exit.c#22 integrate .. //depot/projects/dtrace/src/sys/kern/kern_fork.c#31 integrate .. //depot/projects/dtrace/src/sys/kern/kern_proc.c#23 integrate .. //depot/projects/dtrace/src/sys/kern/kern_sig.c#26 integrate .. //depot/projects/dtrace/src/sys/modules/dtrace/Makefile#29 integrate .. //depot/projects/dtrace/src/sys/netinet/udp_usrreq.c#17 integrate .. //depot/projects/dtrace/src/sys/netinet6/ip6_input.c#10 integrate .. //depot/projects/dtrace/src/sys/netinet6/ip6_var.h#7 integrate .. //depot/projects/dtrace/src/sys/netipsec/ipsec.c#12 integrate .. //depot/projects/dtrace/src/sys/netipsec/ipsec.h#9 integrate .. //depot/projects/dtrace/src/sys/netipsec/ipsec_input.c#9 integrate .. //depot/projects/dtrace/src/sys/netipsec/ipsec_output.c#7 integrate .. //depot/projects/dtrace/src/sys/netipsec/xform_ah.c#7 integrate .. //depot/projects/dtrace/src/sys/netipsec/xform_esp.c#7 integrate .. //depot/projects/dtrace/src/sys/netipsec/xform_ipcomp.c#5 integrate .. //depot/projects/dtrace/src/sys/netipsec/xform_ipip.c#6 integrate .. //depot/projects/dtrace/src/sys/pc98/cbus/clock.c#11 integrate .. //depot/projects/dtrace/src/usr.bin/calendar/calendars/calendar.freebsd#23 integrate .. //depot/projects/dtrace/www/en/developers.sgml#35 integrate .. //depot/projects/dtrace/www/share/sgml/commercial.consult.xml#13 integrate .. //depot/projects/dtrace/www/share/sgml/news.xml#49 integrate Differences ... ==== //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#77 (text+ko) ==== @@ -1,4 +1,4 @@ - + + aaron@FreeBSD.org"> @@ -626,6 +626,8 @@ maho@FreeBSD.org"> +manolis@FreeBSD.org"> + marcel@FreeBSD.org"> marck@FreeBSD.org"> ==== //depot/projects/dtrace/doc/mn_MN.UTF-8/books/handbook/mac/chapter.sgml#2 (text+ko) ==== @@ -1,9 +1,9 @@ @@ -1131,10 +1131,7 @@ security.mac.portacl.enabled нь - бодлогыг бүр мөсөн нээнэ/хаана. Алдаанаас (bug) болоод - security.mac.portacl.enabled - sysctl хувьсагч нь &os; 5.2.1 болон - өмнөх хувилбаруудад ажилладаггүй. + бодлогыг бүр мөсөн нээнэ/хаана. ==== //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys-developers.sgml#36 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -494,6 +494,11 @@ &pgpkey.fjoe; + + &a.manolis; + &pgpkey.manolis; + + &a.jkim; &pgpkey.jkim; ==== //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys.ent#35 (text+ko) ==== @@ -1,5 +1,5 @@ - + @@ -159,6 +159,7 @@ + ==== //depot/projects/dtrace/doc/share/sgml/freebsd.dsl#6 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -211,12 +211,12 @@ (u (string-append "http://www.FreeBSD.org/cgi/man.cgi?query=" (data r) "&" "amp;" "sektion=" (data m)))) (case v - (("current") (string-append u "&" "amp;" "manpath=FreeBSD+7-current")) + (("current") (string-append u "&" "amp;" "manpath=FreeBSD+8-current")) (("xfree86") (string-append u "&" "amp;" "manpath=XFree86+4.5.0")) (("xorg") (string-append u "&" "amp;" "manpath=X11R7.2")) (("netbsd") (string-append u "&" "amp;" "manpath=NetBSD+3.0")) (("openbsd") (string-append u "&" "amp;" "manpath=OpenBSD+4.1")) - (("ports") (string-append u "&" "amp;" "manpath=FreeBSD+6.2-RELEASE+and+Ports")) + (("ports") (string-append u "&" "amp;" "manpath=FreeBSD+7.0-RELEASE+and+Ports")) (else u)))) (element application ($bold-seq$)) ==== //depot/projects/dtrace/src/include/protocols/dumprestore.h#5 (text+ko) ==== @@ -37,7 +37,7 @@ * * @(#)dumprestore.h 8.2 (Berkeley) 1/21/94 * - * $FreeBSD: src/include/protocols/dumprestore.h,v 1.11 2007/02/26 08:15:56 mckusick Exp $ + * $FreeBSD: src/include/protocols/dumprestore.h,v 1.12 2008/05/24 05:20:46 mckusick Exp $ */ #ifndef _PROTOCOLS_DUMPRESTORE_H_ @@ -134,13 +134,4 @@ #define TS_CLRI 6 /* map of inodes deleted since last dump */ #define TS_END 5 /* end of volume marker */ -/* - * flag values - */ -/* None at the moment */ - -#define DUMPOUTFMT "%-32s %c %s" /* for printf */ - /* name, level, ctime(date) */ -#define DUMPINFMT "%32s %c %[^\n]\n" /* inverse for scanf */ - #endif /* !_DUMPRESTORE_H_ */ ==== //depot/projects/dtrace/src/sbin/dump/dump.h#6 (text+ko) ==== @@ -28,7 +28,7 @@ * * @(#)dump.h 8.2 (Berkeley) 4/28/95 * - * $FreeBSD: src/sbin/dump/dump.h,v 1.29 2008/05/23 23:13:14 mckusick Exp $ + * $FreeBSD: src/sbin/dump/dump.h,v 1.30 2008/05/24 05:20:46 mckusick Exp $ */ /* @@ -59,8 +59,8 @@ char *popenout; /* popen(3) per-"tape" command */ char *dumpdates; /* name of the file containing dump date information*/ char *temp; /* name of the file for doing rewrite of dumpdates */ -char lastlevel; /* dump level of previous dump */ -char level; /* dump level of this dump */ +int lastlevel; /* dump level of previous dump */ +int level; /* dump level of this dump */ int uflag; /* update flag */ int diskfd; /* disk file descriptor */ int tapefd; /* tape file descriptor */ @@ -159,7 +159,7 @@ */ struct dumpdates { char dd_name[NAME_MAX+3]; - char dd_level; + int dd_level; time_t dd_ddate; }; int nddates; /* number of records (might be zero) */ @@ -171,6 +171,10 @@ if (ddatev != NULL) \ for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i]) +#define DUMPOUTFMT "%-32s %d %s" /* for printf */ + /* name, level, ctime(date) */ +#define DUMPINFMT "%32s %d %[^\n]\n" /* inverse for scanf */ + void sig(int signo); #ifndef _PATH_FSTAB ==== //depot/projects/dtrace/src/sbin/dump/itime.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/dump/itime.c,v 1.16 2004/12/02 13:56:53 maxim Exp $"; + "$FreeBSD: src/sbin/dump/itime.c,v 1.17 2008/05/24 05:20:46 mckusick Exp $"; #endif /* not lint */ #include @@ -132,11 +132,11 @@ fname = disk; #ifdef FDEBUG - msg("Looking for name %s in dumpdates = %s for level = %c\n", + msg("Looking for name %s in dumpdates = %s for level = %d\n", fname, dumpdates, level); #endif spcl.c_ddate = 0; - lastlevel = '0'; + lastlevel = 0; initdumptimes(); /* @@ -213,7 +213,7 @@ time_t t = _time64_to_time(spcl.c_date); tmsg = ctime(&t); } - msg("level %c dump on %s", level, tmsg); + msg("level %d dump on %s", level, tmsg); } static void @@ -241,7 +241,7 @@ dumpdates, recno); #ifdef FDEBUG - msg("getrecord: %s %c %s", ddatep->dd_name, ddatep->dd_level, + msg("getrecord: %s %d %s", ddatep->dd_name, ddatep->dd_level, ddatep->dd_ddate == 0 ? "the epoch\n" : ctime(&ddatep->dd_ddate)); #endif return(0); ==== //depot/projects/dtrace/src/sbin/dump/main.c#7 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/dump/main.c,v 1.66 2008/05/23 23:13:14 mckusick Exp $"; + "$FreeBSD: src/sbin/dump/main.c,v 1.67 2008/05/24 05:20:46 mckusick Exp $"; #endif /* not lint */ #include @@ -116,7 +116,7 @@ temp = _PATH_DTMP; if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) quit("TP_BSIZE must be a multiple of DEV_BSIZE\n"); - level = '0'; + level = 0; rsync_friendly = 0; if (argc < 2) @@ -129,7 +129,7 @@ /* dump level */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - level = ch; + level = 10 * level + ch - '0'; break; case 'a': /* `auto-size', Write to EOM. */ @@ -216,7 +216,7 @@ exit(X_STARTUP); } Tflag = 1; - lastlevel = '?'; + lastlevel = -1; break; case 'u': /* update /etc/dumpdates */ @@ -247,7 +247,7 @@ (void)fprintf(stderr, "\n"); exit(X_STARTUP); } - if (rsync_friendly && (level>'0')) { + if (rsync_friendly && (level > 0)) { (void)fprintf(stderr, "%s %s\n", "rsync friendly options", "can be used only with level 0 dumps."); exit(X_STARTUP); @@ -398,7 +398,7 @@ (void)strcpy(spcl.c_label, "none"); (void)gethostname(spcl.c_host, NAMELEN); - spcl.c_level = level - '0'; + spcl.c_level = level; spcl.c_type = TS_TAPE; if (rsync_friendly) { /* don't store real dump times */ @@ -411,7 +411,7 @@ time_t t = _time64_to_time(spcl.c_date); tmsg = ctime(&t); } - msg("Date of this level %c dump: %s", level, tmsg); + msg("Date of this level %d dump: %s", level, tmsg); if (!Tflag && (!rsync_friendly)) getdumptime(); /* /etc/dumpdates snarfed */ @@ -421,7 +421,10 @@ time_t t = _time64_to_time(spcl.c_ddate); tmsg = ctime(&t); } - msg("Date of last level %c dump: %s", lastlevel, tmsg); + if (lastlevel < 0) + msg("Date of last (level unknown) dump: %s", tmsg); + else + msg("Date of last level %d dump: %s", lastlevel, tmsg); msg("Dumping %s%s ", snapdump ? "snapshot of ": "", disk); if (dt != NULL) ==== //depot/projects/dtrace/src/share/misc/committers-doc.dot#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/misc/committers-doc.dot,v 1.23 2008/04/23 08:51:05 ganbold Exp $ +# $FreeBSD: src/share/misc/committers-doc.dot,v 1.24 2008/05/24 08:49:55 manolis Exp $ # This file is meant to list all FreeBSD doc+www committers and describe the # mentor-mentee relationships between them. @@ -57,6 +57,7 @@ keramida [label="Giorgos Keramidas\nkeramida@FreeBSD.org\n2001/10/12"] loader [label="Fukang Chen\nloader@FreeBSD.org\n2007/07/30"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2004/03/31"] +manolis [label="Manolis Kiagias\nmanolis@FreeBSD.org\n2008/05/24"] marck [label="Dmitry Morozovsky\nmarck@FreeBSD.org\n2004/08/10"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2007/10/26"] murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] @@ -88,6 +89,7 @@ delphij -> loader gabor -> pgj +gabor -> manolis jesusr -> jcamou ==== //depot/projects/dtrace/src/sys/amd64/amd64/exception.S#10 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.131 2007/12/07 08:20:15 jkoshy Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.132 2008/05/24 06:32:26 jb Exp $ */ #include "opt_atpic.h" ==== //depot/projects/dtrace/src/sys/amd64/amd64/local_apic.c#15 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.44 2008/03/16 10:58:02 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.45 2008/05/24 06:32:26 jb Exp $"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" ==== //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#25 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.325 2008/03/12 10:11:54 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.326 2008/05/24 06:32:26 jb Exp $"); /* * AMD64 Trap and System call handling ==== //depot/projects/dtrace/src/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c,v 1.4 2008/03/28 22:16:05 jb Exp $"); +__FBSDID("$FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c,v 1.5 2008/05/24 19:30:38 bz Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#3 (text+ko) ==== ==== //depot/projects/dtrace/src/sys/dev/usb/uxb360gp_rdesc.h#4 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Ed Schouten + * Copyright (c) 2005 Ed Schouten * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/usb/uxb360gp_rdesc.h,v 1.2 2005/12/31 04:38:50 mux Exp $ + * $FreeBSD: src/sys/dev/usb/uxb360gp_rdesc.h,v 1.3 2008/05/24 18:35:55 ed Exp $ */ /* ==== //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc.h#4 (text+ko) ==== @@ -31,12 +31,15 @@ * * @(#)fdesc.h 8.5 (Berkeley) 1/21/94 * - * $FreeBSD: src/sys/fs/fdescfs/fdesc.h,v 1.20 2005/02/10 12:09:15 phk Exp $ + * $FreeBSD: src/sys/fs/fdescfs/fdesc.h,v 1.21 2008/05/24 14:51:30 lulf Exp $ */ #ifdef _KERNEL +/* Private mount flags for fdescfs. */ +#define FMNT_UNMOUNTF 0x01 struct fdescmount { struct vnode *f_root; /* Root node */ + int flags; }; #define FD_ROOT 1 @@ -55,10 +58,12 @@ int fd_ix; /* filesystem index */ }; +extern struct mtx fdesc_hashmtx; #define VFSTOFDESC(mp) ((struct fdescmount *)((mp)->mnt_data)) #define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data) extern vfs_init_t fdesc_init; -extern int fdesc_allocvp(fdntype, int, struct mount *, struct vnode **, - struct thread *); +extern vfs_uninit_t fdesc_uninit; +extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *, + struct vnode **, struct thread *); #endif /* _KERNEL */ ==== //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc_vfsops.c#8 (text+ko) ==== @@ -31,7 +31,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $FreeBSD: src/sys/fs/fdescfs/fdesc_vfsops.c,v 1.58 2008/01/10 01:10:45 attilio Exp $ + * $FreeBSD: src/sys/fs/fdescfs/fdesc_vfsops.c,v 1.59 2008/05/24 14:51:30 lulf Exp $ */ /* @@ -85,18 +85,30 @@ if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) return (EOPNOTSUPP); - error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp, td); - if (error) - return (error); - MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount), M_FDESCMNT, M_WAITOK); /* XXX */ + + /* + * We need to initialize a few bits of our local mount point struct to + * avoid confusion in allocvp. + */ + mp->mnt_data = (qaddr_t) fmp; + fmp->flags = 0; + error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp, td); + if (error) { + free(fmp, M_FDESCMNT); + mp->mnt_data = 0; + return (error); + } rvp->v_type = VDIR; rvp->v_vflag |= VV_ROOT; fmp->f_root = rvp; + VOP_UNLOCK(rvp, 0); /* XXX -- don't mark as local to work around fts() problems */ /*mp->mnt_flag |= MNT_LOCAL;*/ - mp->mnt_data = fmp; + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_MPSAFE; + MNT_IUNLOCK(mp); vfs_getnewfsid(mp); vfs_mountedfrom(mp, "fdescfs"); @@ -109,11 +121,19 @@ int mntflags; struct thread *td; { + struct fdescmount *fmp; + caddr_t data; int error; int flags = 0; - if (mntflags & MNT_FORCE) + fmp = (struct fdescmount *)mp->mnt_data; + if (mntflags & MNT_FORCE) { + /* The hash mutex protects the private mount flags. */ + mtx_lock(&fdesc_hashmtx); + fmp->flags |= FMNT_UNMOUNTF; + mtx_unlock(&fdesc_hashmtx); flags |= FORCECLOSE; + } /* * Clear out buffer cache. I don't think we @@ -127,10 +147,14 @@ return (error); /* - * Finally, throw away the fdescmount structure + * Finally, throw away the fdescmount structure. Hold the hashmtx to + * protect the fdescmount structure. */ - free(mp->mnt_data, M_FDESCMNT); /* XXX */ + mtx_lock(&fdesc_hashmtx); + data = mp->mnt_data; mp->mnt_data = 0; + mtx_unlock(&fdesc_hashmtx); + free(data, M_FDESCMNT); /* XXX */ return (0); } @@ -148,8 +172,7 @@ * Return locked reference to root. */ vp = VFSTOFDESC(mp)->f_root; - VREF(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vget(vp, LK_EXCLUSIVE | LK_RETRY, td); *vpp = vp; return (0); } @@ -208,6 +231,7 @@ .vfs_mount = fdesc_mount, .vfs_root = fdesc_root, .vfs_statfs = fdesc_statfs, + .vfs_uninit = fdesc_uninit, .vfs_unmount = fdesc_unmount, }; ==== //depot/projects/dtrace/src/sys/fs/fdescfs/fdesc_vnops.c#9 (text+ko) ==== @@ -31,7 +31,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $FreeBSD: src/sys/fs/fdescfs/fdesc_vnops.c,v 1.108 2008/04/04 09:37:57 kib Exp $ + * $FreeBSD: src/sys/fs/fdescfs/fdesc_vnops.c,v 1.109 2008/05/24 14:51:30 lulf Exp $ */ /* @@ -56,18 +56,15 @@ #include -#define FDL_WANT 0x01 -#define FDL_LOCKED 0x02 -static int fdcache_lock; - #define NFDCACHE 4 #define FD_NHASH(ix) \ (&fdhashtbl[(ix) & fdhash]) static LIST_HEAD(fdhashhead, fdescnode) *fdhashtbl; static u_long fdhash; +struct mtx fdesc_hashmtx; + static vop_getattr_t fdesc_getattr; -static vop_inactive_t fdesc_inactive; static vop_lookup_t fdesc_lookup; static vop_open_t fdesc_open; static vop_readdir_t fdesc_readdir; @@ -79,7 +76,6 @@ .vop_access = VOP_NULL, .vop_getattr = fdesc_getattr, - .vop_inactive = fdesc_inactive, .vop_lookup = fdesc_lookup, .vop_open = fdesc_open, .vop_pathconf = vop_stdpathconf, @@ -88,6 +84,9 @@ .vop_setattr = fdesc_setattr, }; +static void fdesc_insmntque_dtr(struct vnode *, void *); +static void fdesc_remove_entry(struct fdescnode *); + /* * Initialise cache headers */ @@ -96,81 +95,154 @@ struct vfsconf *vfsp; { + mtx_init(&fdesc_hashmtx, "fdescfs_hash", NULL, MTX_DEF); fdhashtbl = hashinit(NFDCACHE, M_CACHE, &fdhash); return (0); } +/* + * Uninit ready for unload. + */ +int +fdesc_uninit(vfsp) + struct vfsconf *vfsp; +{ + + hashdestroy(fdhashtbl, M_CACHE, fdhash); + mtx_destroy(&fdesc_hashmtx); + return (0); +} + +/* + * If allocating vnode fails, call this. + */ +static void +fdesc_insmntque_dtr(struct vnode *vp, void *arg) +{ + + vgone(vp); + vput(vp); +} + +/* + * Remove an entry from the hash if it exists. + */ +static void +fdesc_remove_entry(struct fdescnode *fd) +{ + struct fdhashhead *fc; + struct fdescnode *fd2; + + fc = FD_NHASH(fd->fd_ix); + mtx_lock(&fdesc_hashmtx); + LIST_FOREACH(fd2, fc, fd_hash) { + if (fd == fd2) { + LIST_REMOVE(fd, fd_hash); + break; + } + } + mtx_unlock(&fdesc_hashmtx); +} + int -fdesc_allocvp(ftype, ix, mp, vpp, td) +fdesc_allocvp(ftype, fd_fd, ix, mp, vpp, td) fdntype ftype; + unsigned fd_fd; int ix; struct mount *mp; struct vnode **vpp; struct thread *td; { + struct fdescmount *fmp; struct fdhashhead *fc; - struct fdescnode *fd; + struct fdescnode *fd, *fd2; + struct vnode *vp, *vp2; int error = 0; fc = FD_NHASH(ix); loop: + mtx_lock(&fdesc_hashmtx); + /* + * If a forced unmount is progressing, we need to drop it. The flags are + * protected by the hashmtx. + */ + fmp = (struct fdescmount *)mp->mnt_data; + if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { + mtx_unlock(&fdesc_hashmtx); + return (-1); + } + LIST_FOREACH(fd, fc, fd_hash) { if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) { - if (vget(fd->fd_vnode, LK_EXCLUSIVE | LK_CANRECURSE, - td)) + /* Get reference to vnode in case it's being free'd */ + vp = fd->fd_vnode; + VI_LOCK(vp); + mtx_unlock(&fdesc_hashmtx); + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) goto loop; - *vpp = fd->fd_vnode; - VOP_UNLOCK(*vpp, 0); - return (error); + *vpp = vp; + return (0); } } + mtx_unlock(&fdesc_hashmtx); - /* - * otherwise lock the array while we call getnewvnode - * since that can block. - */ - if (fdcache_lock & FDL_LOCKED) { - fdcache_lock |= FDL_WANT; - (void) tsleep( &fdcache_lock, PINOD, "fdalvp", 0); - goto loop; - } - fdcache_lock |= FDL_LOCKED; - - /* - * Do the MALLOC before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if MALLOC should block. - */ MALLOC(fd, struct fdescnode *, sizeof(struct fdescnode), M_TEMP, M_WAITOK); - error = getnewvnode("fdescfs", mp, &fdesc_vnodeops, vpp); + error = getnewvnode("fdescfs", mp, &fdesc_vnodeops, &vp); if (error) { FREE(fd, M_TEMP); - goto out; + return (error); } - (*vpp)->v_data = fd; - fd->fd_vnode = *vpp; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vp->v_data = fd; + fd->fd_vnode = vp; fd->fd_type = ftype; - fd->fd_fd = -1; + fd->fd_fd = fd_fd; fd->fd_ix = ix; - /* XXX: vnode should be locked here */ - error = insmntque(*vpp, mp); /* XXX: Too early for mpsafe fs */ + error = insmntque1(vp, mp, fdesc_insmntque_dtr, NULL); if (error != 0) { - free(fd, M_TEMP); *vpp = NULLVP; - goto out; + return (error); } - LIST_INSERT_HEAD(fc, fd, fd_hash); -out: - fdcache_lock &= ~FDL_LOCKED; + /* Make sure that someone didn't beat us when inserting the vnode. */ + mtx_lock(&fdesc_hashmtx); + /* + * If a forced unmount is progressing, we need to drop it. The flags are + * protected by the hashmtx. + */ + fmp = (struct fdescmount *)mp->mnt_data; + if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { + mtx_unlock(&fdesc_hashmtx); + vgone(vp); + vput(vp); + *vpp = NULLVP; + return (-1); + } - if (fdcache_lock & FDL_WANT) { - fdcache_lock &= ~FDL_WANT; - wakeup( &fdcache_lock); + LIST_FOREACH(fd2, fc, fd_hash) { + if (fd2->fd_ix == ix && fd2->fd_vnode->v_mount == mp) { + /* Get reference to vnode in case it's being free'd */ + vp2 = fd2->fd_vnode; + VI_LOCK(vp2); + mtx_unlock(&fdesc_hashmtx); + error = vget(vp2, LK_EXCLUSIVE | LK_INTERLOCK, td); + /* Someone beat us, dec use count and wait for reclaim */ + vgone(vp); + vput(vp); + /* If we didn't get it, return no vnode. */ + if (error) + vp2 = NULLVP; + *vpp = vp2; + return (error); + } } - return (error); + /* If we came here, we can insert it safely. */ + LIST_INSERT_HEAD(fc, fd, fd_hash); + mtx_unlock(&fdesc_hashmtx); + *vpp = vp; + return (0); } /* @@ -230,13 +302,43 @@ if ((error = fget(td, fd, &fp)) != 0) goto bad; - error = fdesc_allocvp(Fdesc, FD_DESC+fd, dvp->v_mount, &fvp, td); - fdrop(fp, td); + /* Check if we're looking up ourselves. */ + if (VTOFDESC(dvp)->fd_ix == FD_DESC + fd) { + /* + * In case we're holding the last reference to the file, the dvp + * will be re-acquired. + */ + vhold(dvp); + VOP_UNLOCK(dvp, 0); + fdrop(fp, td); + + /* Re-aquire the lock afterwards. */ + vn_lock(dvp, LK_RETRY | LK_EXCLUSIVE); + vdrop(dvp); + fvp = dvp; + } else { + /* + * Unlock our root node (dvp) when doing this, since we might + * deadlock since the vnode might be locked by another thread + * and the root vnode lock will be obtained afterwards (in case + * we're looking up the fd of the root vnode), which will be the + * opposite lock order. Vhold the root vnode first so we don't + * loose it. + */ + vhold(dvp); + VOP_UNLOCK(dvp, 0); + error = fdesc_allocvp(Fdesc, fd, FD_DESC + fd, dvp->v_mount, + &fvp, td); + fdrop(fp, td); + /* + * The root vnode must be locked last to prevent deadlock condition. + */ + vn_lock(dvp, LK_RETRY | LK_EXCLUSIVE); + vdrop(dvp); + } + if (error) goto bad; - VTOFDESC(fvp)->fd_fd = fd; - if (fvp != dvp) - vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY); *vpp = fvp; return (0); @@ -505,34 +607,18 @@ } static int -fdesc_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - /* - * Clear out the v_type field to avoid - * nasty things happening in vgone(). - */ - vp->v_type = VNON; - return (0); -} - -static int fdesc_reclaim(ap) struct vop_reclaim_args /* { struct vnode *a_vp; } */ *ap; { - struct vnode *vp = ap->a_vp; - struct fdescnode *fd = VTOFDESC(vp); + struct vnode *vp; + struct fdescnode *fd; - LIST_REMOVE(fd, fd_hash); + vp = ap->a_vp; + fd = VTOFDESC(vp); + fdesc_remove_entry(fd); FREE(vp->v_data, M_TEMP); - vp->v_data = 0; - + vp->v_data = NULL; return (0); } ==== //depot/projects/dtrace/src/sys/i386/i386/exception.s#15 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/i386/exception.s,v 1.118 2007/12/07 08:20:16 jkoshy Exp $ + * $FreeBSD: src/sys/i386/i386/exception.s,v 1.120 2008/05/24 19:29:02 bz Exp $ */ #include "opt_apic.h" @@ -112,6 +112,10 @@ pushl $0; TRAP(T_OFLOW) IDTVEC(bnd) pushl $0; TRAP(T_BOUND) +#ifndef KDTRACE_HOOKS >>> TRUNCATED FOR MAIL (1000 lines) <<<