diff options
author | 2017-12-14 17:25:39 +0000 | |
---|---|---|
committer | 2017-12-14 17:25:39 +0000 | |
commit | 44961df1dceab8b67f900b362f44ce7d89e9fa6a (patch) | |
tree | 1547df23c18186a33d0c2e7ed778f959a4cbc526 | |
parent | Add Symbols.map to explicitly define the ABIs, hiding linker defined symbols. (diff) | |
download | wireguard-openbsd-44961df1dceab8b67f900b362f44ce7d89e9fa6a.tar.xz wireguard-openbsd-44961df1dceab8b67f900b362f44ce7d89e9fa6a.zip |
If switching RW->RO, then stop deferring timestamp writes...and possibly
other pending inode attribute changes. We appear to be missing UFS_UPDATE()
calls in some paths with the result that bsd.rd remounting the newly
created /mnt to RO would lose the GID changes on device inodes there.
This only affected devices, as they're the only inodes where timestamp
writes are delayed.
ok deraadt@
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 15c0722cd62..a04cda2e70f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.168 2017/12/11 17:13:34 deraadt Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.169 2017/12/14 17:25:39 guenther Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1151,11 +1151,23 @@ ffs_sync_vnode(struct vnode *vp, void *arg) { struct inode *ip; int error; + if (vp->v_type == VNON) + return (0); + ip = VTOI(vp); - if (vp->v_type == VNON || - ((ip->i_flag & + + /* + * If unmounting or converting rw to ro, then stop deferring + * timestamp writes. + */ + if (fsa->waitfor == MNT_WAIT && (ip->i_flag & IN_LAZYMOD)) { + ip->i_flag |= IN_MODIFIED; + UFS_UPDATE(ip, 1); + } + + if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && - LIST_EMPTY(&vp->v_dirtyblkhd)) ) { + LIST_EMPTY(&vp->v_dirtyblkhd)) { return (0); } |