Source-Changes-HG archive

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

[src/trunk]: src/sys/kern fix assertions about when it is ok for pool_get() t...



details:   https://anonhg.NetBSD.org/src/rev/e1cd9d5c86c0
branches:  trunk
changeset: 848185:e1cd9d5c86c0
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jan 19 23:49:32 2020 +0000

description:
fix assertions about when it is ok for pool_get() to return NULL.

diffstat:

 sys/kern/subr_pool.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 198d169803ed -r e1cd9d5c86c0 sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Sun Jan 19 20:51:13 2020 +0000
+++ b/sys/kern/subr_pool.c      Sun Jan 19 23:49:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.264 2019/12/27 15:49:20 maxv Exp $     */
+/*     $NetBSD: subr_pool.c,v 1.265 2020/01/19 23:49:32 chs Exp $      */
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.264 2019/12/27 15:49:20 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.265 2020/01/19 23:49:32 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1145,7 +1145,7 @@
 
                        pp->pr_nfail++;
                        mutex_exit(&pp->pr_lock);
-                       KASSERT((flags & (PR_WAITOK|PR_NOWAIT)) == PR_NOWAIT);
+                       KASSERT((flags & (PR_NOWAIT|PR_LIMITFAIL)) != 0);
                        return NULL;
                }
 
@@ -2509,7 +2509,7 @@
        object = pool_get(&pc->pc_pool, flags);
        *objectp = object;
        if (__predict_false(object == NULL)) {
-               KASSERT((flags & (PR_WAITOK|PR_NOWAIT)) == PR_NOWAIT);
+               KASSERT((flags & (PR_NOWAIT|PR_LIMITFAIL)) != 0);
                return false;
        }
 



Home | Main Index | Thread Index | Old Index