Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2019 13:41:26 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345799 - head/sys/fs/tmpfs
Message-ID:  <201904021341.x32DfQgp080808@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Apr  2 13:41:26 2019
New Revision: 345799
URL: https://svnweb.freebsd.org/changeset/base/345799

Log:
  Block creation of the new nodes for read-only tmpfs mounts.
  
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks
  Differential revision:	https://reviews.freebsd.org/D19737

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c	Tue Apr  2 13:38:00 2019	(r345798)
+++ head/sys/fs/tmpfs/tmpfs_subr.c	Tue Apr  2 13:41:26 2019	(r345799)
@@ -218,6 +218,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount 
 		 */
 		return (EBUSY);
 	}
+	if ((mp->mnt_kern_flag & MNT_RDONLY) != 0)
+		return (EROFS);
 
 	nnode = (struct tmpfs_node *)uma_zalloc_arg(tmp->tm_node_pool, tmp,
 	    M_WAITOK);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904021341.x32DfQgp080808>