All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Huajun Li <huajun.li.lee@gmail.com>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: Bug when rescanning partitions on -ENOMEDIA
Date: Thu, 16 Feb 2012 08:33:14 -0800	[thread overview]
Message-ID: <20120216163314.GG24986@google.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1202161111501.1268-100000@iolanthe.rowland.org>

On Thu, Feb 16, 2012 at 11:23:22AM -0500, Alan Stern wrote:
> Tejun:
> 
> Please take a look at this thread:
> 
> 	http://marc.info/?t=132214525000001&r=1&w=2
> 
> Evidently your commit 1196f8b814f32cd04df334abf47648c2a9fd8324 (block: 
> rescan partitions on invalidated devices on -ENOMEDIA too) is causing 
> crashes.  The problem is that the partition scanning code calls 
> sd_revalidate_disk() after the underlying scsi_disk structure has been 
> deallocated.
> 
> There have been numerous bug reports filed on multiple Bugzillas about 
> this, for example, 
> 
> 	https://bugzilla.redhat.com/show_bug.cgi?id=754518
> 
> I don't know the right way to fix this, but it looks like there needs
> to be some synchronization between del_gendisk() and
> rescan_partitions().
> 
> Or maybe you think the synchronization should be done in the SCSI layer 
> instead.  But then what about non-SCSI users of the block layer?  Does 
> the block layer guarantee that it won't call methods in disk->fops 
> after del_gendisk() has returned?

No, the problem is that I used rescan_partitions() instead of
non-existing drop_partitions_and_truncate_disk().  Please read the
following thread.  Jun'ichi Nomura already proposed a patch.

 http://thread.gmane.org/gmane.linux.kernel/1250235/

Thanks.

-- 
tejun

      reply	other threads:[~2012-02-16 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 16:23 Bug when rescanning partitions on -ENOMEDIA Alan Stern
2012-02-16 16:33 ` Tejun Heo [this message]

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=20120216163314.GG24986@google.com \
    --to=tj@kernel.org \
    --cc=huajun.li.lee@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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.