Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2013 04:00:01 GMT
From:      John-Mark Gurney <jmg@funkthat.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/174684 [tws] [patch] 3dm2 (or smartctl) triggers a kernel panic
Message-ID:  <201311040400.rA44011N040644@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/174684; it has been noted by GNATS.

From: John-Mark Gurney <jmg@funkthat.com>
To: bug-followup@FreeBSD.org, 3226388001@jcom.home.ne.jp
Cc:  
Subject: Re: kern/174684 [tws] [patch] 3dm2 (or smartctl) triggers a kernel panic
Date: Sun, 3 Nov 2013 19:51:53 -0800

 --jCrbxBqMcLqd4mOl
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 I have a better patch that eliminates the unnecessary chan, and just
 uses sc as the wait channel...  The panic appears due to the fact that
 chan might not be initalized, and running an extra wakeup is not a big
 issue...
 
 If someone could test the patch, I'll commit it..
 
 Thanks.
 
 -- 
   John-Mark Gurney				Voice: +1 415 225 5579
 
      "All that I will do, has been done, All that I have, has not."
 
 --jCrbxBqMcLqd4mOl
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="tws.patch"
 
 Index: tws.h
 ===================================================================
 --- tws.h	(revision 256870)
 +++ tws.h	(working copy)
 @@ -248,7 +248,6 @@
      struct mtx io_lock;                   /* IO  lock */
      struct tws_ioctl_lock ioctl_lock;     /* ioctl lock */ 
      u_int32_t seq_id;                     /* Sequence id */
 -    void *chan;                           /* IOCTL req wait channel */
      struct tws_circular_q aen_q;          /* aen q */
      struct tws_circular_q trace_q;        /* trace q */
      struct tws_stats stats;               /* I/O stats */
 Index: tws_cam.c
 ===================================================================
 --- tws_cam.c	(revision 256870)
 +++ tws_cam.c	(working copy)
 @@ -1297,7 +1297,7 @@
  
      tws_turn_on_interrupts(sc);
  
 -    wakeup_one(sc->chan);
 +    wakeup_one(sc);
  }
  
  
 Index: tws_user.c
 ===================================================================
 --- tws_user.c	(revision 256870)
 +++ tws_user.c	(working copy)
 @@ -103,8 +103,7 @@
      do {
          req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU);
          if ( !req ) {
 -            sc->chan = (void *)sc;
 -            error = tsleep(sc->chan,  0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz);
 +            error = tsleep(sc,  0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz);
              if ( error == EWOULDBLOCK ) {
                  return(ETIMEDOUT);
              }
 @@ -203,7 +202,7 @@
      //
      req->state = TWS_REQ_STATE_FREE;
  
 -    wakeup_one(sc->chan);
 +    wakeup_one(sc);
  
      return(error);
  }
 
 --jCrbxBqMcLqd4mOl--



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