svn commit: r277794 - head/sys/ufs/ufs
Konstantin Belousov
kib at FreeBSD.org
Tue Jan 27 10:32:51 UTC 2015
Author: kib
Date: Tue Jan 27 10:32:49 2015
New Revision: 277794
URL: https://svnweb.freebsd.org/changeset/base/277794
Log:
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.
Submitted by: Conrad Meyer
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D1684
Tested by: pho
MFC after: 1 week
Modified:
head/sys/ufs/ufs/ufs_quota.c
head/sys/ufs/ufs/ufs_vfsops.c
Modified: head/sys/ufs/ufs/ufs_quota.c
==============================================================================
--- head/sys/ufs/ufs/ufs_quota.c Tue Jan 27 09:48:02 2015 (r277793)
+++ head/sys/ufs/ufs/ufs_quota.c Tue Jan 27 10:32:49 2015 (r277794)
@@ -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: head/sys/ufs/ufs/ufs_vfsops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vfsops.c Tue Jan 27 09:48:02 2015 (r277793)
+++ head/sys/ufs/ufs/ufs_vfsops.c Tue Jan 27 10:32:49 2015 (r277794)
@@ -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:
More information about the svn-src-all
mailing list