summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2023-07-05 15:13:29 +0000
committerBob Beck <beck@cvs.openbsd.org>2023-07-05 15:13:29 +0000
commit558d8e8fbf2be958e31a189dec47abe2eb0fbc5b (patch)
treea19dbfe4ae07a6494e5e4d536f661d0a92645265
parent0f4abbd043963de02ccbc56816aac8ab1dbc08cf (diff)
Make softdep mounts a no-op
Softdep is a significant impediment to progressing in the vfs layer so we plan to get it out of the way. It is too clever for us to continue maintaining as it is. ok kettenis@ kn@ tobhe@ and most of the g2k23 room except bluhm@
-rw-r--r--sys/kern/vfs_syscalls.c9
-rw-r--r--sys/sys/mount.h4
-rw-r--r--sys/ufs/ffs/ffs_softdep.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c18
4 files changed, 13 insertions, 22 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index f47f9dfcb69..43462b1496e 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.361 2023/02/11 23:22:17 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.362 2023/07/05 15:13:28 beck Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -239,11 +239,10 @@ update:
else if (mp->mnt_flag & MNT_RDONLY)
mp->mnt_flag |= MNT_WANTRDWR;
mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_WXALLOWED | MNT_NODEV |
- MNT_SYNCHRONOUS | MNT_ASYNC | MNT_SOFTDEP | MNT_NOATIME |
- MNT_NOPERM | MNT_FORCE);
+ MNT_SYNCHRONOUS | MNT_ASYNC | MNT_NOATIME | MNT_NOPERM | MNT_FORCE);
mp->mnt_flag |= flags & (MNT_NOSUID | MNT_NOEXEC | MNT_WXALLOWED |
- MNT_NODEV | MNT_SYNCHRONOUS | MNT_ASYNC | MNT_SOFTDEP |
- MNT_NOATIME | MNT_NOPERM | MNT_FORCE);
+ MNT_NODEV | MNT_SYNCHRONOUS | MNT_ASYNC | MNT_NOATIME | MNT_NOPERM |
+ MNT_FORCE);
/*
* Mount the filesystem.
*/
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index ec77c1b7094..27bec4f266d 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.h,v 1.149 2023/07/04 11:14:00 jsg Exp $ */
+/* $OpenBSD: mount.h,v 1.150 2023/07/05 15:13:28 beck Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
@@ -401,7 +401,7 @@ struct mount {
#define MNT_STALLED 0x00100000 /* filesystem stalled */
#define MNT_SWAPPABLE 0x00200000 /* filesystem can be used for swap */
#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
-#define MNT_SOFTDEP 0x04000000 /* soft dependencies being done */
+#define MNT_SOFTDEP 0x04000000 /* soft dependencies being done - now ignored */
#define MNT_DOOMED 0x08000000 /* device behind filesystem is gone */
#ifdef _KERNEL
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 15017537b41..e4d56ebc42b 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.151 2023/04/11 00:45:09 jsg Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.152 2023/07/05 15:13:28 beck Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -1224,6 +1224,8 @@ softdep_mount(struct vnode *devvp, struct mount *mp, struct fs *fs,
struct buf *bp;
int error, cyl;
+ KASSERTMSG(1, "softdep_mount should not have been called");
+
/*
* When doing soft updates, the counters in the
* superblock may have gotten out of sync, so we have
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index ffe78ef140f..8c780d5340b 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.194 2023/04/14 22:41:28 mbuhl Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.195 2023/07/05 15:13:28 beck Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -213,12 +213,10 @@ ffs_mount(struct mount *mp, const char *path, void *data,
int error = 0, flags;
int ronly;
-#ifndef FFS_SOFTUPDATES
+ /* Ask not for whom the bell tolls */
if (mp->mnt_flag & MNT_SOFTDEP) {
- printf("WARNING: soft updates isn't compiled in\n");
mp->mnt_flag &= ~MNT_SOFTDEP;
}
-#endif
/*
* Soft updates is incompatible with "async",
@@ -284,8 +282,6 @@ ffs_mount(struct mount *mp, const char *path, void *data,
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
error = softdep_flushfiles(mp, flags, p);
-#elif FFS_SOFTUPDATES
- mp->mnt_flag |= MNT_SOFTDEP;
#endif
}
/*
@@ -459,10 +455,7 @@ success:
free(fs->fs_contigdirs, M_UFSMNT, fs->fs_ncg);
}
if (!ronly) {
- if (mp->mnt_flag & MNT_SOFTDEP)
- fs->fs_flags |= FS_DOSOFTDEP;
- else
- fs->fs_flags &= ~FS_DOSOFTDEP;
+ fs->fs_flags &= ~FS_DOSOFTDEP;
}
ffs_sbupdate(ump, MNT_WAIT);
#if 0
@@ -923,10 +916,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
}
fs->fs_fmod = 1;
fs->fs_clean = 0;
- if (mp->mnt_flag & MNT_SOFTDEP)
- fs->fs_flags |= FS_DOSOFTDEP;
- else
- fs->fs_flags &= ~FS_DOSOFTDEP;
+ fs->fs_flags &= ~FS_DOSOFTDEP;
error = ffs_sbupdate(ump, MNT_WAIT);
if (error == EROFS)
goto out;