Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 1999 13:20:01 -0800 (PST)
From:      Darrell Anderson <anderson@cs.duke.edu>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/9679: fix for uninterruptible open in portal file system
Message-ID:  <199901262120.NAA54409@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/9679; it has been noted by GNATS.

From: Darrell Anderson <anderson@cs.duke.edu>
To: freebsd-gnats-submit@freebsd.org, anderson@cs.duke.edu
Cc:  
Subject: Re: kern/9679: fix for uninterruptible open in portal file system
Date: Tue, 26 Jan 1999 16:18:54 -0500

 incorporating Bruce's suggestions cleans things up and still works:
 
 RCS file: /cvs/src/sys/miscfs/portal/portal_vnops.c,v
 retrieving revision 1.35
 diff -u -r1.35 portal_vnops.c
 --- portal_vnops.c      1999/01/12 11:49:30     1.35
 +++ portal_vnops.c      1999/01/26 21:17:34
 @@ -61,6 +61,7 @@
  #include <sys/socketvar.h>
  #include <sys/un.h>
  #include <sys/unpcb.h>
 +#include <sys/signalvar.h>
  #include <miscfs/portal/portal.h>
  
  static int portal_fileid = PORTAL_ROOTFILEID+1;
 @@ -287,7 +288,11 @@
                         splx(s);
                         goto bad;
                 }
 -               (void) tsleep((caddr_t) &so->so_timeo, PSOCK,
 "portalcon", 5 * hz);
 +               error = tsleep((caddr_t) &so->so_timeo, PCATCH|PSOCK,
 "portalcon", 5 * hz);
 +               if (error) {
 +                       splx(s);
 +                       goto bad;
 +               }
         }
         splx(s);
  
 @@ -301,7 +306,6 @@
          */
         so->so_rcv.sb_timeo = 0;
         so->so_snd.sb_timeo = 0;
 -       so->so_rcv.sb_flags |= SB_NOINTR;
         so->so_snd.sb_flags |= SB_NOINTR;
  
  
 @@ -334,6 +338,17 @@
                                         &m, &cm, &flags);
                 if (error)
                         goto bad;
 +               /*
 +                * if there's a signal pending, call tsleep to set the
 +                * proper process state and give us the EINTR error. 
 +                * don't need to worry about the portal daemon b/c
 +                * we close the socket on our way out.
 +                */
 +               if (CURSIG(curproc) != 0) {
 +                       error = tsleep((caddr_t)vp, PCATCH, "portalcon",
 0);
 +                       if (error)
 +                               goto bad;
 +               }
  
                 /*
                  * Grab an error code from the mbuf.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901262120.NAA54409>