From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 13:42:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6E5106566C; Sun, 22 Jan 2012 13:42:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id B4CA18FC13; Sun, 22 Jan 2012 13:42:27 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id A5D02216A4C; Sun, 22 Jan 2012 15:42:20 +0200 (EET) Date: Sun, 22 Jan 2012 15:42:18 +0200 From: Jaakko Heinonen To: Mikolaj Golub Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86obtvvr4v.fsf@kopusha.home.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 13:42:28 -0000 Hi, 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); %%% -- Jaakko