snp panic [Was: Re: panic with tcpdrop]

Kostik Belousov kostikbel at gmail.com
Wed Dec 19 06:18:33 PST 2007


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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20071219/050a3fa0/attachment.pgp


More information about the freebsd-current mailing list