diff options
| author | Jason A. Harmening <jah@FreeBSD.org> | 2021-05-30 00:46:46 +0000 |
|---|---|---|
| committer | Jason A. Harmening <jah@FreeBSD.org> | 2021-05-30 00:48:02 +0000 |
| commit | 271fcf1c28efd22342212b1ccaa3dba4fc059627 (patch) | |
| tree | e1fa6c2039bc9970ddf36f58aeb16002e2443345 /sys/fs | |
| parent | 331a7601c9c21c1e55c57c5338e7affced9c7b7c (diff) | |
Diffstat (limited to 'sys/fs')
| -rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 30 | ||||
| -rw-r--r-- | sys/fs/smbfs/smbfs_vfsops.c | 3 | ||||
| -rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 28 |
3 files changed, 6 insertions, 55 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 0ad2385116a9..0bb98072edf4 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -294,39 +294,13 @@ nullfs_root(mp, flags, vpp) } static int -nullfs_quotactl(mp, cmd, uid, arg, mp_busy) +nullfs_quotactl(mp, cmd, uid, arg) struct mount *mp; int cmd; uid_t uid; void *arg; - bool *mp_busy; { - struct mount *lowermp; - struct null_mount *mntdata; - int error; - bool unbusy; - - mntdata = MOUNTTONULLMOUNT(mp); - lowermp = atomic_load_ptr(&mntdata->nullm_vfs); - KASSERT(*mp_busy == true, ("upper mount not busy")); - /* - * See comment in sys_quotactl() for an explanation of why the - * lower mount needs to be busied by the caller of VFS_QUOTACTL() - * but may be unbusied by the implementation. We must unbusy - * the upper mount for the same reason; otherwise a namei lookup - * issued by the VFS_QUOTACTL() implementation could traverse the - * upper mount and deadlock. - */ - vfs_unbusy(mp); - *mp_busy = false; - unbusy = true; - error = vfs_busy(lowermp, 0); - if (error == 0) - error = VFS_QUOTACTL(lowermp, cmd, uid, arg, &unbusy); - if (unbusy) - vfs_unbusy(lowermp); - - return (error); + return VFS_QUOTACTL(MOUNTTONULLMOUNT(mp)->nullm_vfs, cmd, uid, arg); } static int diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index a1ae565c6341..d19816a7869c 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -352,12 +352,11 @@ out: */ /* ARGSUSED */ static int -smbfs_quotactl(mp, cmd, uid, arg, mp_busy) +smbfs_quotactl(mp, cmd, uid, arg) struct mount *mp; int cmd; uid_t uid; void *arg; - bool *mp_busy; { SMBVDEBUG("return EOPNOTSUPP\n"); return EOPNOTSUPP; diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index bd264c7bcdb5..ae95bd9c005c 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -371,38 +371,16 @@ unionfs_root(struct mount *mp, int flags, struct vnode **vpp) } static int -unionfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, - bool *mp_busy) +unionfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg) { - struct mount *uppermp; struct unionfs_mount *ump; - int error; - bool unbusy; ump = MOUNTTOUNIONFSMOUNT(mp); - uppermp = atomic_load_ptr(&ump->um_uppervp->v_mount); - KASSERT(*mp_busy == true, ("upper mount not busy")); - /* - * See comment in sys_quotactl() for an explanation of why the - * lower mount needs to be busied by the caller of VFS_QUOTACTL() - * but may be unbusied by the implementation. We must unbusy - * the upper mount for the same reason; otherwise a namei lookup - * issued by the VFS_QUOTACTL() implementation could traverse the - * upper mount and deadlock. - */ - vfs_unbusy(mp); - *mp_busy = false; - unbusy = true; - error = vfs_busy(uppermp, 0); + /* * Writing is always performed to upper vnode. */ - if (error == 0) - error = VFS_QUOTACTL(uppermp, cmd, uid, arg, &unbusy); - if (unbusy) - vfs_unbusy(uppermp); - - return (error); + return (VFS_QUOTACTL(ump->um_uppervp->v_mount, cmd, uid, arg)); } static int |
