From owner-freebsd-bugs Tue Jan 26 13:20:05 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA01792 for freebsd-bugs-outgoing; Tue, 26 Jan 1999 13:20:05 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA01770 for ; Tue, 26 Jan 1999 13:20:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id NAA54409; Tue, 26 Jan 1999 13:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Tue, 26 Jan 1999 13:20:01 -0800 (PST) Message-Id: <199901262120.NAA54409@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Darrell Anderson Subject: Re: kern/9679: fix for uninterruptible open in portal file system Reply-To: Darrell Anderson Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/9679; it has been noted by GNATS. From: Darrell Anderson 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 #include #include +#include #include 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