Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/fs/tmpfs/tmpfs_vfsops.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/fs/tmpfs/tmpfs_vfsops.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.67.2.1 retrieving revision 1.68 diff -u -p -r1.67.2.1 -r1.68 --- src/sys/fs/tmpfs/tmpfs_vfsops.c 2017/03/20 06:57:47 1.67.2.1 +++ src/sys/fs/tmpfs/tmpfs_vfsops.c 2016/08/26 21:44:24 1.68 @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_vfsops.c,v 1.67.2.1 2017/03/20 06:57:47 pgoyette Exp $ */ +/* $NetBSD: tmpfs_vfsops.c,v 1.68 2016/08/26 21:44:24 dholland Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.67.2.1 2017/03/20 06:57:47 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.68 2016/08/26 21:44:24 dholland Exp $"); #include #include @@ -92,7 +92,7 @@ tmpfs_mount(struct mount *mp, const char struct vnode *vp; uint64_t memlimit; ino_t nodes; - int error, flags; + int error; bool set_memlimit; bool set_nodes; @@ -160,15 +160,6 @@ tmpfs_mount(struct mount *mp, const char tmp = VFS_TO_TMPFS(mp); if (set_nodes && nodes < tmp->tm_nodes_cnt) return EBUSY; - if ((mp->mnt_iflag & IMNT_WANTRDONLY)) { - /* Changing from read/write to read-only. */ - flags = WRITECLOSE; - if ((mp->mnt_flag & MNT_FORCE)) - flags |= FORCECLOSE; - error = vflush(mp, NULL, flags); - if (error) - return error; - } if (set_memlimit) { if ((error = tmpfs_mntmem_set(tmp, memlimit)) != 0) return error; @@ -202,8 +193,16 @@ tmpfs_mount(struct mount *mp, const char va.va_uid = args->ta_root_uid; va.va_gid = args->ta_root_gid; error = vcache_new(mp, NULL, &va, NOCRED, &vp); + if (error) { + mp->mnt_data = NULL; + tmpfs_mntmem_destroy(tmp); + mutex_destroy(&tmp->tm_lock); + kmem_free(tmp, sizeof(*tmp)); + return error; + } + KASSERT(vp != NULL); root = VP_TO_TMPFS_NODE(vp); - KASSERT(error == 0 && root != NULL); + KASSERT(root != NULL); /* * Parent of the root inode is itself. Also, root inode has no @@ -468,7 +467,7 @@ struct vfsops tmpfs_vfsops = { .vfs_done = tmpfs_done, .vfs_snapshot = tmpfs_snapshot, .vfs_extattrctl = vfs_stdextattrctl, - .vfs_suspendctl = genfs_suspendctl, + .vfs_suspendctl = (void *)eopnotsupp, .vfs_renamelock_enter = genfs_renamelock_enter, .vfs_renamelock_exit = genfs_renamelock_exit, .vfs_fsync = (void *)eopnotsupp,