Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/puffs puffs_msg_wait: check PARKFLAG_HASERROR before ...



details:   https://anonhg.NetBSD.org/src/rev/ef90ea48849a
branches:  trunk
changeset: 761935:ef90ea48849a
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Feb 11 09:15:45 2011 +0000

description:
puffs_msg_wait: check PARKFLAG_HASERROR before PARKFLAG_CALL.  PR/44240.

diffstat:

 sys/fs/puffs/puffs_msgif.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (46 lines):

diff -r 10a91efd3022 -r ef90ea48849a sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Fri Feb 11 06:54:18 2011 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Fri Feb 11 09:15:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.c,v 1.84 2010/11/15 20:31:41 pooka Exp $   */
+/*     $NetBSD: puffs_msgif.c,v 1.85 2011/02/11 09:15:45 yamt Exp $    */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.84 2010/11/15 20:31:41 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.85 2011/02/11 09:15:45 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -468,13 +468,6 @@
        mutex_exit(&pmp->pmp_lock);
 
        mutex_enter(&park->park_mtx);
-       if ((park->park_flags & PARKFLAG_WANTREPLY) == 0
-           || (park->park_flags & PARKFLAG_CALL)) {
-               mutex_exit(&park->park_mtx);
-               rv = 0;
-               goto skipwait;
-       }
-
        /* did the response beat us to the wait? */
        if (__predict_false((park->park_flags & PARKFLAG_DONE)
            || (park->park_flags & PARKFLAG_HASERROR))) {
@@ -483,6 +476,13 @@
                goto skipwait;
        }
 
+       if ((park->park_flags & PARKFLAG_WANTREPLY) == 0
+           || (park->park_flags & PARKFLAG_CALL)) {
+               mutex_exit(&park->park_mtx);
+               rv = 0;
+               goto skipwait;
+       }
+
        error = cv_wait_sig(&park->park_cv, &park->park_mtx);
        DPRINTF(("puffs_touser: waiter for %p woke up with %d\n",
            park, error));



Home | Main Index | Thread Index | Old Index