-/* $OpenBSD: msdosfs_vfsops.c,v 1.83 2016/10/10 00:34:50 bluhm Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.84 2017/05/29 14:07:16 sf Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
#include <sys/malloc.h>
#include <sys/dirent.h>
#include <sys/disk.h>
+#include <sys/dkio.h>
#include <sys/stdint.h>
#include <msdosfs/bpb.h>
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
error = vflush(mp, NULLVP, flags);
- if (!error)
+ if (!error) {
+ int force = 0;
+
pmp->pm_flags |= MSDOSFSMNT_RONLY;
+ /* may be not supported, ignore error */
+ VOP_IOCTL(pmp->pm_devvp, DIOCCACHESYNC,
+ &force, FWRITE, FSCRED, p);
+ }
}
if (!error && (mp->mnt_flag & MNT_RELOAD))
/* not yet implemented */
-/* $OpenBSD: ffs_vfsops.c,v 1.165 2017/04/20 14:13:00 visa Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.166 2017/05/29 14:07:16 sf Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
fs->fs_flags &= ~FS_DOSOFTDEP;
}
ffs_sbupdate(ump, MNT_WAIT);
+ if (ronly) {
+ int force = 0;
+
+ /*
+ * Updating mount to readonly. Try a cache flush.
+ * Ignore error because the ioctl may not be supported.
+ */
+ VOP_IOCTL(ump->um_devvp, DIOCCACHESYNC, &force,
+ FWRITE, FSCRED, p);
+ }
}
return (0);