Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2007 16:18:22 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Javier <rako29@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: snp panic [Was: Re: panic with tcpdrop]
Message-ID:  <20071219141821.GB57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <47691636.7020907@gmail.com>
References:  <47473E30.6070608@gmail.com> <20071124003453.O14018@fledge.watson.org> <47477F9F.2080900@gmail.com> <20071124142149.Y14018@fledge.watson.org> <47486C9B.4020407@gmail.com> <20071124211859.S14018@fledge.watson.org> <20071125075620.GA78396@deviant.kiev.zoral.com.ua> <4749B2CC.7020300@gmail.com> <20071125203015.GF78396@deviant.kiev.zoral.com.ua> <47691636.7020907@gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Dec 19, 2007 at 10:01:42AM -0300, Javier wrote:
> Hello, sorry, the same panic again, but with the snp.c patched with your
> modification. The steps of the new panic are the same.
> How can I help?
> Thanks
> Javier

The fix was not complete. Try the patch below, it is against the current.
Hopefully, it fix the problem.

For RELENG_7, you need to either apply rev. 1.106, and the apply the patch.
Or, you may take the snp.c from the HEAD and again, apply the patch.

diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 6c153d2..3768497 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -466,7 +466,8 @@ snpclose(struct cdev *dev, int flags, int fmt, struct thread *td)
 	free(snp->snp_buf, M_SNP);
 	snp->snp_flags &= ~SNOOP_OPEN;
 	dev->si_drv1 = NULL;
-	destroy_dev_sched_cb(dev, snp_detach, snp);
+	snp_detach(snp);
+	destroy_dev_sched(dev);
 
 	return (0);
 }
@@ -491,7 +492,7 @@ snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
     struct thread *td)
 {
 	struct snoop *snp;
-	struct tty *tp, *tpo;
+	struct tty *tp;
 	struct cdev *tdev;
 	struct file *fp;
 	int s;
@@ -502,8 +503,6 @@ snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
 		s = *(int *)data;
 		if (s < 0)
 			return (snp_down(snp));
-		if (snp->snp_tty != NULL)
-			return (EBUSY);
 
 		if (fget(td, s, &fp) != 0)
 			return (EINVAL);
@@ -516,6 +515,9 @@ snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
 		tdev = fp->f_vnode->v_rdev;
 		fdrop(fp, td);
 
+		if (snp->snp_tty != NULL)
+			return (EBUSY);
+
 		tp = snpdevtotty(tdev);
 		if (!tp)
 			return (EINVAL);
@@ -523,13 +525,6 @@ snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
 			return (EBUSY);
 
 		s = spltty();
-
-		if (snp->snp_target == NULL) {
-			tpo = snp->snp_tty;
-			if (tpo)
-				tpo->t_state &= ~TS_SNOOP;
-		}
-
 		tp->t_state |= TS_SNOOP;
 		snp->snp_olddisc = tp->t_line;
 		tp->t_line = snooplinedisc;

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFHaSgtC3+MBN1Mb4gRAtxuAKCL/6E7jbvGR2REZjyPz5WBYiS0dwCgjI2G
Ct4jTsoPjcTxwsaVnNbZUVQ=
=xsEv
-----END PGP SIGNATURE-----
help

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