From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 06:52:59 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CFE416A41F for ; Sun, 9 Oct 2005 06:52:59 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from swift.wheel.pl (zoidberg.sec-force.net [80.55.205.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2D4D43D45 for ; Sun, 9 Oct 2005 06:52:58 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from localhost (bng128.neoplus.adsl.tpnet.pl [83.28.252.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by swift.wheel.pl (Postfix) with ESMTP id 3841E8BD25; Sun, 9 Oct 2005 08:46:20 +0200 (CEST) Date: Sun, 9 Oct 2005 08:52:38 +0200 From: Pawel Jakub Dawidek To: Craig Rodrigues Message-ID: <20051009064053.GA7261@garage.freebsd.pl> References: <20051008024620.GA29824@crodrigues.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv" Content-Disposition: inline In-Reply-To: <20051008024620.GA29824@crodrigues.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 06:52:59 -0000 --8w3uRX/HFJGApMzv Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2005 at 10:46:20PM -0400, Craig Rodrigues wrote: +> I would appreciate any comments on the attached patch.=20 I haven't has chance to run any tests, as I'm not at home, so I just reviewed the patch a bit. +> +static void +> +usage(void) +> +{ +> + (void)fprintf(stderr, +> + "usage: mount_xfs [-t fstype] [-o options] target_fs mount_point\n"); mount_xfs is probably a typo here:) +> + printf("argc is: %d\n", argc); for (i=3D0; i < argc; ++i) { printf("%d= : %s\n", argc, argv[i]); } You probably want to remove it before committing. +> + optind =3D optreset =3D 1; /* Reset for parse of new argv. */ +> + while ((ch =3D getopt(argc, argv, "o:")) !=3D -1) { +> + switch(ch) { +> + case 'o': +> + getmntopts(optarg, mopts, &mntflags, 0); +> + p =3D strchr(optarg, '=3D'); +> + val =3D ""; +> + if (p !=3D NULL) { +> + *p =3D '\0'; +> + val =3D p + 1; +> + } +> + build_iovec(&iov, &iovlen, optarg, val, -1); +> + break; Ok, as I suggested on IRC, this can handle only options given in form '-o opt1 -o opt2 -o opt3', but not '-o opt1,opt2,opt3'. +> + printf("argc is: %d\n", argc); Another debug printf. I think it is a step forward, so I'm not against committing it, but we need to design it better at the end. My suggestion (which I discusses with Craig on IRC a bit already) is as follows: - We create one mount(8) program. - When it is called with '-t ' switch, we look for /lib/mount/mount_.so and try to dlopen() it. - When there is no such .so, we just pass all option via nmount() to the kernel. - When there is .so, we decided based on things found there which options needs special treatment (like '-C' for mount_cd9660, etc.). Options which are not defined in .so we pass to the kernel without touching. The advantages: - No more external executables for every single file system. - mount(8) doesn't have to know about any specific FS, we can just add mount_.so if needed dinamically. - We need to create .so only for file systems for which some work has to be done in userland. - Passing options via nmount(2) as strings should allow to remove this annoying behaviour: # mount ... /dev/md0 on /mnt/tmp (ufs, local, noatime, noexec, read-only) # mount -u -o rw /mnt/tmp # mount ... /dev/md0 on /mnt/tmp (ufs, local) 'noexec' and 'noatime' are gone. I know that I can use 'current', but this doesn't seem to be intuitive for me (I think not only for me, but I can be wrong:)). Comments are welcome. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --8w3uRX/HFJGApMzv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDSL42ForvXbEpPzQRAlrVAJwO+fS9forVg9JHwcHtnAELAlipOACg1QqV DDdEMN1od+ZzyOJAIlexyQc= =7Xhz -----END PGP SIGNATURE----- --8w3uRX/HFJGApMzv-- From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 07:07:04 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF3C016A41F; Sun, 9 Oct 2005 07:07:04 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57A1343D46; Sun, 9 Oct 2005 07:07:04 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 4C1A4BC6D; Sun, 9 Oct 2005 07:07:02 +0000 (UTC) To: Pawel Jakub Dawidek From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 09 Oct 2005 08:52:38 +0200." <20051009064053.GA7261@garage.freebsd.pl> Date: Sun, 09 Oct 2005 09:07:01 +0200 Message-ID: <8138.1128841621@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Craig Rodrigues , freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 07:07:04 -0000 In message <20051009064053.GA7261@garage.freebsd.pl>, Pawel Jakub Dawidek write s: >My suggestion (which I discusses with Craig on IRC a bit already) is as >follows: > >- We create one mount(8) program. > >- When it is called with '-t ' switch, we look for > /lib/mount/mount_.so and try to dlopen() it. No way. Doing that would take much more code than having separate mount binaries because it would add yet another ABI which has to be versioned and managed etc etc. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 07:34:00 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BD0F16A41F for ; Sun, 9 Oct 2005 07:34:00 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from swift.wheel.pl (zoidberg.sec-force.net [80.55.205.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5CF043D45 for ; Sun, 9 Oct 2005 07:33:59 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from localhost (bng128.neoplus.adsl.tpnet.pl [83.28.252.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by swift.wheel.pl (Postfix) with ESMTP id A89538A02E; Sun, 9 Oct 2005 09:27:25 +0200 (CEST) Date: Sun, 9 Oct 2005 09:33:44 +0200 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20051009073314.GA7463@garage.freebsd.pl> References: <20051009064053.GA7261@garage.freebsd.pl> <8138.1128841621@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <8138.1128841621@critter.freebsd.dk> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) Cc: Craig Rodrigues , freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 07:34:00 -0000 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 09, 2005 at 09:07:01AM +0200, Poul-Henning Kamp wrote: +> In message <20051009064053.GA7261@garage.freebsd.pl>, Pawel Jakub Dawide= k write +> s: +>=20 +> >My suggestion (which I discusses with Craig on IRC a bit already) is as +> >follows: +> > +> >- We create one mount(8) program. +> > +> >- When it is called with '-t ' switch, we look for +> > /lib/mount/mount_.so and try to dlopen() it. +>=20 +> No way. +>=20 +> Doing that would take much more code than having separate mount +> binaries because it would add yet another ABI which has to be +> versioned and managed etc etc. So you think there will be more ABI changes to maintain than we have mount_ binaries at the moment? And where every binary have to duplicate the same code? I also don't know how passing arguments to .so is different than passing them to external binary. At least here we can verify ABI and we can eventually verify other things (like which options are supported, etc.). The .so have to parse arguments, use build_iovec() and return. In my opinion it'll save a lot of code duplication. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDSMfYForvXbEpPzQRAmErAJ45gH+xB2jo0B4VY8tNBp+N7FZ63ACdG4XO 05F3N6nftt9QjRz4KH1v8CA= =8fKO -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r-- From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 07:48:08 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1125816A41F; Sun, 9 Oct 2005 07:48:08 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAEA143D46; Sun, 9 Oct 2005 07:48:07 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id BC8CBBC6D; Sun, 9 Oct 2005 07:48:05 +0000 (UTC) To: Pawel Jakub Dawidek From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 09 Oct 2005 09:33:44 +0200." <20051009073314.GA7463@garage.freebsd.pl> Date: Sun, 09 Oct 2005 09:48:05 +0200 Message-ID: <8254.1128844085@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Craig Rodrigues , freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 07:48:08 -0000 In message <20051009073314.GA7463@garage.freebsd.pl>, Pawel Jakub Dawidek write s: >+> >- When it is called with '-t ' switch, we look for >+> > /lib/mount/mount_.so and try to dlopen() it. >+> >+> No way. >+> >+> Doing that would take much more code than having separate mount >+> binaries because it would add yet another ABI which has to be >+> versioned and managed etc etc. > >So you think there will be more ABI changes to maintain than we have >mount_ binaries at the moment? And where every binary have to >duplicate the same code? The mount_ binaries only use existing system calls. If you start creating mount_foo.so objects, you need to define which function entrypoints and support functions they provide and function entry points and data structures they can rely on in the main mount program. For something as trivial as mount_foo(8) programs that is just pointless complexity because it doesn't buy us any benefit at all, and have several downsides when it comes to reliability. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 13:13:16 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E25E016A420 for ; Sun, 9 Oct 2005 13:13:16 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from swift.wheel.pl (zoidberg.sec-force.net [80.55.205.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BC8443D48 for ; Sun, 9 Oct 2005 13:13:15 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from localhost (bng128.neoplus.adsl.tpnet.pl [83.28.252.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by swift.wheel.pl (Postfix) with ESMTP id E31DD8A02E; Sun, 9 Oct 2005 15:06:37 +0200 (CEST) Date: Sun, 9 Oct 2005 15:12:53 +0200 From: Pawel Jakub Dawidek To: Craig Rodrigues Message-ID: <20051009131253.GB7463@garage.freebsd.pl> References: <20051008024620.GA29824@crodrigues.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OBd5C1Lgu00Gd/Tn" Content-Disposition: inline In-Reply-To: <20051008024620.GA29824@crodrigues.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 13:13:17 -0000 --OBd5C1Lgu00Gd/Tn Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2005 at 10:46:20PM -0400, Craig Rodrigues wrote: +> +static int +> +use_mountprog(const char *vfstype) +> +{ +> + /* XXX: We need to get away from implementing external mount +> + * programs for every filesystem, and move towards having +> + * each filesystem properly implement the nmount() system call. +> + */ +> + unsigned int i; +> + const char *fs[] =3D { +> + "cd9660", "ext2fs", "mfs", "msdosfs", "nfs", "nfs4", "ntfs", +> + "nwfs", "nullfs", "portalfs", "reiserfs", "smbfs", "udf", "umapfs", +> + "unionfs", +> + NULL +> + }; +> + +> + for (i=3D0; fs[i] !=3D NULL; ++i) { +> + if (strcmp(vfstype, fs[i]) =3D=3D 0) +> + return 1; +> + } +> +=09 +> + return 0; +> +} Can't we just check if there is an external binary in _PATH_SYSPATH? It'll be easier to add new file system then (there will be no need to change this function). --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --OBd5C1Lgu00Gd/Tn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDSRdVForvXbEpPzQRAmPSAJ9ynFt+zyoIFrbvxVvCpmYEnTCs9ACgp71+ YEG4FKKSwQfGlvUou97/hQ0= =TtPI -----END PGP SIGNATURE----- --OBd5C1Lgu00Gd/Tn-- From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 15:05:02 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02B2916A420; Sun, 9 Oct 2005 15:05:01 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [204.127.198.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AAFB43D5A; Sun, 9 Oct 2005 15:05:01 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-112-178.hsd1.ma.comcast.net ([66.30.112.178]) by comcast.net (rwcrmhc12) with ESMTP id <2005100915050001400l51i3e>; Sun, 9 Oct 2005 15:05:00 +0000 Received: from c-66-30-112-178.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j99F4xOM006939; Sun, 9 Oct 2005 11:04:59 -0400 (EDT) (envelope-from rodrigc@c-66-30-112-178.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j99F4xhS006938; Sun, 9 Oct 2005 11:04:59 -0400 (EDT) (envelope-from rodrigc) Date: Sun, 9 Oct 2005 11:04:59 -0400 From: Craig Rodrigues To: freebsd-arch@freebsd.org Message-ID: <20051009150459.GA6810@crodrigues.org> References: <20051008024620.GA29824@crodrigues.org> <20051009131253.GB7463@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051009131253.GB7463@garage.freebsd.pl> User-Agent: Mutt/1.4.2.1i Cc: pjd@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 15:05:02 -0000 On Sun, Oct 09, 2005 at 03:12:53PM +0200, Pawel Jakub Dawidek wrote: > Can't we just check if there is an external binary in _PATH_SYSPATH? > It'll be easier to add new file system then (there will be no need to > change this function). We could do that. I had some thoughts on this: -> In the future, we want to make it difficult for people to add new external mount programs and force them to put the majority of their argument parsing inside the FS, so that it works nicely with nmount() and mount -t. Only in exceptional circumstances should we have an external mount program that works with mount -t....NFS and SMBFS are two special cases I could think of, and in these special cases (and new special cases), we could modify mount(8). -> Could there be security implications of unconditionally checking for a mount_foo binary and invoking it? What if the FS doesn't need an external mount binary and can use nmount()? The security implication isn't too much worse than the existing state of mount(8) today, but I thought I would throw it out there to think about. In this model, people could still write their own external mount programs....they would just be forced to make sure that for every option (-C, -q, -r), there is a corresponding (-o filesystemoption=foo1) option, so that it works with mount -t, because mount isn't going automatically fork() the new external mount program. Also, this would make certain these options would be settable from /etc/fstab. -- Craig Rodrigues rodrigc@crodrigues.org From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 15:21:58 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E982116A41F for ; Sun, 9 Oct 2005 15:21:58 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc12.comcast.net (rwcrmhc13.comcast.net [216.148.227.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61FC743D46 for ; Sun, 9 Oct 2005 15:21:52 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-112-178.hsd1.ma.comcast.net ([66.30.112.178]) by comcast.net (rwcrmhc13) with ESMTP id <2005100915214601500b4blie>; Sun, 9 Oct 2005 15:21:46 +0000 Received: from c-66-30-112-178.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j99FLjrD007237 for ; Sun, 9 Oct 2005 11:21:45 -0400 (EDT) (envelope-from rodrigc@c-66-30-112-178.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j99FLjW4007236 for freebsd-arch@freebsd.org; Sun, 9 Oct 2005 11:21:45 -0400 (EDT) (envelope-from rodrigc) Date: Sun, 9 Oct 2005 11:21:45 -0400 From: Craig Rodrigues To: freebsd-arch@freebsd.org Message-ID: <20051009152145.GA7180@crodrigues.org> References: <20051008024620.GA29824@crodrigues.org> <20051009131253.GB7463@garage.freebsd.pl> <20051009150459.GA6810@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051009150459.GA6810@crodrigues.org> User-Agent: Mutt/1.4.2.1i Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 15:21:59 -0000 Hi, By the way, one side benefit of adding nmount() to mount(8) is that we can eliminate unnecessary mount_* binaries from /rescue and free up space. For example, on my system: -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_cd9660 -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_devfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_ext2fs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_fdescfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_linprocfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_msdosfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_nfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_ntfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_nullfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_procfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_std -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_udf -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_umapfs -r-xr-xr-x 131 root wheel 3256200 Oct 8 21:49 mount_unionfs I've found that mount_devfs, mount_std, mount_procfs, mount_fdescfs, mount_nullfs, and mount_ext2fs are basically thin wrappers around nmount() (i.e. no special arguments) and can go right away. -- Craig Rodrigues rodrigc@crodrigues.org From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 15:28:46 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 534E016A41F for ; Sun, 9 Oct 2005 15:28:46 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id F164843D45 for ; Sun, 9 Oct 2005 15:28:45 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 3612EBC6D; Sun, 9 Oct 2005 15:28:43 +0000 (UTC) To: Craig Rodrigues From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 09 Oct 2005 11:21:45 EDT." <20051009152145.GA7180@crodrigues.org> Date: Sun, 09 Oct 2005 17:28:43 +0200 Message-ID: <9373.1128871723@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 15:28:46 -0000 In message <20051009152145.GA7180@crodrigues.org>, Craig Rodrigues writes: >Hi, > >By the way, one side benefit of adding nmount() to mount(8) >is that we can eliminate unnecessary >mount_* binaries from /rescue and free up space. >For example, on my system: You're not going to save much if anything on that. Hint: try "ls -li /rescue" -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sun Oct 9 16:12:26 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D69F16A41F; Sun, 9 Oct 2005 16:12:26 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [216.148.227.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC3E243D45; Sun, 9 Oct 2005 16:12:25 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-112-178.hsd1.ma.comcast.net ([66.30.112.178]) by comcast.net (rwcrmhc11) with ESMTP id <2005100916122501300jp1nee>; Sun, 9 Oct 2005 16:12:25 +0000 Received: from c-66-30-112-178.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j99GCOQA007616; Sun, 9 Oct 2005 12:12:24 -0400 (EDT) (envelope-from rodrigc@c-66-30-112-178.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-112-178.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j99GCOkW007615; Sun, 9 Oct 2005 12:12:24 -0400 (EDT) (envelope-from rodrigc) Date: Sun, 9 Oct 2005 12:12:24 -0400 From: Craig Rodrigues To: Pawel Jakub Dawidek Message-ID: <20051009161224.GA7541@crodrigues.org> References: <20051008024620.GA29824@crodrigues.org> <20051009064053.GA7261@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051009064053.GA7261@garage.freebsd.pl> User-Agent: Mutt/1.4.2.1i Cc: freebsd-arch@FreeBSD.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 16:12:26 -0000 On Sun, Oct 09, 2005 at 08:52:38AM +0200, Pawel Jakub Dawidek wrote: > +> + switch(ch) { > +> + case 'o': > +> + getmntopts(optarg, mopts, &mntflags, 0); > +> + p = strchr(optarg, '='); > +> + val = ""; > +> + if (p != NULL) { > +> + *p = '\0'; > +> + val = p + 1; > +> + } > +> + build_iovec(&iov, &iovlen, optarg, val, -1); > +> + break; > > Ok, as I suggested on IRC, this can handle only options given in form > '-o opt1 -o opt2 -o opt3', but not '-o opt1,opt2,opt3'. This is not an issue, because there is already existing behavior in mount(8) to avoid this. The mangle() function transforms argv so that: -o foo,bar=something,baz=somethingelse becomes: -o foo -o bar=something -o baz=somethingelse So this is not an issue by the time we go to build the iovec to pass to nmount(). I verified this too with printf(), % ./mount -t imaginary -o foo,bar=something,baz=somethingelse /dev/ad0s1 /mnt mount_fs argv: 0 mount_imaginary mount_fs argv: 1 -o mount_fs argv: 2 foo mount_fs argv: 3 -o mount_fs argv: 4 bar=something mount_fs argv: 5 -o mount_fs argv: 6 baz=somethingelse mount_fs argv: 7 /dev/ad0s1 mount_fs argv: 8 /mnt -- Craig Rodrigues rodrigc@crodrigues.org From owner-freebsd-arch@FreeBSD.ORG Mon Oct 10 09:02:01 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21A0616A41F; Mon, 10 Oct 2005 09:02:01 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83D5843D46; Mon, 10 Oct 2005 09:01:59 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from herring.rabson.org (herring [10.0.0.2]) by itchy.rabson.org (8.13.3/8.13.3) with ESMTP id j9A91dZP026911; Mon, 10 Oct 2005 10:01:39 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: freebsd-arch@freebsd.org Date: Mon, 10 Oct 2005 10:01:37 +0100 User-Agent: KMail/1.8.2 References: <20051008024620.GA29824@crodrigues.org> <20051009131253.GB7463@garage.freebsd.pl> <20051009150459.GA6810@crodrigues.org> In-Reply-To: <20051009150459.GA6810@crodrigues.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510101001.38294.dfr@nlsystems.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (itchy.rabson.org [80.177.232.242]); Mon, 10 Oct 2005 10:01:40 +0100 (BST) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on itchy.rabson.org X-Virus-Scanned: ClamAV 0.83/1124/Sun Oct 9 18:58:08 2005 on itchy.rabson.org X-Virus-Status: Clean Cc: Craig Rodrigues , pjd@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 09:02:01 -0000 On Sunday 09 October 2005 16:04, Craig Rodrigues wrote: > On Sun, Oct 09, 2005 at 03:12:53PM +0200, Pawel Jakub Dawidek wrote: > > Can't we just check if there is an external binary in > > _PATH_SYSPATH? It'll be easier to add new file system then (there > > will be no need to change this function). > > We could do that. I had some thoughts on this: > -> In the future, we want to make it difficult for people to add new > external mount programs and force them to put the majority > of their argument parsing inside the FS, so that it works > nicely with nmount() and mount -t. > Only in exceptional circumstances should we have an external > mount program that works with mount -t....NFS and SMBFS are two > special cases I could think of, and in these special cases > (and new special cases), we could modify mount(8). The mount program isn't always just doing argument parsing. For instance, the Darwin webdav filesystem puts all the HTTP protocol code in the mount program and uses IPC from the kernel to make i/o requests etc. as needed. I'm sure there must be other examples but the only one I can think of right now is the ancient broken kerberos auth code in NFS. From owner-freebsd-arch@FreeBSD.ORG Mon Oct 10 09:11:25 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C073D16A41F; Mon, 10 Oct 2005 09:11:25 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 403AA43D48; Mon, 10 Oct 2005 09:11:25 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 8348ABC6D; Mon, 10 Oct 2005 09:11:23 +0000 (UTC) To: Doug Rabson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 10 Oct 2005 10:01:37 BST." <200510101001.38294.dfr@nlsystems.com> Date: Mon, 10 Oct 2005 11:11:23 +0200 Message-ID: <13417.1128935483@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Craig Rodrigues , pjd@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 09:11:25 -0000 In message <200510101001.38294.dfr@nlsystems.com>, Doug Rabson writes: >> We could do that. I had some thoughts on this: >> -> In the future, we want to make it difficult for people to add new >> external mount programs [...] > >The mount program isn't always just doing argument parsing. Agreed, that's why it didn't say "impossible" :-) I think we are basically in agreement here, the point is to avoid pointless mount_foo(8) programs. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Mon Oct 10 10:39:30 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E57E16A41F; Mon, 10 Oct 2005 10:39:30 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from mail.qubesoft.com (gate.qubesoft.com [217.169.36.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8B7443D45; Mon, 10 Oct 2005 10:39:29 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from [192.168.1.254] (dhcp254.qubesoft.com [192.168.1.254]) by mail.qubesoft.com (8.13.3/8.13.3) with ESMTP id j9AAdMBV062422; Mon, 10 Oct 2005 11:39:22 +0100 (BST) (envelope-from dfr@nlsystems.com) In-Reply-To: <13417.1128935483@critter.freebsd.dk> References: <13417.1128935483@critter.freebsd.dk> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0A7E4AF1-C6C1-4D13-A81F-B6C84DB9B5CA@nlsystems.com> Content-Transfer-Encoding: 7bit From: Doug Rabson Date: Mon, 10 Oct 2005 11:38:58 +0100 To: Poul-Henning Kamp X-Mailer: Apple Mail (2.734) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.0.4 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.qubesoft.com X-Virus-Scanned: ClamAV 0.86.2/1124/Sun Oct 9 18:58:08 2005 on mail.qubesoft.com X-Virus-Status: Clean Cc: Craig Rodrigues , pjd@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 10:39:30 -0000 On 10 Oct 2005, at 10:11, Poul-Henning Kamp wrote: > In message <200510101001.38294.dfr@nlsystems.com>, Doug Rabson writes: > > >>> We could do that. I had some thoughts on this: >>> -> In the future, we want to make it difficult for people to add new >>> external mount programs [...] >>> >> >> The mount program isn't always just doing argument parsing. >> > > Agreed, that's why it didn't say "impossible" :-) > > I think we are basically in agreement here, the point is to avoid > pointless mount_foo(8) programs. So (as I understand it), the suggestion is to get rid of all mount_foo programs that just deal with mount parameters. I guess the operation of mount then would be to check for mount_foo and exec it if it exists, otherwise do nmount stuff to handle the mount itself. That would work nicely for mount_webdav (which is *really* cool if you have a chance to play with it on a mac). From owner-freebsd-arch@FreeBSD.ORG Mon Oct 10 10:42:58 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5015116A41F; Mon, 10 Oct 2005 10:42:58 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id E837A43D45; Mon, 10 Oct 2005 10:42:57 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 46AF4BC74; Mon, 10 Oct 2005 10:42:56 +0000 (UTC) To: Doug Rabson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 10 Oct 2005 11:38:58 BST." <0A7E4AF1-C6C1-4D13-A81F-B6C84DB9B5CA@nlsystems.com> Date: Mon, 10 Oct 2005 12:42:55 +0200 Message-ID: <13846.1128940975@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Craig Rodrigues , pjd@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] Teaching mount(8) to use nmount() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 10:42:58 -0000 In message <0A7E4AF1-C6C1-4D13-A81F-B6C84DB9B5CA@nlsystems.com>, Doug Rabson wr ites: >So (as I understand it), the suggestion is to get rid of all >mount_foo programs that just deal with mount parameters. I guess the >operation of mount then would be to check for mount_foo and exec it >if it exists, otherwise do nmount stuff to handle the mount itself. >That would work nicely for mount_webdav (which is *really* cool if >you have a chance to play with it on a mac). Exactly. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 03:23:31 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFC9E16A41F for ; Thu, 13 Oct 2005 03:23:31 +0000 (GMT) (envelope-from bsddiy@126.com) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C526443D46 for ; Thu, 13 Oct 2005 03:23:31 +0000 (GMT) (envelope-from bsddiy@126.com) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9D3NOfs006045 for ; Thu, 13 Oct 2005 03:23:25 GMT (envelope-from bsddiy@126.com) Message-ID: <434DD327.7090200@126.com> Date: Thu, 13 Oct 2005 11:23:19 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20050928 X-Accept-Language: en-us, en MIME-Version: 1.0 To: arch@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 03:23:32 -0000 I am trying to implement POSIX sigqueue, while staring some code in machdep.c and trap.c, I found our si_code for siginfo structure is not in POSIX standard, all are machine dependent magical values pushed by CPU. POSIX lists all these standard codes: http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html /* codes for SIGILL */ ILL_ILLOPC ILL_ILLOPN ILL_ILLADR ILL_ILLTRP ILL_PRVOPC ILL_PRVREG ILL_COPROC ILL_BADSTK /* codes for SIGBUS */ BUS_ADRALN BUS_ADRERR BUS_OBJERR BUS_RESERVED /* codes for SIGSEGV */ SEGV_MAPERR SEGV_ACCERR /* codes for SIGFPE */ FPE_INTOVF 1 FPE_INTDIV 2 FPE_FLTDIV 3 FPE_FLTOVF 4 FPE_FLTUND 5 FPE_FLTRES 6 FPE_FLTINV 7 FPE_FLTSUB 8 /* codes for SIGTRAP */ TRAP_BRKPT TRAP_TRACE ... Note that, NetBSD and Linux had already used the POSIX codes, should we use them too? David Xu From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 06:10:23 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD50A16A41F for ; Thu, 13 Oct 2005 06:10:23 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3755443D48 for ; Thu, 13 Oct 2005 06:10:18 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.204] ([192.168.254.204]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j9D6A08u046986; Thu, 13 Oct 2005 00:10:01 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <434DFA35.6070902@samsco.org> Date: Thu, 13 Oct 2005 00:09:57 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050615 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <434DD327.7090200@126.com> In-Reply-To: <434DD327.7090200@126.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED, UPPERCASE_25_50 autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: arch@freebsd.org Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 06:10:24 -0000 David Xu wrote: > I am trying to implement POSIX sigqueue, while staring some code > in machdep.c and trap.c, I found our si_code for siginfo structure > is not in POSIX standard, all are machine dependent magical values > pushed by CPU. POSIX lists all these standard codes: > > http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html > > /* codes for SIGILL */ > ILL_ILLOPC > ILL_ILLOPN > ILL_ILLADR > ILL_ILLTRP > ILL_PRVOPC > ILL_PRVREG > ILL_COPROC > ILL_BADSTK > > /* codes for SIGBUS */ > BUS_ADRALN > BUS_ADRERR > BUS_OBJERR > BUS_RESERVED > > /* codes for SIGSEGV */ > SEGV_MAPERR > SEGV_ACCERR > > /* codes for SIGFPE */ > FPE_INTOVF 1 > FPE_INTDIV 2 > FPE_FLTDIV 3 > FPE_FLTOVF 4 > FPE_FLTUND 5 > FPE_FLTRES 6 > FPE_FLTINV 7 > FPE_FLTSUB 8 > > /* codes for SIGTRAP */ > TRAP_BRKPT > TRAP_TRACE > > ... > > Note that, NetBSD and Linux had already used the POSIX codes, should we > use them too? > > David Xu > I'm by no means an expert in this work, but one thing that I will say is that you should be careful and look at the previous attempts here in FreeBSD. I believe that Juli Mallett tried implementing signal queues a coupld of years ago but pulled them out because it turned out hard to make them reliable in low-memory situations. Scott From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 06:49:00 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F36116A41F for ; Thu, 13 Oct 2005 06:49:00 +0000 (GMT) (envelope-from bsddiy@126.com) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3736D43D45; Thu, 13 Oct 2005 06:49:00 +0000 (GMT) (envelope-from bsddiy@126.com) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9D6mtnO037928; Thu, 13 Oct 2005 06:48:56 GMT (envelope-from bsddiy@126.com) Message-ID: <434E0358.5060306@126.com> Date: Thu, 13 Oct 2005 14:48:56 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20050928 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Long References: <434DD327.7090200@126.com> <434DFA35.6070902@samsco.org> In-Reply-To: <434DFA35.6070902@samsco.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 06:49:00 -0000 Scott Long wrote: > I'm by no means an expert in this work, but one thing that I will say is > that you should be careful and look at the previous attempts here in > FreeBSD. I believe that Juli Mallett tried implementing signal queues a > coupld of years ago but pulled them out because it turned out hard to > make them reliable in low-memory situations. > > Scott Thanks, but that's not a problem for me, I have already considered it, my perforce tree has code to handle the situation. David Xu From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 15:32:21 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3F5E16A421 for ; Thu, 13 Oct 2005 15:32:21 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B16D43D4C for ; Thu, 13 Oct 2005 15:32:20 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from [10.50.41.234] (Not Verified[10.50.41.234]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Thu, 13 Oct 2005 11:48:42 -0400 From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 13 Oct 2005 10:31:50 -0400 User-Agent: KMail/1.8.2 References: <434DD327.7090200@126.com> In-Reply-To: <434DD327.7090200@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510131031.53753.jhb@freebsd.org> Cc: David Xu Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 15:32:22 -0000 On Wednesday 12 October 2005 11:23 pm, David Xu wrote: > I am trying to implement POSIX sigqueue, while staring some code > in machdep.c and trap.c, I found our si_code for siginfo structure > is not in POSIX standard, all are machine dependent magical values > pushed by CPU. POSIX lists all these standard codes: > > http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html > > /* codes for SIGILL */ > ILL_ILLOPC > ILL_ILLOPN > ILL_ILLADR > ILL_ILLTRP > ILL_PRVOPC > ILL_PRVREG > ILL_COPROC > ILL_BADSTK > > /* codes for SIGBUS */ > BUS_ADRALN > BUS_ADRERR > BUS_OBJERR > BUS_RESERVED > > /* codes for SIGSEGV */ > SEGV_MAPERR > SEGV_ACCERR > > /* codes for SIGFPE */ > FPE_INTOVF 1 > FPE_INTDIV 2 > FPE_FLTDIV 3 > FPE_FLTOVF 4 > FPE_FLTUND 5 > FPE_FLTRES 6 > FPE_FLTINV 7 > FPE_FLTSUB 8 > > /* codes for SIGTRAP */ > TRAP_BRKPT > TRAP_TRACE > > ... > > Note that, NetBSD and Linux had already used the POSIX codes, should we > use them too? Hmm, looks like we do use these values in some cases on i386 at least for SIGFPE and possibly SIGBUS. I think you should fix all the archs to use these codes. I would even go ahead and commit that on its own before the POSIX sigqueue stuff. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 17:55:02 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21EA216A41F; Thu, 13 Oct 2005 17:55:02 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC98043D45; Thu, 13 Oct 2005 17:55:01 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9DHswFQ029799; Thu, 13 Oct 2005 10:54:58 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9DHsvaK029797; Thu, 13 Oct 2005 10:54:57 -0700 Date: Thu, 13 Oct 2005 10:54:57 -0700 From: Brooks Davis To: John Baldwin Message-ID: <20051013175457.GA27418@odin.ac.hmc.edu> References: <434DD327.7090200@126.com> <200510131031.53753.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <200510131031.53753.jhb@freebsd.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: David Xu , freebsd-arch@freebsd.org Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 17:55:02 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 13, 2005 at 10:31:50AM -0400, John Baldwin wrote: > On Wednesday 12 October 2005 11:23 pm, David Xu wrote: > > I am trying to implement POSIX sigqueue, while staring some code > > in machdep.c and trap.c, I found our si_code for siginfo structure > > is not in POSIX standard, all are machine dependent magical values > > pushed by CPU. POSIX lists all these standard codes: > > > > http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html > > > > /* codes for SIGILL */ > > ILL_ILLOPC > > ILL_ILLOPN > > ILL_ILLADR > > ILL_ILLTRP > > ILL_PRVOPC > > ILL_PRVREG > > ILL_COPROC > > ILL_BADSTK > > > > /* codes for SIGBUS */ > > BUS_ADRALN > > BUS_ADRERR > > BUS_OBJERR > > BUS_RESERVED > > > > /* codes for SIGSEGV */ > > SEGV_MAPERR > > SEGV_ACCERR > > > > /* codes for SIGFPE */ > > FPE_INTOVF 1 > > FPE_INTDIV 2 > > FPE_FLTDIV 3 > > FPE_FLTOVF 4 > > FPE_FLTUND 5 > > FPE_FLTRES 6 > > FPE_FLTINV 7 > > FPE_FLTSUB 8 > > > > /* codes for SIGTRAP */ > > TRAP_BRKPT > > TRAP_TRACE > > > > ... > > > > Note that, NetBSD and Linux had already used the POSIX codes, should we > > use them too? >=20 > Hmm, looks like we do use these values in some cases on i386 at least for= =20 > SIGFPE and possibly SIGBUS. I think you should fix all the archs to use= =20 > these codes. I would even go ahead and commit that on its own before the= =20 > POSIX sigqueue stuff. I agree. I ran into our lack of many of these just yesterday when working on porting Open MPI[0]. I've got patches that make us compile there that will be needed for the foreseeable future, but to be blunt the current status of si_code support is really lame. We don't even have a list of values we do return other then some vague allusions to values SI_ and FPE_ in sigaction(2). It would be nice if we could at least define the values POSIX says we should define and either implement them or document what we do implement. -- Brooks [0] Of course what Open MPI is doing with the values is utterly evil since it calls all sorts of non-signal safe functions in the signal handler, but that's another story. --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --zhXaljGHf11kAtnf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDTp9xXY6L6fI4GtQRAnjyAJ0VR6oDy03ZdsPto2erOqKp5BcvTwCfbfrU NeGUbqV7RAktO169pyGNeyg= =KuIS -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 22:29:50 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 48CC916A41F; Thu, 13 Oct 2005 22:29:49 +0000 (GMT) (envelope-from davidxu@freebsd.org) Message-ID: <434EDFF0.8040008@freebsd.org> Date: Fri, 14 Oct 2005 06:30:08 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.10) Gecko/20050806 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <434DD327.7090200@126.com> <200510131031.53753.jhb@freebsd.org> In-Reply-To: <200510131031.53753.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: David Xu , freebsd-arch@freebsd.org Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 22:29:50 -0000 John Baldwin wrote: >Hmm, looks like we do use these values in some cases on i386 at least for >SIGFPE and possibly SIGBUS. I think you should fix all the archs to use >these codes. I would even go ahead and commit that on its own before the >POSIX sigqueue stuff. > > > I will fix these codes for i386 and amd64 soon, I can not fully fix it for other arches. David Xu From owner-freebsd-arch@FreeBSD.ORG Sat Oct 15 00:58:40 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00A9116A420 for ; Sat, 15 Oct 2005 00:58:39 +0000 (GMT) (envelope-from caiquanqing@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC23D43D48 for ; Sat, 15 Oct 2005 00:58:38 +0000 (GMT) (envelope-from caiquanqing@gmail.com) Received: by xproxy.gmail.com with SMTP id t6so32289wxc for ; Fri, 14 Oct 2005 17:58:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type; b=l1U5HrMLfKc1SYL24Fbv1/p90kp5ZKLZhAKv3JQ/ux3MpwrQKfnSZ7cNqGZWLKASRK1P6gJiT7d4eMeSjhMtOkg5er6CKxID6t0BoNDE7nwvkgvI5IpIZt5siOCRYt8G8YJNZSdie7edW/iIa5kXgyX2CxMp1yJvERnwLdv0hsM= Received: by 10.70.40.11 with SMTP id n11mr1474350wxn; Fri, 14 Oct 2005 17:58:38 -0700 (PDT) Received: by 10.70.11.18 with HTTP; Fri, 14 Oct 2005 17:58:38 -0700 (PDT) Message-ID: <2b22951e0510141758x1edef8jf7caf2514c336514@mail.gmail.com> Date: Fri, 14 Oct 2005 17:58:38 -0700 From: "Cai, Quanqing" To: freebsd-firewire@freebsd.org, freebsd-arch@freebsd.org, freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Tai-hwa Liang Subject: fwe -> fwip in GENERIC? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2005 00:58:40 -0000 Hi guys, When I was fixing bug kern/82727: http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/82727, I found we use fwe(Ethernet over FireWire) in GENERIC kernel, not fwip(IP over FireWire). But we all know that IP over FireWire is more widely used on other OSes, an= d now this bug is fixed, do we need change fwe to fwip? I talked it with Tai-hwa Liang, he agrees with me. But he suggests me to post here for more advices, since there might be some considerations such like backward compatibility or code size that makes re@ made this decision. Please give you advice or opinion. Best Cai, Quanqing From owner-freebsd-arch@FreeBSD.ORG Sat Oct 15 02:35:59 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AD1616A41F; Sat, 15 Oct 2005 02:35:59 +0000 (GMT) (envelope-from ikob@koganei.wide.ad.jp) Received: from ns.koganei.wide.ad.jp (ns.koganei.wide.ad.jp [202.249.37.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2344443D45; Sat, 15 Oct 2005 02:35:58 +0000 (GMT) (envelope-from ikob@koganei.wide.ad.jp) Received: from [10.0.1.3] (235.pool7.dsl24mtokyo.att.ne.jp [165.76.174.235]) (authenticated bits=0) by ns.koganei.wide.ad.jp (8.12.11/8.12.11) with ESMTP id j9F2ZtRR036190; Sat, 15 Oct 2005 11:35:56 +0900 (JST) (envelope-from ikob@koganei.wide.ad.jp) In-Reply-To: <2b22951e0510141758x1edef8jf7caf2514c336514@mail.gmail.com> References: <2b22951e0510141758x1edef8jf7caf2514c336514@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Katsushi Kobayashi Date: Sat, 15 Oct 2005 11:35:55 +0900 To: "Cai, Quanqing" X-Mailer: Apple Mail (2.734) Cc: freebsd-net@freebsd.org, Tai-hwa Liang , freebsd-firewire@freebsd.org, freebsd-arch@freebsd.org Subject: Re: fwe -> fwip in GENERIC? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2005 02:35:59 -0000 Hi, Although I don't know the detail of fwe technology, I understand the technology is a proprietary one. It is better to provide a compatibility with RFC standard firewire over IP, if some volunteer are there. On 2005/10/15, at 9:58, Cai, Quanqing wrote: > Hi guys, > > When I was fixing bug kern/82727: > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/82727, I found we use > fwe(Ethernet over FireWire) in GENERIC kernel, not fwip(IP over > FireWire). > But we all know that IP over FireWire is more widely used on other > OSes, and > now this bug is fixed, do we need change fwe to fwip? > > I talked it with Tai-hwa Liang, he agrees with me. But he suggests > me to > post here for more advices, since there might be some > considerations such > like backward compatibility or code size that makes re@ made this > decision. > > Please give you advice or opinion. > > Best > Cai, Quanqing > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch- > unsubscribe@freebsd.org" >