Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ufs Keep flag "UFS_QUOTA" set until the last quota i...



details:   https://anonhg.NetBSD.org/src/rev/6dbe14bd8f4b
branches:  trunk
changeset: 365817:6dbe14bd8f4b
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Apr 26 15:37:25 2022 +0000

description:
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.

diffstat:

 sys/ufs/ufs/ufs_quota1.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r ec50506814a7 -r 6dbe14bd8f4b sys/ufs/ufs/ufs_quota1.c
--- a/sys/ufs/ufs/ufs_quota1.c  Tue Apr 26 15:36:42 2022 +0000
+++ b/sys/ufs/ufs/ufs_quota1.c  Tue Apr 26 15:37:25 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_quota1.c,v 1.24 2021/06/29 22:40:54 dholland Exp $ */
+/*     $NetBSD: ufs_quota1.c,v 1.25 2022/04/26 15:37:25 hannken Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.24 2021/06/29 22:40:54 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.25 2022/04/26 15:37:25 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -433,7 +433,6 @@
                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 @@
                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);



Home | Main Index | Thread Index | Old Index