aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJason A. Harmening <jah@FreeBSD.org>2021-05-30 00:46:46 +0000
committerJason A. Harmening <jah@FreeBSD.org>2021-05-30 00:48:02 +0000
commit271fcf1c28efd22342212b1ccaa3dba4fc059627 (patch)
treee1fa6c2039bc9970ddf36f58aeb16002e2443345 /sys/kern
parent331a7601c9c21c1e55c57c5338e7affced9c7b7c (diff)
downloadsrc-271fcf1c28efd22342212b1ccaa3dba4fc059627.tar.gz
src-271fcf1c28efd22342212b1ccaa3dba4fc059627.zip
Revert commits 6d3e78ad6c11 and 54256e7954d7
Parts of libprocstat like to pretend they're kernel components for the sake of including mount.h, and including sys/types.h in the _KERNEL case doesn't fix the build for some reason. Revert both the VFS_QUOTACTL() change and the follow-up "fix" for now.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_default.c4
-rw-r--r--sys/kern/vfs_init.c6
-rw-r--r--sys/kern/vfs_syscalls.c19
3 files changed, 14 insertions, 15 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 63bca7810847..ace9ad1d37c3 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -1350,13 +1350,13 @@ vfs_stdstatfs (mp, sbp)
}
int
-vfs_stdquotactl (mp, cmds, uid, arg, mp_busy)
+vfs_stdquotactl (mp, cmds, uid, arg)
struct mount *mp;
int cmds;
uid_t uid;
void *arg;
- bool *mp_busy;
{
+
return (EOPNOTSUPP);
}
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
index 112b4c76e575..3365ddb11474 100644
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -212,14 +212,12 @@ vfs_cachedroot_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
}
static int
-vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg,
- bool *mp_busy)
+vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg)
{
int prev_stops, rc;
prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
- rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_quotactl)(mp, cmd, uid, arg,
- mp_busy);
+ rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_quotactl)(mp, cmd, uid, arg);
sigallowstop(prev_stops);
return (rc);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 2f4a6036ef88..55780b0474ee 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -89,6 +89,8 @@ __FBSDID("$FreeBSD$");
#include <fs/devfs/devfs.h>
+#include <ufs/ufs/quota.h>
+
MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information");
static int kern_chflagsat(struct thread *td, int fd, const char *path,
@@ -193,7 +195,6 @@ sys_quotactl(struct thread *td, struct quotactl_args *uap)
struct mount *mp;
struct nameidata nd;
int error;
- bool mp_busy;
AUDIT_ARG_CMD(uap->cmd);
AUDIT_ARG_UID(uap->uid);
@@ -212,21 +213,21 @@ sys_quotactl(struct thread *td, struct quotactl_args *uap)
vfs_rel(mp);
return (error);
}
- mp_busy = true;
- error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, &mp_busy);
+ error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg);
/*
- * Since quota on/off operations typically need to open quota
- * files, the implementation may need to unbusy the mount point
+ * Since quota on operation typically needs to open quota
+ * file, the Q_QUOTAON handler needs to unbusy the mount point
* before calling into namei. Otherwise, unmount might be
- * started between two vfs_busy() invocations (first is ours,
+ * started between two vfs_busy() invocations (first is our,
* second is from mount point cross-walk code in lookup()),
* causing deadlock.
*
- * Avoid unbusying mp if the implementation indicates it has
- * already done so.
+ * Require that Q_QUOTAON handles the vfs_busy() reference on
+ * its own, always returning with ubusied mount point.
*/
- if (mp_busy)
+ if ((uap->cmd >> SUBCMDSHIFT) != Q_QUOTAON &&
+ (uap->cmd >> SUBCMDSHIFT) != Q_QUOTAOFF)
vfs_unbusy(mp);
vfs_rel(mp);
return (error);