diff options
| author | 2018-07-17 13:12:08 +0000 | |
|---|---|---|
| committer | 2018-07-17 13:12:08 +0000 | |
| commit | 3270c159a13f7acb136b07140654c9bdde79771c (patch) | |
| tree | 534dddf967ed52a9868a72262b2556909d9c9393 /sys | |
| parent | libfuse now supports -f command line option; uncomment test. (diff) | |
| download | wireguard-openbsd-3270c159a13f7acb136b07140654c9bdde79771c.tar.xz wireguard-openbsd-3270c159a13f7acb136b07140654c9bdde79771c.zip | |
Don't send FBT_DESTROY if the FUSE connection is still PENDING. Also
don't attempt to determine the size of the root inode. This is because
we don't need to know the size of directories and FBT_GETATTR will also
cause a deadlock if fuse_unmount(3) is called before the file system
has a chance to process fbufs.
Add corresponding regression test.
ok mpi@
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/miscfs/fuse/fuse_vfsops.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index a7f957f01dc..cf459696944 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.41 2018/07/16 16:44:09 helg Exp $ */ +/* $OpenBSD: fuse_vfsops.c,v 1.42 2018/07/17 13:12:08 helg Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -157,8 +157,7 @@ fusefs_unmount(struct mount *mp, int mntflags, struct proc *p) if ((error = vflush(mp, NULLVP, flags))) return (error); - if (fmp->sess_init) { - fmp->sess_init = 0; + if (fmp->sess_init && fmp->sess_init != PENDING) { fbuf = fb_setup(0, 0, FBT_DESTROY, p); error = fb_queue(fmp->dev, fbuf); @@ -168,6 +167,7 @@ fusefs_unmount(struct mount *mp, int mntflags, struct proc *p) fb_delete(fbuf); } + fmp->sess_init = 0; fuse_device_cleanup(fmp->dev); fuse_device_set_fmp(fmp, 0); @@ -314,17 +314,18 @@ retry: if (ino == FUSE_ROOTINO) nvp->v_flag |= VROOT; - - /* - * Initialise the file size so that file size changes can be - * detected during file operations. - */ - error = VOP_GETATTR(nvp, &vattr, curproc->p_ucred, curproc); - if (error) { - vrele(nvp); - return (error); + else { + /* + * Initialise the file size so that file size changes can be + * detected during file operations. + */ + error = VOP_GETATTR(nvp, &vattr, curproc->p_ucred, curproc); + if (error) { + vrele(nvp); + return (error); + } + ip->filesize = vattr.va_size; } - ip->filesize = vattr.va_size; *vpp = nvp; |
