diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-12-11 05:27:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-12-11 05:27:41 +0000 |
commit | d1538d110d9557ee9f9e4b04b6cba258e4f43d3a (patch) | |
tree | fd0c509c4d351be908d5ccc6ae3ffd4b0a61c6a5 /sys/miscfs/fuse | |
parent | 2921b422210353885272232bc38314523b006e06 (diff) |
In uvm Chuck decided backing store would not be allocated proactively
for blocks re-fetchable from the filesystem. However at reboot time,
filesystems are unmounted, and since processes lack backing store they
are killed. Since the scheduler is still running, in some cases init is
killed... which drops us to ddb [noted by bluhm]. Solution is to convert
filesystems to read-only [proposed by kettenis]. The tale follows:
sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which
completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT()
with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a
copyin() late... so store the sizes in vfsconflist[] and move the copyin()
to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill
legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is
sharp and rusty especially wrt softdep, so fix some bugs adn add
~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help,
so tie them to &dead_vnops.
ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but
this issue is seperate and will be dealt with in time.
couple hundred reboots by bluhm and myself, advice from guenther and
others at the hut
Diffstat (limited to 'sys/miscfs/fuse')
-rw-r--r-- | sys/miscfs/fuse/fuse_vfsops.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index 16bac9615b5..e4affbf5888 100644 --- a/sys/miscfs/fuse/fuse_vfsops.c +++ b/sys/miscfs/fuse/fuse_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vfsops.c,v 1.29 2017/04/20 14:13:00 visa Exp $ */ +/* $OpenBSD: fuse_vfsops.c,v 1.30 2017/12/11 05:27:40 deraadt Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -74,19 +74,14 @@ fusefs_mount(struct mount *mp, const char *path, void *data, { struct fusefs_mnt *fmp; struct fusebuf *fbuf; - struct fusefs_args args; + struct fusefs_args *args = data; struct vnode *vp; struct file *fp; - int error; if (mp->mnt_flag & MNT_UPDATE) return (EOPNOTSUPP); - error = copyin(data, &args, sizeof(struct fusefs_args)); - if (error) - return (error); - - if ((fp = fd_getfile(p->p_fd, args.fd)) == NULL) + if ((fp = fd_getfile(p->p_fd, args->fd)) == NULL) return (EBADF); if (fp->f_type != DTYPE_VNODE) @@ -100,8 +95,8 @@ fusefs_mount(struct mount *mp, const char *path, void *data, fmp->mp = mp; fmp->sess_init = 0; fmp->dev = vp->v_rdev; - if (args.max_read > 0) - fmp->max_read = MIN(args.max_read, FUSEBUFMAXSIZE); + if (args->max_read > 0) + fmp->max_read = MIN(args->max_read, FUSEBUFMAXSIZE); else fmp->max_read = FUSEBUFMAXSIZE; |