From e599d951e3e256b7de7c0e85e65c87e21b873d1e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 8 Sep 2016 12:06:43 +0000 Subject: [PATCH] In dqsync(), when called from quotactl(), um_quotas entry might appear cleared since nothing prevents completion of the parallel quotaoff. There is nothing to sync in this case, and no reason to panic. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- sys/ufs/ufs/ufs_quota.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index c236706f3346..ccc496203ace 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1538,8 +1538,13 @@ dqsync(struct vnode *vp, struct dquot *dq) if ((ump = dq->dq_ump) == NULL) return (0); UFS_LOCK(ump); - if ((dqvp = ump->um_quotas[dq->dq_type]) == NULLVP) - panic("dqsync: file"); + if ((dqvp = ump->um_quotas[dq->dq_type]) == NULLVP) { + if (vp == NULL) { + UFS_UNLOCK(ump); + return (0); + } else + panic("dqsync: file"); + } vref(dqvp); UFS_UNLOCK(ump);