mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
Cc: Naveen Goswamy <naveen.goswamy@polymtl.ca>,
	Jens Axboe <axboe@kernel.dk>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	Dave Jones <davej@redhat.com>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: Kernel crashing on eject SD card
Date: Wed, 15 Feb 2012 09:26:17 -0800	[thread overview]
Message-ID: <20120215172617.GB24986@google.com> (raw)
In-Reply-To: <4F3B1ED3.4000706@ce.jp.nec.com>

Hello,

This seems like the right approach to me, but..

On Wed, Feb 15, 2012 at 11:56:19AM +0900, Jun'ichi Nomura wrote:
> +int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
> +{
> +	int res;
> +
> +	res = drop_partitions(disk, bdev);
> +	if (res)
> +		return res;
> +

Hmmm... shouldn't we have set_capacity(disk, 0) here?

> +	check_disk_size_change(disk, bdev);
> +	bdev->bd_invalidated = 0;
> +	/* tell userspace that the media / partition table may have changed */
> +	kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE);

Also, we really shouldn't be generating KOBJ_CHANGE after every
-ENOMEDIUM open.  This can easily lead to infinite loop.  We should
generate this iff we actually dropped partitions && modified the size.

Thanks.

-- 
tejun

  reply	other threads:[~2012-02-15 17:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  0:19 Naveen Goswamy
2012-02-12 21:08 ` Stefan Richter
2012-02-12 21:20   ` Stefan Richter
2012-02-13  1:46     ` Naveen Goswamy
2012-02-13  2:18     ` Dave Jones
2012-02-13 17:40       ` Naveen Goswamy
2012-02-14 11:14         ` Jun'ichi Nomura
2012-02-14 13:31           ` Stefan Richter
2012-02-14 16:28           ` Tejun Heo
2012-02-15  2:56             ` Jun'ichi Nomura
2012-02-15 17:26               ` Tejun Heo [this message]
2012-02-16  1:26                 ` Jun'ichi Nomura
2012-02-16 16:36                   ` Tejun Heo
2012-03-01 18:58                   ` Luis Henriques
2012-03-02  0:12                     ` Jun'ichi Nomura
2012-03-02  9:35                       ` Luis Henriques
2012-03-02  9:41                       ` Jens Axboe

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=20120215172617.GB24986@google.com \
    --to=tj@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@kernel.dk \
    --cc=davej@redhat.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=naveen.goswamy@polymtl.ca \
    --cc=stefanr@s5r6.in-berlin.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome