From owner-freebsd-fs@FreeBSD.ORG Sun Sep 7 15:09:00 2008 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B2701065677 for ; Sun, 7 Sep 2008 15:09:00 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 695C88FC14 for ; Sun, 7 Sep 2008 15:08:59 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.2/8.14.2) with ESMTP id m87EdB4q069071; Sun, 7 Sep 2008 18:39:11 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sun, 7 Sep 2008 18:39:11 +0400 (MSD) From: Dmitry Morozovsky To: freebsd-fs@FreeBSD.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (woozle.rinet.ru [0.0.0.0]); Sun, 07 Sep 2008 18:39:11 +0400 (MSD) Cc: Pawel Jakub Dawidek Subject: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2008 15:09:00 -0000 Dear colleagues, is there any way so one can export ZFS file system to more than one net? in classic NFS I would use more than one line in /etc/exports -- how can I express such behaviour in zfs properties? Thanks in advance. Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Sun Sep 7 22:17:07 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FC21106564A for ; Sun, 7 Sep 2008 22:17:07 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [76.96.30.24]) by mx1.freebsd.org (Postfix) with ESMTP id 438F98FC12 for ; Sun, 7 Sep 2008 22:17:07 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA06.emeryville.ca.mail.comcast.net ([76.96.30.51]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id BqMP1a00B16AWCUA2y16El; Sun, 07 Sep 2008 22:01:06 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA06.emeryville.ca.mail.comcast.net with comcast id By141a00D4v8bD78Sy15NN; Sun, 07 Sep 2008 22:01:06 +0000 X-Authority-Analysis: v=1.0 c=1 a=_xSQw29cvt0A:10 a=mtup3TuceYcA:10 a=6I5d2MoRAAAA:8 a=1TPBueD4AAAA:8 a=QycZ5dHgAAAA:8 a=kgleE0XVB3sWru73yLkA:9 a=xVbK4nlI7tJ8Qp0IxeCai7Zy7RcA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id A6FF317B84E; Sun, 7 Sep 2008 15:01:04 -0700 (PDT) Date: Sun, 7 Sep 2008 15:01:04 -0700 From: Jeremy Chadwick To: Dmitry Morozovsky Message-ID: <20080907220104.GA26094@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-fs@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2008 22:17:07 -0000 On Sun, Sep 07, 2008 at 06:39:11PM +0400, Dmitry Morozovsky wrote: > Dear colleagues, > > is there any way so one can export ZFS file system to more than one net? > > in classic NFS I would use more than one line in /etc/exports -- how can I > express such behaviour in zfs properties? Didn't you inadvertently ask this same question 6 months ago? :-) http://lists.freebsd.org/pipermail/freebsd-current/2008-March/084079.html I believe if 'sharenfs=off' (the default), you can manage NFS mounts via /etc/exports like normal. Ideally, you should (?) be able to use multiple "-network xxx/netmask" entries on the same export line. If you absolutely must do it via the 'zfs' command, according to pjd@'s EuroBSDCon presentation, this should work: # /etc/rc.d/mountd start # zfs set sharenfs="ro,network=x.x.x.x,mask=y.y.y.y" some_fs # /etc/rc.d/mountd reload /etc/rc.d/mountd is already configured to read /etc/exports and /etc/zfs/exports, so all you should have to do is mountd_enable="yes" in rc.conf. You can also use CIDR syntax in network=xx/yy, which should decrease the line length. pjd@'s paper is here -- see page 18, "NFS is easy": http://2007.eurobsdcon.org/presentations/Pawel_Jakub_Dawidek/eurobsdcon07_zfs.pdf However, I'd advocate you consider running pf on the machine running mountd instead, and use an actual firewall to block who can talk to mountd on the machine exporting the shares. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-fs@FreeBSD.ORG Sun Sep 7 22:43:06 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ED4A1065673; Sun, 7 Sep 2008 22:43:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 74AB58FC19; Sun, 7 Sep 2008 22:43:05 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.2/8.14.2) with ESMTP id m87Mh3fG055664; Mon, 8 Sep 2008 02:43:03 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Mon, 8 Sep 2008 02:43:03 +0400 (MSD) From: Dmitry Morozovsky To: Jeremy Chadwick In-Reply-To: <20080907220104.GA26094@icarus.home.lan> Message-ID: References: <20080907220104.GA26094@icarus.home.lan> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (woozle.rinet.ru [0.0.0.0]); Mon, 08 Sep 2008 02:43:03 +0400 (MSD) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2008 22:43:06 -0000 On Sun, 7 Sep 2008, Jeremy Chadwick wrote: JC> > is there any way so one can export ZFS file system to more than one net? JC> > JC> > in classic NFS I would use more than one line in /etc/exports -- how can I JC> > express such behaviour in zfs properties? JC> JC> Didn't you inadvertently ask this same question 6 months ago? :-) JC> JC> http://lists.freebsd.org/pipermail/freebsd-current/2008-March/084079.html Well, not exactly - that time I did not bump into different destination problem ;) JC> I believe if 'sharenfs=off' (the default), you can manage NFS mounts via JC> /etc/exports like normal. Ideally, you should (?) be able to use JC> multiple "-network xxx/netmask" entries on the same export line. Hmm, that would do the trick; however, it seems to me that ZFS file system properties should be producet from the single source. JC> If you absolutely must do it via the 'zfs' command, according to pjd@'s JC> EuroBSDCon presentation, this should work: JC> JC> # /etc/rc.d/mountd start JC> # zfs set sharenfs="ro,network=x.x.x.x,mask=y.y.y.y" some_fs JC> # /etc/rc.d/mountd reload Well, this configures only one network per file system, isn't it? BTW, mountd will be reloaded by zfs automagically (and, as Kris bumps ito it, it would create a problem with race hole of inaccessible NFS mounts while mountd reloads the list) JC> However, I'd advocate you consider running pf on the machine running JC> mountd instead, and use an actual firewall to block who can talk to JC> mountd on the machine exporting the shares. I would prefer to do both ;) Oh, and hosts.allow possibly too... Or, would it be too inefficient? Thanks! Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Sun Sep 7 23:36:40 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AEC106567A for ; Sun, 7 Sep 2008 23:36:40 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA09.emeryville.ca.mail.comcast.net (qmta09.emeryville.ca.mail.comcast.net [76.96.30.96]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDD08FC15 for ; Sun, 7 Sep 2008 23:36:39 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by QMTA09.emeryville.ca.mail.comcast.net with comcast id Bn5A1a0070mlR8UA9zcfDX; Sun, 07 Sep 2008 23:36:39 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA11.emeryville.ca.mail.comcast.net with comcast id Bzcd1a0054v8bD78XzcdXG; Sun, 07 Sep 2008 23:36:37 +0000 X-Authority-Analysis: v=1.0 c=1 a=_xSQw29cvt0A:10 a=mtup3TuceYcA:10 a=6I5d2MoRAAAA:8 a=QycZ5dHgAAAA:8 a=jKem1x4PJD2K3_lIUQsA:9 a=N--hJpdv3fJlx6R3b5CcVKkyEGwA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 19B8F17B84E; Sun, 7 Sep 2008 16:36:37 -0700 (PDT) Date: Sun, 7 Sep 2008 16:36:37 -0700 From: Jeremy Chadwick To: Dmitry Morozovsky Message-ID: <20080907233637.GA51889@icarus.home.lan> References: <20080907220104.GA26094@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2008 23:36:40 -0000 On Mon, Sep 08, 2008 at 02:43:03AM +0400, Dmitry Morozovsky wrote: > On Sun, 7 Sep 2008, Jeremy Chadwick wrote: > > JC> > is there any way so one can export ZFS file system to more than one net? > JC> > > JC> > in classic NFS I would use more than one line in /etc/exports -- how can I > JC> > express such behaviour in zfs properties? > JC> > JC> Didn't you inadvertently ask this same question 6 months ago? :-) > JC> > JC> http://lists.freebsd.org/pipermail/freebsd-current/2008-March/084079.html > > Well, not exactly - that time I did not bump into different destination problem > ;) > > JC> I believe if 'sharenfs=off' (the default), you can manage NFS mounts via > JC> /etc/exports like normal. Ideally, you should (?) be able to use > JC> multiple "-network xxx/netmask" entries on the same export line. > > Hmm, that would do the trick; however, it seems to me that ZFS file system > properties should be producet from the single source. I interpret this to mean "there should be only one export(5) file used". That would be something to take up with pjd@, but I'm willing to bet that behaviour is not going to change. There is probably a good reason why /etc/zfs/exports exists. That said, what happens if you edit /etc/zfs/exports by hand, then run "zfs list -o sharenfs"? Does it show the changes you put in place? If so, then great -- it means there's two ways a person can edit the NFS-exported ZFS shares (by editing the file directly, or using "zfs"). > JC> If you absolutely must do it via the 'zfs' command, according to pjd@'s > JC> EuroBSDCon presentation, this should work: > JC> > JC> # /etc/rc.d/mountd start > JC> # zfs set sharenfs="ro,network=x.x.x.x,mask=y.y.y.y" some_fs > JC> # /etc/rc.d/mountd reload > > Well, this configures only one network per file system, isn't it? BTW, mountd > will be reloaded by zfs automagically (and, as Kris bumps ito it, it would > create a problem with race hole of inaccessible NFS mounts while mountd reloads > the list) Does the below work? # zfs set sharenfs="ro,network=aaa/xx,network=bbb/yy,network=ccc/zz" some_fs If not (e.g. mountd rejects it, or only the first network is used), then this would indicate a problem with the exports file syntax / problem with mountd, and not with ZFS. Solaris solves all of this, AFAIK, by having a central command that manages the export list: share(1). "zfs" on Solaris even calls this. BSD does not have this utility. > JC> However, I'd advocate you consider running pf on the machine running > JC> mountd instead, and use an actual firewall to block who can talk to > JC> mountd on the machine exporting the shares. > > I would prefer to do both ;) Oh, and hosts.allow possibly too... Or, would it > be too inefficient? There is absolutely no reason to do both. Packets arriving on the network will hit the pf stack before ever reaching mountd, which is perfect, and a good security model. Additionally, libwrap (hosts.allow/deny) is a travesty, and should be nuked from the face of the planet. It provides a false sense of security -- it doesn't stop someone (anyone!) from being able to actually connect to that TCP port (or in the case of UDP, I believe a deny/rejection will actually send back a packet of some kind), which means people will then know you've got (rpcbind|mountd|ftpd|whatever) running, which gives an attacker/hacker significant hints about what your system is running, and more ammunition. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 02:22:20 2008 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C691065670 for ; Mon, 8 Sep 2008 02:22:20 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0FB8D8FC1D for ; Mon, 8 Sep 2008 02:22:20 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m882MJH4006666 for ; Mon, 8 Sep 2008 02:22:19 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m882MJUL006662 for freebsd-fs@FreeBSD.org; Mon, 8 Sep 2008 02:22:19 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Sep 2008 02:22:19 GMT Message-Id: <200809080222.m882MJUL006662@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-fs@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 02:22:20 -0000 The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/127029 fs [panic] mount(8): trying to mount a write protected zi o kern/126287 fs [ufs] [panic] Kernel panics while mounting an UFS file o kern/125536 fs [ext2fs] ext 2 mounts cleanly but fails on commands li o kern/124621 fs [ext3] Cannot mount ext2fs partition o kern/122888 fs [zfs] zfs hang w/ prefetch on, zil off while running t o bin/122172 fs [fs]: amd(8) automount daemon dies on 6.3-STABLE i386, o bin/121072 fs [smbfs] mount_smbfs(8) cannot normally convert the cha o bin/118249 fs mv(1): moving a directory changes its mtime o kern/116170 fs [panic] Kernel panic when mounting /tmp o kern/114955 fs [cd9660] [patch] [request] support for mask,dirmask,ui o kern/114847 fs [ntfs] [patch] [request] dirmask support for NTFS ala o kern/114676 fs [ufs] snapshot creation panics: snapacct_ufs2: bad blo o bin/114468 fs [patch] [request] add -d option to umount(8) to detach o bin/113838 fs [patch] [request] mount(8): add support for relative p o bin/113049 fs [patch] [request] make quot(8) use getopt(3) and show o kern/112658 fs [smbfs] [patch] smbfs and caching problems (resolves b o kern/93942 fs [vfs] [patch] panic: ufs_dirbad: bad dir (patch from D 17 problems total. Bugs can be in one of several states: o - open A problem report has been submitted, no sanity checking performed. a - analyzed The problem is understood and a solution is being sought. f - feedback Further work requires additional information from the originator or the community - possibly confirmation of the effectiveness of a proposed solution. p - patched A patch has been committed, but some issues (MFC and / or confirmation from originator) are still open. r - repocopy The resolution of the problem report is dependent on a repocopy operation within the CVS repository which is awaiting completion. s - suspended The problem is not being worked on, due to lack of information or resources. This is a prime candidate for somebody who is looking for a project to do. If the problem cannot be solved at all, it will be closed, rather than suspended. c - closed A problem report is closed when any changes have been integrated, documented, and tested -- or when fixing the problem is abandoned. From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 07:21:50 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 580341065673; Mon, 8 Sep 2008 07:21:50 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id B4AAE8FC30; Mon, 8 Sep 2008 07:21:49 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.2/8.14.2) with ESMTP id m887LmC1021913; Mon, 8 Sep 2008 11:21:48 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Mon, 8 Sep 2008 11:21:48 +0400 (MSD) From: Dmitry Morozovsky To: Jeremy Chadwick In-Reply-To: <20080907233637.GA51889@icarus.home.lan> Message-ID: References: <20080907220104.GA26094@icarus.home.lan> <20080907233637.GA51889@icarus.home.lan> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (woozle.rinet.ru [0.0.0.0]); Mon, 08 Sep 2008 11:21:48 +0400 (MSD) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 07:21:50 -0000 On Sun, 7 Sep 2008, Jeremy Chadwick wrote: JC> That said, what happens if you edit /etc/zfs/exports by hand, then run JC> "zfs list -o sharenfs"? Does it show the changes you put in place? If JC> so, then great -- it means there's two ways a person can edit the JC> NFS-exported ZFS shares (by editing the file directly, or using "zfs"). Nope, ZFS does not track /etc/zfs/export, hence "Do not edit!" comment in it. JC> Does the below work? JC> JC> # zfs set sharenfs="ro,network=aaa/xx,network=bbb/yy,network=ccc/zz" some_fs JC> JC> If not (e.g. mountd rejects it, or only the first network is used), then JC> this would indicate a problem with the exports file syntax / problem JC> with mountd, and not with ZFS. It is of course FreeBSD' mountd problem (more than it does not understand CIDR slashed notation): marck@beaver:~# cat /etc/zfs/exports # !!! DO NOT EDIT THIS FILE MANUALLY !!! /FreeBSD -ro -alldirs -network 195.54.192.0 -mask 255.255.255.192 255.255.255.192 marck@beaver:~# zfs get sharenfs bv/FreeBSD NAME PROPERTY VALUE SOURCE bv/FreeBSD sharenfs -ro -alldirs -network 195.54.192.0 -mask 255.255.255.192 local marck@beaver:~# zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,192.168.39.0/24" bv/FreeBSD marck@beaver:~# zfs get sharenfs bv/FreeBSD NAME PROPERTY VALUE SOURCE bv/FreeBSD sharenfs ro,alldirs,network=195.54.192.0/26,192.168.39.0/24 local Sep 8 11:18:18 beaver mountd[25992]: can't get address info for host 192.168.39.0/24 Sep 8 11:18:18 beaver mountd[25992]: bad host 192.168.39.0/24, skipping Sep 8 11:18:18 beaver mountd[25992]: network/host conflict Sep 8 11:18:18 beaver mountd[25992]: bad exports list line /FreeBSD -ro -alldirs -network JC> > I would prefer to do both ;) Oh, and hosts.allow possibly too... Or, would it JC> > be too inefficient? JC> JC> There is absolutely no reason to do both. Packets arriving on the JC> network will hit the pf stack before ever reaching mountd, which is JC> perfect, and a good security model. JC> JC> Additionally, libwrap (hosts.allow/deny) is a travesty, and should be JC> nuked from the face of the planet. It provides a false sense of JC> security -- it doesn't stop someone (anyone!) from being able to JC> actually connect to that TCP port (or in the case of UDP, I believe a JC> deny/rejection will actually send back a packet of some kind), which JC> means people will then know you've got (rpcbind|mountd|ftpd|whatever) JC> running, which gives an attacker/hacker significant hints about what JC> your system is running, and more ammunition. Well, all there actually make sense. Thanks, I'll think about it a little bit more. Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 09:10:54 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC691106564A for ; Mon, 8 Sep 2008 09:10:54 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by mx1.freebsd.org (Postfix) with ESMTP id 72EFB8FC16 for ; Mon, 8 Sep 2008 09:10:54 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA10.westchester.pa.mail.comcast.net with comcast id C99M1a00C0EZKEL5A9AtTQ; Mon, 08 Sep 2008 09:10:53 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA01.westchester.pa.mail.comcast.net with comcast id C9As1a0094v8bD73M9As0F; Mon, 08 Sep 2008 09:10:53 +0000 X-Authority-Analysis: v=1.0 c=1 a=_xSQw29cvt0A:10 a=mtup3TuceYcA:10 a=QycZ5dHgAAAA:8 a=E6XkfY6GvsLPn7CQ8QAA:9 a=056YzYvocAdRLlX4QHUA:7 a=Ib-uEk1cSQ-Z7Ijpw3IxwAZ1CXUA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 238AC17B84F; Mon, 8 Sep 2008 02:10:52 -0700 (PDT) Date: Mon, 8 Sep 2008 02:10:52 -0700 From: Jeremy Chadwick To: Dmitry Morozovsky Message-ID: <20080908091052.GA63182@icarus.home.lan> References: <20080907220104.GA26094@icarus.home.lan> <20080907233637.GA51889@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 09:10:54 -0000 On Mon, Sep 08, 2008 at 11:21:48AM +0400, Dmitry Morozovsky wrote: > On Sun, 7 Sep 2008, Jeremy Chadwick wrote: > JC> That said, what happens if you edit /etc/zfs/exports by hand, then run > JC> "zfs list -o sharenfs"? Does it show the changes you put in place? If > JC> so, then great -- it means there's two ways a person can edit the > JC> NFS-exported ZFS shares (by editing the file directly, or using "zfs"). > > Nope, ZFS does not track /etc/zfs/export, hence "Do not edit!" comment in it. Understood. Then using "zfs" is the only option. > JC> If not (e.g. mountd rejects it, or only the first network is used), then > JC> this would indicate a problem with the exports file syntax / problem > JC> with mountd, and not with ZFS. > > It is of course FreeBSD' mountd problem (more than it does not understand CIDR > slashed notation): > > marck@beaver:~# cat /etc/zfs/exports > # !!! DO NOT EDIT THIS FILE MANUALLY !!! > > /FreeBSD -ro -alldirs -network 195.54.192.0 -mask 255.255.255.192 > 255.255.255.192 > marck@beaver:~# zfs get sharenfs bv/FreeBSD > NAME PROPERTY VALUE SOURCE > bv/FreeBSD sharenfs -ro -alldirs -network 195.54.192.0 -mask 255.255.255.192 local > marck@beaver:~# zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,192.168.39.0/24" bv/FreeBSD > marck@beaver:~# zfs get sharenfs bv/FreeBSD > NAME PROPERTY VALUE SOURCE > bv/FreeBSD sharenfs ro,alldirs,network=195.54.192.0/26,192.168.39.0/24 local > > Sep 8 11:18:18 beaver mountd[25992]: can't get address info for host 192.168.39.0/24 > Sep 8 11:18:18 beaver mountd[25992]: bad host 192.168.39.0/24, skipping > Sep 8 11:18:18 beaver mountd[25992]: network/host conflict > Sep 8 11:18:18 beaver mountd[25992]: bad exports list line /FreeBSD -ro -alldirs -network It does support CIDR, and the output mountd gave you even shows that it does (look closely at what "bad host" it's giving you -- that isn't the first host in the exports list!). You changed the syntax of what I gave you as an example. Look closely: # zfs set sharenfs="ro,network=aaa/xx,network=bbb/yy,network=ccc/zz" some_fs Here's what you typed in: # zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,192.168.39.0/24" bv/FreeBSD -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 09:26:32 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5C11065670; Mon, 8 Sep 2008 09:26:32 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 897E58FC28; Mon, 8 Sep 2008 09:26:31 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.2/8.14.2) with ESMTP id m889QUpq075582; Mon, 8 Sep 2008 13:26:30 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Mon, 8 Sep 2008 13:26:30 +0400 (MSD) From: Dmitry Morozovsky To: Jeremy Chadwick In-Reply-To: <20080908091052.GA63182@icarus.home.lan> Message-ID: References: <20080907220104.GA26094@icarus.home.lan> <20080907233637.GA51889@icarus.home.lan> <20080908091052.GA63182@icarus.home.lan> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (woozle.rinet.ru [0.0.0.0]); Mon, 08 Sep 2008 13:26:30 +0400 (MSD) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 09:26:32 -0000 On Mon, 8 Sep 2008, Jeremy Chadwick wrote: [snip] JC> It does support CIDR, and the output mountd gave you even shows that JC> it does (look closely at what "bad host" it's giving you -- that isn't JC> the first host in the exports list!). Yes, I already catched it; see below. JC> You changed the syntax of what I gave you as an example. Look closely: JC> JC> # zfs set sharenfs="ro,network=aaa/xx,network=bbb/yy,network=ccc/zz" some_fs JC> JC> Here's what you typed in: JC> JC> # zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,192.168.39.0/24" bv/FreeBSD Anyway, it does not work, alas: marck@beaver:~# zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,network=192.168.39.0/24" bv/FreeBSD marck@beaver:~# tail /var/log/daemon Sep 8 13:22:11 beaver mountd[25992]: network/host conflict Sep 8 13:22:11 beaver mountd[25992]: bad exports list line /FreeBSD -ro -alldirs -network marck@beaver:~# cat /etc/zfs/exports # !!! DO NOT EDIT THIS FILE MANUALLY !!! /FreeBSD -ro -alldirs -network=195.54.192.0/26 -network=192.168.39.0/24 What I' m trying to express is that there would be need to export the same file system to different address blocks *with different options* - -such as rw/ro, and/or maproot/mapall. I'm starting to think we should either mimic such functionality from OpenSolaris or invent it. Thank you for cooperation! Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 09:36:49 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B0781065686 for ; Mon, 8 Sep 2008 09:36:49 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by mx1.freebsd.org (Postfix) with ESMTP id C4B008FC23 for ; Mon, 8 Sep 2008 09:36:48 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA10.westchester.pa.mail.comcast.net with comcast id C9VT1a0030cZkys5A9coBv; Mon, 08 Sep 2008 09:36:48 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA10.westchester.pa.mail.comcast.net with comcast id C9cn1a0034v8bD73W9cnek; Mon, 08 Sep 2008 09:36:48 +0000 X-Authority-Analysis: v=1.0 c=1 a=_xSQw29cvt0A:10 a=mtup3TuceYcA:10 a=QycZ5dHgAAAA:8 a=CjxIYXCZoYyU8TlV_H4A:9 a=TS4qACugJpiZ2I4WPO_g7cvzf8MA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id E2A3D17B84E; Mon, 8 Sep 2008 02:36:46 -0700 (PDT) Date: Mon, 8 Sep 2008 02:36:46 -0700 From: Jeremy Chadwick To: Dmitry Morozovsky Message-ID: <20080908093646.GA63681@icarus.home.lan> References: <20080907220104.GA26094@icarus.home.lan> <20080907233637.GA51889@icarus.home.lan> <20080908091052.GA63182@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek Subject: Re: ZFS filesystem: export for more than one subnet X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 09:36:49 -0000 On Mon, Sep 08, 2008 at 01:26:30PM +0400, Dmitry Morozovsky wrote: > On Mon, 8 Sep 2008, Jeremy Chadwick wrote: > JC> You changed the syntax of what I gave you as an example. Look closely: > JC> > JC> # zfs set sharenfs="ro,network=aaa/xx,network=bbb/yy,network=ccc/zz" some_fs > JC> > JC> Here's what you typed in: > JC> > JC> # zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,192.168.39.0/24" bv/FreeBSD > > Anyway, it does not work, alas: > > marck@beaver:~# zfs set sharenfs="ro,alldirs,network=195.54.192.0/26,network=192.168.39.0/24" bv/FreeBSD > marck@beaver:~# tail /var/log/daemon > Sep 8 13:22:11 beaver mountd[25992]: network/host conflict > Sep 8 13:22:11 beaver mountd[25992]: bad exports list line /FreeBSD -ro -alldirs -network > marck@beaver:~# cat /etc/zfs/exports > # !!! DO NOT EDIT THIS FILE MANUALLY !!! > > /FreeBSD -ro -alldirs -network=195.54.192.0/26 -network=192.168.39.0/24 Doh! Bummer. :-( > What I' m trying to express is that there would be need to export the same file > system to different address blocks *with different options* - -such as rw/ro, > and/or maproot/mapall. Correct me if I'm wrong: you want an equivalent of the below to actually work (speaking strictly from an /etc/exports perspective): /FreeBSD -ro -alldirs -network=192.168.1.0/24 /FreeBSD -rw -alldirs -network=192.168.100.0/24 /FreeBSD -ro -alldirs -network=10.0.0.0/8 Is this right? If so, I can imagine addressing/fixing this will be complex. > I'm starting to think we should either mimic such functionality from > OpenSolaris or invent it. I agree. A centralised command like share(1) would be sufficient for what's needed; in concept, something like pw(8) for NFS shares. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-fs@FreeBSD.ORG Mon Sep 8 22:26:42 2008 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47745106566B; Mon, 8 Sep 2008 22:26:42 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 20BE98FC16; Mon, 8 Sep 2008 22:26:42 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m88MQfBJ053786; Mon, 8 Sep 2008 22:26:41 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m88MQesR053782; Mon, 8 Sep 2008 22:26:40 GMT (envelope-from linimon) Date: Mon, 8 Sep 2008 22:26:40 GMT Message-Id: <200809082226.m88MQesR053782@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-fs@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/127213: [tmpfs] sendfile on tmpfs data corruption X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 22:26:42 -0000 Old Synopsis: sendfile on tmpfs data corruption New Synopsis: [tmpfs] sendfile on tmpfs data corruption Responsible-Changed-From-To: freebsd-bugs->freebsd-fs Responsible-Changed-By: linimon Responsible-Changed-When: Mon Sep 8 22:26:04 UTC 2008 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=127213 From owner-freebsd-fs@FreeBSD.ORG Tue Sep 9 18:46:13 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E08301065679 for ; Tue, 9 Sep 2008 18:46:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 769638FC22 for ; Tue, 9 Sep 2008 18:46:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m89BAMae015106 for ; Tue, 9 Sep 2008 21:10:22 +1000 Received: from besplex.bde.org (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m89BAHw1015432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Sep 2008 21:10:18 +1000 Date: Tue, 9 Sep 2008 21:10:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jaakko Heinonen In-Reply-To: <20080903160736.GA12587@a91-153-122-179.elisa-laajakaista.fi> Message-ID: <20080909204354.Q3089@besplex.bde.org> References: <200806020800.m528038T072838@freefall.freebsd.org> <20080722075718.GA1881@a91-153-120-204.elisa-laajakaista.fi> <20080722215249.K17453@delplex.bde.org> <20080723103424.GA1856@a91-153-120-204.elisa-laajakaista.fi> <20080724000618.Q16961@besplex.bde.org> <20080725072314.GA807@a91-153-120-204.elisa-laajakaista.fi> <20080725192315.D27178@delplex.bde.org> <20080903160736.GA12587@a91-153-122-179.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org Subject: Re: birthtime initialization X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2008 18:46:14 -0000 On Wed, 3 Sep 2008, Jaakko Heinonen wrote: > I further updated the patch. > > On 2008-07-25, Bruce Evans wrote: >> On Fri, 25 Jul 2008, Jaakko Heinonen wrote: >>> On 2008-07-24, Bruce Evans wrote: >>>> First, the fields shouldn't be initialized using VATTR_NULL() in >>>> VOP_GETATTR(). > > I removed VATTR_NULL() from xfs, mqueuefs, pseudofs, tmpfs, devfs > fdescfs and vattr_null() from devfs and portalfs. I also removed zeroing > from nfs. > >>> What do you think that is a proper default value for va_rdev? Some file >>> systems set it to 0 and some to VNOVAL. >> >> Either NODEV or VNOVAL explicitly translated late to NODEV. > > I changed following file systems to initialize va_rdev to NODEV instead > of 0 or VNOVAL (when appropriate): mqueuefs, tmpfs, portalfs, smbfs, > ntfs, fdescfs and msdosfs. Also in vn_stat() va_rdev is now initialized > to VNOVAL and explicitly translated to NODEV after the VOP_GETATTR() > call. > > I have tested the patch with these file systems: UFS2, UFS1, ext2fs, > ntfs, cd9660, udf, procfs, devfs, xfs, reiserfs, fdescfs, msdosfs, > mqueuefs, nfs, smbfs, portalfs. I like this version, but didn't check many details. > Index: sys/kern/vfs_vnops.c > =================================================================== > --- sys/kern/vfs_vnops.c (revision 182592) > +++ sys/kern/vfs_vnops.c (working copy) > @@ -703,6 +703,17 @@ vn_stat(vp, sb, active_cred, file_cred, > #endif > > vap = &vattr; > + > + /* > + * Initialize defaults for new and unusual fields, so that file > + * systems which don't support these fields don't need to know > + * about them. > + */ > + vap->va_birthtime.tv_sec = -1; > + vap->va_birthtime.tv_nsec = 0; > + vap->va_fsid = VNOVAL; > + vap->va_rdev = VNOVAL; Shouldn't this be NODEV? NODEV is ((dev_t)-1) and VNOVAL is plain (-1), so their values are identical after assignment to va_rdev... > + > error = VOP_GETATTR(vp, vap, active_cred); > if (error) > return (error); > @@ -750,7 +761,10 @@ vn_stat(vp, sb, active_cred, file_cred, > sb->st_nlink = vap->va_nlink; > sb->st_uid = vap->va_uid; > sb->st_gid = vap->va_gid; > - sb->st_rdev = vap->va_rdev; > + if (vap->va_rdev == VNOVAL) > + sb->st_rdev = NODEV; > + else > + sb->st_rdev = vap->va_rdev; ... this change seems to have no effect on machines with 32-bit 2's complement ints and to be wrong on other machines. Assignment of VNOVAL to va_rdev changes its value from -1 to 0xFFFFFFFFU, so it can only compare equal to VNOVAL if int has the same size as dev_t or there is stronger magic. When the comparision is fixed to compare with the assigned value (dev_t)VNOVAL == (dev_t)(-1) == NODEV, it is clear that the change has no effect. Bruce From owner-freebsd-fs@FreeBSD.ORG Thu Sep 11 00:05:46 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3040A106564A for ; Thu, 11 Sep 2008 00:05:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (unknown [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 249568FC08 for ; Thu, 11 Sep 2008 00:05:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id E7E942844D for ; Thu, 11 Sep 2008 08:05:42 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 7C44FF645A2; Thu, 11 Sep 2008 08:05:42 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id Tgo1pCuNjL-U; Thu, 11 Sep 2008 08:05:37 +0800 (CST) Received: from charlie.delphij.net (71.5.7.139.ptr.us.xo.net [71.5.7.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id A6E13F64327; Thu, 11 Sep 2008 08:05:36 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=gGLsJztUcUlE3OpihvdYtVAinmR0ACG+RYXgpxem6FyEQEJqY8EYqQMnKHcYliVnb AbZvT0jgNuIiqZo0C/z/Q== Message-ID: <48C860CD.4030507@delphij.net> Date: Wed, 10 Sep 2008 17:05:33 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.16 (X11/20080725) MIME-Version: 1.0 To: freebsd-fs@freebsd.org X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Documentation on VM/VFS? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 00:05:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I think I get confused with some concepts, is there any place that I can find some (either brief overview or in-depth) documentation about VM/VFS, especially the caching mechanism? Specifically, e.g. is it possible to skip the VM/VFS cache, and hand a page directly to the cache subsystem which is already in main memory? Some surrounding information would be useful as well. Thanks in advance! Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjIYM0ACgkQi+vbBBjt66AQQACgj2C5u0rxJzIqrdH8dfGQfhTb c6sAn0dAPw2abFfIr7o9slPj56lEi0nK =J9ZU -----END PGP SIGNATURE----- From owner-freebsd-fs@FreeBSD.ORG Thu Sep 11 14:03:54 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8011A106566B for ; Thu, 11 Sep 2008 14:03:54 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by mx1.freebsd.org (Postfix) with ESMTP id 334F08FC15 for ; Thu, 11 Sep 2008 14:03:54 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id DA2321ABCB; Thu, 11 Sep 2008 17:03:52 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A06399C9241; Thu, 11 Sep 2008 17:03:52 +0300 Received: from a91-153-122-179.elisa-laajakaista.fi (a91-153-122-179.elisa-laajakaista.fi [91.153.122.179]) by emh01.mail.saunalahti.fi (Postfix) with SMTP id 8D14B4BBB8; Thu, 11 Sep 2008 17:03:50 +0300 (EEST) Date: Thu, 11 Sep 2008 17:03:50 +0300 From: Jaakko Heinonen To: Bruce Evans Message-ID: <20080911140349.GA2221@a91-153-122-179.elisa-laajakaista.fi> References: <200806020800.m528038T072838@freefall.freebsd.org> <20080722075718.GA1881@a91-153-120-204.elisa-laajakaista.fi> <20080722215249.K17453@delplex.bde.org> <20080723103424.GA1856@a91-153-120-204.elisa-laajakaista.fi> <20080724000618.Q16961@besplex.bde.org> <20080725072314.GA807@a91-153-120-204.elisa-laajakaista.fi> <20080725192315.D27178@delplex.bde.org> <20080903160736.GA12587@a91-153-122-179.elisa-laajakaista.fi> <20080909204354.Q3089@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080909204354.Q3089@besplex.bde.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Antivirus: VAMS Cc: freebsd-fs@freebsd.org Subject: Re: birthtime initialization X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 14:03:54 -0000 On 2008-09-09, Bruce Evans wrote: > > @@ -703,6 +703,17 @@ vn_stat(vp, sb, active_cred, file_cred, > > + vap->va_rdev = VNOVAL; > > Shouldn't this be NODEV? NODEV is ((dev_t)-1) and VNOVAL is plain (-1), > so their values are identical after assignment to va_rdev... Yes, it's probably better to use NODEV here... > > - sb->st_rdev = vap->va_rdev; > > + if (vap->va_rdev == VNOVAL) > > + sb->st_rdev = NODEV; > > + else > > + sb->st_rdev = vap->va_rdev; ...and leave out this change. > ... this change seems to have no effect on machines with 32-bit 2's complement > ints and to be wrong on other machines. Assignment of VNOVAL to va_rdev > changes its value from -1 to 0xFFFFFFFFU, so it can only compare equal > to VNOVAL if int has the same size as dev_t or there is stronger magic. > When the comparision is fixed to compare with the assigned value > (dev_t)VNOVAL == (dev_t)(-1) == NODEV, it is clear that the change has > no effect. Some file systems seem to have vap->va_rdev != VNOVAL comparisons in VOP_SETATTR(). Thanks. -- Jaakko From owner-freebsd-fs@FreeBSD.ORG Fri Sep 12 18:27:24 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B689106566B; Fri, 12 Sep 2008 18:27:24 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id D6FCC8FC29; Fri, 12 Sep 2008 18:27:23 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id D80D81CDCA; Fri, 12 Sep 2008 20:27:22 +0200 (CEST) Date: Fri, 12 Sep 2008 20:27:22 +0200 From: Ed Schouten To: FreeBSD FS , FreeBSD Arch Message-ID: <20080912182722.GK1191@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sU4rRG038CsJurvk" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Mark van Cuijk , Jille Timmermans Subject: Expanding vops in vop_vectors during startup X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 18:27:24 -0000 --sU4rRG038CsJurvk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everyone, Yesterday I was talking with some friends of mine about the FreeBSD VFS layer. As an exercise, Jille was trying to patch nullfs to hide .svn directories (see hackers@), so that's how we got to the subject. After talking about the way our vop_vector works (vop_bypass and vop_default), we were wondering why we don't propagate all pointers in the vop_vector to its children to save the unneeded function pointer resolving inside the VOP_* calls. I've created a patch that adds a new routine to the kernel, vop_vector_init(), which recursively expands the vops. A new macro (DECLARE_VOP_VECTOR) is used to automatically perform this when loading modules/booting. There is no need to reference default_vnodeops anymore, because it is now used implicitly (when vop_vector =3D=3D NULL). Any comments on the attached patch? I've only tested it with ufs, nullfs, devfs, etc. yet. I haven't tested `make universe' yet, but I suspect it shouldn't break hard. URL: http://80386.nl/files/vnode-vop-expand.diff Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --sU4rRG038CsJurvk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjKtIoACgkQ52SDGA2eCwWsoQCeLhN84yU86WavBhgGnSLrxXs5 pTMAnR5LoTV8qUpLi2FxO38Hr5pw0Tak =ALjF -----END PGP SIGNATURE----- --sU4rRG038CsJurvk--