From owner-svn-src-head@FreeBSD.ORG Sun Jan 22 16:18:37 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E260106573B; Sun, 22 Jan 2012 16:18:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id E96568FC08; Sun, 22 Jan 2012 16:18:34 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id q0MGIX9J004905; Mon, 23 Jan 2012 00:18:33 +0800 (CST) Message-ID: <1327249113.2057.5.camel@nsl> From: Kevin Lo To: Jaakko Heinonen Date: Mon, 23 Jan 2012 00:18:33 +0800 In-Reply-To: <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 16:18:37 -0000 Jaakko Heinonen wrote: > Hi, Hi Jaakko, > On 2012-01-22, Mikolaj Golub wrote: > > JH> # mount -u -o ro /mnt > > JH> mount: tmpfs : Operation not supported > > JH> # mount -u -o ro,export /mnt > > JH> # > > > > There is no error but ro is still ignored, so this is only the issue with > > reporting. Note, the code for nullfs (as an example) looks the same. > > This is not true. "ro" is not ignored: > > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local) > # mount -u -o ro /mnt > mount: tmpfs: Operation not supported > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local) > # mount -u -o ro,export /mnt > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local, read-only) > > > It could be fixed with vfs_filteropt(9), not sure if this is worth doing here > > though. > > The problem with vfs_filteropt(9) is that it will allow some additional > options (global_opts list in vfs_mount.c). However those options might > already work sufficiently with update mount. Here is a mostly untested > patch: > > %%% > Index: sys/fs/tmpfs/tmpfs_vfsops.c > =================================================================== > --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { > NULL > }; > > +static const char *tmpfs_updateopts[] = { > + "from", "export", NULL > +}; > + > /* --------------------------------------------------------------------- */ > > static int > @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) > return (EINVAL); > > if (mp->mnt_flag & MNT_UPDATE) { > - /* > - * Only support update mounts for NFS export. > - */ > - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > - return (0); > - return (EOPNOTSUPP); > + /* Only support update mounts for certain options. */ > + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) > + return (EOPNOTSUPP); > + return (0); > } > > vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); > %%% Sorry for the late reply since I'm still off work for holidays (Chinese New Year). I'll report back in a few weeks. If you have a patch, please commit it, thanks a lot! Kevin