svn commit: r345799 - head/sys/fs/tmpfs

Konstantin Belousov kib at FreeBSD.org
Tue Sep 3 14:06:09 UTC 2019


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);




More information about the svn-src-head mailing list