[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120215172617.GB24986@google.com>
Date: Wed, 15 Feb 2012 09:26:17 -0800
From: Tejun Heo <tj@...nel.org>
To: Jun'ichi Nomura <j-nomura@...jp.nec.com>
Cc: Naveen Goswamy <naveen.goswamy@...ymtl.ca>,
Jens Axboe <axboe@...nel.dk>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Stefan Richter <stefanr@...6.in-berlin.de>,
Dave Jones <davej@...hat.com>, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: Re: Kernel crashing on eject SD card
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists