allow file system to decide if it can be downgraded from r/w to r/o
This commit is contained in:
parent
f5c7baed05
commit
4a92140584
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vfs_syscalls.c,v 1.413 2011/01/02 05:12:33 dholland Exp $ */
|
||||
/* $NetBSD: vfs_syscalls.c,v 1.414 2011/01/13 07:25:50 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
|
@ -66,7 +66,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.413 2011/01/02 05:12:33 dholland Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.414 2011/01/13 07:25:50 pooka Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_fileassoc.h"
|
||||
|
@ -169,7 +169,8 @@ mount_update(struct lwp *l, struct vnode *vp, const char *path, int flags,
|
|||
* prevent read-write to read-only downgrades.
|
||||
*/
|
||||
if ((flags & (MNT_RELOAD | MNT_RDONLY)) != 0 &&
|
||||
(mp->mnt_flag & MNT_RDONLY) == 0) {
|
||||
(mp->mnt_flag & MNT_RDONLY) == 0 &&
|
||||
(mp->mnt_iflag & IMNT_CAN_RWTORO) == 0) {
|
||||
error = EOPNOTSUPP; /* Needs translation */
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fstypes.h,v 1.27 2011/01/13 07:23:39 pooka Exp $ */
|
||||
/* $NetBSD: fstypes.h,v 1.28 2011/01/13 07:25:50 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1991, 1993
|
||||
|
@ -210,6 +210,7 @@ typedef struct fhandle fhandle_t;
|
|||
#define IMNT_DTYPE 0x00000040 /* returns d_type fields */
|
||||
#define IMNT_HAS_TRANS 0x00000080 /* supports transactions */
|
||||
#define IMNT_MPSAFE 0x00000100 /* file system code MP safe */
|
||||
#define IMNT_CAN_RWTORO 0x00000200 /* can downgrade fs to from rw to r/o */
|
||||
|
||||
#define __MNT_FLAGS \
|
||||
__MNT_BASIC_FLAGS \
|
||||
|
@ -254,6 +255,7 @@ typedef struct fhandle fhandle_t;
|
|||
|
||||
#define __IMNT_FLAG_BITS \
|
||||
"\20" \
|
||||
"\12IMNT_CAN_RWTORO" \
|
||||
"\11IMNT_MPSAFE" \
|
||||
"\10IMNT_HAS_TRANS" \
|
||||
"\07IMNT_DTYPE" \
|
||||
|
|
Loading…
Reference in New Issue