Re: 2.6.32-rc5: surprise removal of USB mass storage, and wholesystem goes to hell

From: Heinz Diehl
Date: Sun Nov 15 2009 - 04:46:42 EST


On 29.10.2009, Jens Axboe wrote:

I had the same problem which has been discussed in this thread,
and can confirm that this patch from Jens Axboe (which is already merged into 2.6.32-rc7)
fixes it for me.

> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 4f53a6d..756c31b 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -614,6 +616,18 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)
> kthread_stop(wb->task);
> }
>
> +static void bdi_prune_sb(struct backing_dev_info *bdi)
> +{
> + struct super_block *sb;
> +
> + spin_lock(&sb_lock);
> + list_for_each_entry(sb, &super_blocks, s_list) {
> + if (sb->s_bdi == bdi)
> + sb->s_bdi = NULL;
> + }
> + spin_unlock(&sb_lock);
> +}
> +
> void bdi_unregister(struct backing_dev_info *bdi)
> {
> if (bdi->dev) {
> @@ -624,6 +638,8 @@ void bdi_unregister(struct backing_dev_info *bdi)
> device_unregister(bdi->dev);
> bdi->dev = NULL;
> }
> +
> + bdi_prune_sb(bdi);
> }
> EXPORT_SYMBOL(bdi_unregister);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/