Re: snp panic [Was: Re: panic with tcpdrop]

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Wed, 19 Dec 2007 16:18:22 +0200
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
_at__at_ -466,7 +466,8 _at__at_ 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);
 }
_at__at_ -491,7 +492,7 _at__at_ 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;
_at__at_ -502,8 +503,6 _at__at_ 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);
_at__at_ -516,6 +515,9 _at__at_ 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);
_at__at_ -523,13 +525,6 _at__at_ 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;

Received on Wed Dec 19 2007 - 13:18:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:24 UTC