summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-10-28 12:00:28 +0000
committerkib <kib@FreeBSD.org>2008-10-28 12:00:28 +0000
commit19fb7eaf9faed3abf045ff604c41ccb8dfc240af (patch)
tree44bce348c587a5d91119e7dbd1757336b5dab00c /sys/ufs
parenta2129bd144d95f5685e28f05aec7ce6f4efa6b04 (diff)
downloadFreeBSD-src-19fb7eaf9faed3abf045ff604c41ccb8dfc240af.zip
FreeBSD-src-19fb7eaf9faed3abf045ff604c41ccb8dfc240af.tar.gz
Provide an explanation for getinoquota() call in the ufs_access vop.
MFC after: 3 days
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 40304bc..eb851cf 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -330,7 +330,18 @@ ufs_access(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
#ifdef QUOTA
+ /*
+ * Inode is accounted in the quotas only if struct
+ * dquot is attached to it. VOP_ACCESS() is called
+ * from vn_open_cred() and provides a convenient
+ * point to call getinoquota().
+ */
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
+
+ /*
+ * Upgrade vnode lock, since getinoquota()
+ * requires exclusive lock to modify inode.
+ */
relocked = 1;
vhold(vp);
vn_lock(vp, LK_UPGRADE | LK_RETRY);
OpenPOWER on IntegriCloud