Date: Sun, 7 Oct 2001 11:20:02 -0700 (PDT) From: Valentin Nechayev <netch@netch.kiev.ua> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/30985: incorrect signal handling in snpread() Message-ID: <200110071820.f97IK2T01515@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/30985; it has been noted by GNATS. From: Valentin Nechayev <netch@netch.kiev.ua> To: Dima Dorfman <dima@trit.org> Cc: Valentin Nechayev <netch@segfault.kiev.ua>, FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/30985: incorrect signal handling in snpread() Date: Sun, 7 Oct 2001 21:15:36 +0300 Sun, Oct 07, 2001 at 08:50:41, dima wrote about "Re: kern/30985: incorrect signal handling in snpread()": > > - tsleep((caddr_t) snp, (PZERO + 1) | PCATCH, "snoopread" > > , 0); > > + error = tsleep((caddr_t) snp, (PZERO + 1) | PCATCH, "snoopread", 0); > > + if (error == EINTR || error == ERESTART) { > > + splx(s); > > + return EINTR; > > + } > > Why can't we just return whatever tsleep() returns, as most (all?) > other drivers do? Like so (untested): I am not experienced kernel hacker ;) The examples I saw in kernel code, mostly test for ERESTART and possibly EINTR and exit from routine in case of such codes. tsleep(9) man page (in RELENG_4_4) mentions the only another return code allowed - EWOULDBLOCK in timeout case, but snpread() doesn't suppose timeout. If you suppose that exit on any nonzero value is correct, you probably are right. > snp->snp_flags |= SNOOP_RWAIT; > - tsleep((caddr_t)snp, (PZERO + 1) | PCATCH, "snprd", 0); > + error = tsleep((caddr_t)snp, (PZERO + 1) | PCATCH, > + "snprd", 0); > + if (error != 0) > + return (error); > } /netch 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?200110071820.f97IK2T01515>