From owner-freebsd-stable@FreeBSD.ORG Tue Oct 30 12:00:31 2012 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA1FE6DD; Tue, 30 Oct 2012 12:00:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kostikbel-1-pt.tunnel.tserv11.ams1.ipv6.he.net [IPv6:2001:470:1f14:13d6::2]) by mx1.freebsd.org (Postfix) with ESMTP id 646D98FC18; Tue, 30 Oct 2012 12:00:29 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id q9UC0JE7068677; Tue, 30 Oct 2012 14:00:19 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id q9UC0J2a068675; Tue, 30 Oct 2012 14:00:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 Oct 2012 14:00:19 +0200 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: tmpfs nfs exports? Message-ID: <20121030120019.GU73505@kib.kiev.ua> References: <508FA008.2040503@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wiiWofWi8Et/oezL" Content-Disposition: inline In-Reply-To: <508FA008.2040503@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: jh@freebsd.org, stable@freebsd.org, re@freebsd.org, kevlo@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 12:00:31 -0000 --wiiWofWi8Et/oezL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 30, 2012 at 02:38:16AM -0700, Alfred Perlstein wrote: > Hey folks, any reason why not to include the following patch in 9.1? It= =20 > would be nice to have tmpfs be exportable. >=20 > I'm good to commit it, I can also wait until post 9.1. It is too late for 9.1. Patch is fine for stable/9, but you merged at the wrong point. Merge at sys/, not at the root of the sources. >=20 > $ svn diff > Index: . > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- . (revision 242331) > +++ . (working copy) >=20 > Property changes on: . > ___________________________________________________________________ > Modified: svn:mergeinfo > Merged /head:r234346 > Index: sys > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys (revision 242331) > +++ sys (working copy) >=20 > Property changes on: sys > ___________________________________________________________________ > Modified: svn:mergeinfo > Merged /head/sys:r234346 > Index: sys/fs > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/fs (revision 242331) > +++ sys/fs (working copy) >=20 > Property changes on: sys/fs > ___________________________________________________________________ > Modified: svn:mergeinfo > Merged /head/sys/fs:r234346 > Index: sys/fs/tmpfs/tmpfs.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/fs/tmpfs/tmpfs.h (revision 242331) > +++ sys/fs/tmpfs/tmpfs.h (working copy) > @@ -387,6 +387,9 @@ > * tmpfs_pool.c. */ > uma_zone_t tm_dirent_pool; > uma_zone_t tm_node_pool; > + > + /* Read-only status. */ > + int tm_ronly; > }; > #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) > #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) > Index: sys/fs/tmpfs/tmpfs_vfsops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 242331) > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > @@ -82,6 +82,10 @@ > NULL > }; >=20 > +static const char *tmpfs_updateopts[] =3D { > + "from", "export", NULL > +}; > + > /*=20 > --------------------------------------------------------------------- */ >=20 > static int > @@ -193,10 +197,13 @@ > return (EINVAL); >=20 > if (mp->mnt_flag & MNT_UPDATE) { > - /* XXX: There is no support yet to update file system > - * settings. Should be added. */ > - > - return EOPNOTSUPP; > + /* Only support update mounts for certain options. */ > + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) !=3D 0) > + return (EOPNOTSUPP); > + if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) !=3D > + ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly) > + return (EOPNOTSUPP); > + return (0); > } >=20 > vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); > @@ -269,6 +276,7 @@ > tmpfs_node_ctor, tmpfs_node_dtor, > tmpfs_node_init, tmpfs_node_fini, > UMA_ALIGN_PTR, 0); > + tmp->tm_ronly =3D (mp->mnt_flag & MNT_RDONLY) !=3D 0; >=20 > /* Allocate the root node. */ > error =3D tmpfs_alloc_node(tmp, VDIR, root_uid, --wiiWofWi8Et/oezL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCPwVIACgkQC3+MBN1Mb4j4EACgvIQuCVV1Z/RdC80Wjxp7D9oy Dd4AoLyLcnlA2P5sBtg3wYhNn8BuiAsy =Ao3T -----END PGP SIGNATURE----- --wiiWofWi8Et/oezL--