From owner-freebsd-bugs Mon Jan 25 16:00:04 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA05670 for freebsd-bugs-outgoing; Mon, 25 Jan 1999 16:00:04 -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 QAA05657 for ; Mon, 25 Jan 1999 16:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id QAA21836; Mon, 25 Jan 1999 16:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Mon, 25 Jan 1999 16:00:01 -0800 (PST) Message-Id: <199901260000.QAA21836@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Bruce Evans Subject: Re: kern/9679: fix for uninterruptible open in portal file system Reply-To: Bruce Evans 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: Bruce Evans To: anderson@cs.duke.edu, FreeBSD-gnats-submit@FreeBSD.ORG Cc: Subject: Re: kern/9679: fix for uninterruptible open in portal file system Date: Tue, 26 Jan 1999 10:50:16 +1100 >@@ -287,7 +289,16 @@ > splx(s); > goto bad; > } >- (void) tsleep((caddr_t) &so->so_timeo, PSOCK, "portalcon", 5 * hz); >+ (void) tsleep((caddr_t) &so->so_timeo, PCATCH|PSOCK, "portalcon", 5 * hz); >+ /* >+ * check for pending signals, return EINTR if hit. >+ */ >+ if ((signo = CURSIG(curproc)) != 0) { >+ splx(s); >+ error = EINTR; >+ postsig(signo); >+ goto bad; >+ } > } > splx(s); > Why not just check the value returned by tsleep()? >@@ -301,7 +312,7 @@ > */ > so->so_rcv.sb_timeo = 0; > so->so_snd.sb_timeo = 0; >- so->so_rcv.sb_flags |= SB_NOINTR; >+ /*so->so_rcv.sb_flags |= SB_NOINTR;*/ /* we want signals for read */ > so->so_snd.sb_flags |= SB_NOINTR; > > Don't comment out wrong code; remove it. >@@ -334,6 +345,16 @@ > &m, &cm, &flags); > if (error) > goto bad; >+ /* >+ * check for pending signals, return EINTR if hit. >+ * don't need to worry about the portal daemon b/c >+ * we close the socket on our way out. >+ */ >+ if ((signo = CURSIG(curproc)) != 0) { >+ error = EINTR; >+ postsig(signo); >+ goto bad; >+ } > > /* > * Grab an error code from the mbuf. I think this should do what tsleep() would do, which is to return either EINTR or ERESTART immediately. Calling postsig() is unnecessary. I'm not sure about the ERESTART handling. Perhaps the problem should be passed to tsleep(): if (CURSIG(curproc) != 0) { error = tsleep(... PCATCH ...); if (error != 0) goto bad; } Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message