Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Feb 2015 11:54:33 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r278150 - stable/10/sys/ufs/ufs
Message-ID:  <201502031154.t13BsXeX007562@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Feb  3 11:54:33 2015
New Revision: 278150
URL: https://svnweb.freebsd.org/changeset/base/278150

Log:
  MFC r277794:
  The sys_quotactl() contract demands that the mount point is
  vfs_unbusy()ed when the cmd is Q_QUOTAON, regardless of other input
  parameters or error return.

Modified:
  stable/10/sys/ufs/ufs/ufs_quota.c
  stable/10/sys/ufs/ufs/ufs_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ufs/ufs/ufs_quota.c
==============================================================================
--- stable/10/sys/ufs/ufs/ufs_quota.c	Tue Feb  3 11:45:01 2015	(r278149)
+++ stable/10/sys/ufs/ufs/ufs_quota.c	Tue Feb  3 11:54:33 2015	(r278150)
@@ -495,11 +495,15 @@ quotaon(struct thread *td, struct mount 
 	struct nameidata nd;
 
 	error = priv_check(td, PRIV_UFS_QUOTAON);
-	if (error)
+	if (error != 0) {
+		vfs_unbusy(mp);
 		return (error);
+	}
 
-	if (mp->mnt_flag & MNT_RDONLY)
+	if ((mp->mnt_flag & MNT_RDONLY) != 0) {
+		vfs_unbusy(mp);
 		return (EROFS);
+	}
 
 	ump = VFSTOUFS(mp);
 	dq = NODQUOT;

Modified: stable/10/sys/ufs/ufs/ufs_vfsops.c
==============================================================================
--- stable/10/sys/ufs/ufs/ufs_vfsops.c	Tue Feb  3 11:45:01 2015	(r278149)
+++ stable/10/sys/ufs/ufs/ufs_vfsops.c	Tue Feb  3 11:54:33 2015	(r278150)
@@ -92,6 +92,9 @@ ufs_quotactl(mp, cmds, id, arg)
 	void *arg;
 {
 #ifndef QUOTA
+	if ((cmds >> SUBCMDSHIFT) == Q_QUOTAON)
+		vfs_unbusy(mp);
+
 	return (EOPNOTSUPP);
 #else
 	struct thread *td;
@@ -112,11 +115,16 @@ ufs_quotactl(mp, cmds, id, arg)
 			break;
 
 		default:
+			if (cmd == Q_QUOTAON)
+				vfs_unbusy(mp);
 			return (EINVAL);
 		}
 	}
-	if ((u_int)type >= MAXQUOTAS)
+	if ((u_int)type >= MAXQUOTAS) {
+		if (cmd == Q_QUOTAON)
+			vfs_unbusy(mp);
 		return (EINVAL);
+	}
 
 	switch (cmd) {
 	case Q_QUOTAON:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502031154.t13BsXeX007562>