quota_flag

Keep flag "UFS_QUOTA" set until the last quota is closed.

Prevents a live lock when dqrele() finds a struct with "dq_cnt == 1"
and flag "DQ_MOD" and cannot sync as flag UFS_QUOTA is unset.

diff -r 55844e2c889a -r e40ff4ab1896 sys/ufs/ufs/ufs_quota1.c
--- sys/ufs/ufs/ufs_quota1.c
+++ sys/ufs/ufs/ufs_quota1.c
@@ -433,7 +433,6 @@ quota1_handle_cmd_quotaoff(struct lwp *l
 		return (0);
 	}
 	ump->umq1_qflags[type] |= QTF_CLOSING;
-	ump->um_flags &= ~UFS_QUOTA;
 	mutex_exit(&dqlock);
 	/*
 	 * Search vnodes associated with this mount point,
@@ -470,6 +469,8 @@ quota1_handle_cmd_quotaoff(struct lwp *l
 		if (ump->um_quotas[i] != NULLVP)
 			break;
 	ump->umq1_qflags[type] &= ~QTF_CLOSING;
+	if (i == MAXQUOTAS)
+		ump->um_flags &= ~UFS_QUOTA;
 	cv_broadcast(&dqcv);
 	mutex_exit(&dqlock);
 	kauth_cred_free(cred);
