All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux-SCSI <linux-scsi@vger.kernel.org>,
	akpm@linux-foundation.org
Subject: Re: [PATCH v4 1/2] SCSI: Asynchronous event notification	infrastructure
Date: Mon, 29 Oct 2007 11:17:07 -0500	[thread overview]
Message-ID: <1193674627.3383.45.camel@localhost.localdomain> (raw)
In-Reply-To: <47260546.9090508@garzik.org>

On Mon, 2007-10-29 at 12:07 -0400, Jeff Garzik wrote:
> James Bottomley wrote:
> > This still doesn't solve the fundamental corruption problem:
> > sdev->event_work has to contain the work entry until the workqueue has
> > finished executing it (which is some unspecified time in the future).
> > As soon as you drop the sdev->list_lock, the system thinks
> > sdev->event_work is available for reuse.  If we fire another event
> > before the work queue finished processing the prior event, the queue
> > will be corrupted.
> 
> I think you're misunderstanding the workqueue code?  You can call 
> schedule_work(&sdev->event_work) from anywhere, any time you like, as 
> many times as you like.

OK, take me through it slowly then ... I think schedule_work(work)
inserts work->entry onto the workqueue list (in
workqueue.c:insert_work()).  If the event hasn't fired, it will already
be on the list, so adding the same entry to a list twice causes a list
corruption problem.

Plus, unfortunately, the CC/UA events are going to have to carry extra
sense data; they're not simply going to be triggers saying something
happened.

James



  reply	other threads:[~2007-10-29 16:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 14:42 [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure Jeff Garzik
2007-10-29 14:42 ` [PATCH v4 1/2] SCSI: " Jeff Garzik
2007-10-29 15:51   ` James Bottomley
2007-10-29 16:07     ` Jeff Garzik
2007-10-29 16:17       ` James Bottomley [this message]
2007-10-29 16:29         ` Jeff Garzik
2007-10-29 17:01           ` James Bottomley
2007-10-29 21:31             ` [PATCH v5 0/2] SCSI asynchronous event notification API Jeff Garzik
2007-10-29 21:31               ` [PATCH v5 1/2] SCSI: add " Jeff Garzik
2007-10-29 21:31               ` [PATCH v5 2/2] libata: Utilize new SCSI event infrastructure Jeff Garzik
2007-10-29 14:42 ` [PATCH v4 " Jeff Garzik
2007-10-29 15:43 ` [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure James Bottomley
2007-10-29 15:58   ` Jeff Garzik
2007-10-29 16:10     ` James Bottomley
2007-10-29 16:24       ` Jeff Garzik
2007-10-29 16:34         ` James Bottomley
2007-10-29 16:48           ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193674627.3383.45.camel@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.