Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/sysvbfs Don't change a read-only file system.
details: https://anonhg.NetBSD.org/src/rev/94903b0b99ae
branches: trunk
changeset: 786849:94903b0b99ae
user: pooka <pooka%NetBSD.org@localhost>
date: Wed May 15 16:44:03 2013 +0000
description:
Don't change a read-only file system.
diffstat:
sys/fs/sysvbfs/sysvbfs_vnops.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 6b941d6a1ef8 -r 94903b0b99ae sys/fs/sysvbfs/sysvbfs_vnops.c
--- a/sys/fs/sysvbfs/sysvbfs_vnops.c Wed May 15 16:00:04 2013 +0000
+++ b/sys/fs/sysvbfs/sysvbfs_vnops.c Wed May 15 16:44:03 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysvbfs_vnops.c,v 1.47 2013/03/18 19:35:40 plunky Exp $ */
+/* $NetBSD: sysvbfs_vnops.c,v 1.48 2013/05/15 16:44:03 pooka Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.47 2013/03/18 19:35:40 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.48 2013/05/15 16:44:03 pooka Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -218,6 +218,10 @@
struct bfs_fileattr attr;
DPRINTF("%s:\n", __func__);
+
+ if (v->v_mount->mnt_flag & MNT_RDONLY)
+ goto out;
+
uvm_vnp_setsize(v, bnode->size);
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
@@ -231,6 +235,7 @@
VOP_FSYNC(a->a_vp, a->a_cred, FSYNC_WAIT, 0, 0);
+ out:
return 0;
}
@@ -877,6 +882,9 @@
struct sysvbfs_node *bnode = vp->v_data;
struct bfs_fileattr attr;
+ if (vp->v_mount->mnt_flag & MNT_RDONLY)
+ return 0;
+
DPRINTF("%s:\n", __func__);
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
if (bnode->update_atime) {
Home |
Main Index |
Thread Index |
Old Index