On (05/04/15 11:28), Minchan Kim wrote:
> [minchan]: use zram->claim to avoid lockdep splat
> Reported-by: Minchan Kim <minc...@kernel.org>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com>
> ---

will take a look today, cleanup and re-submit. thanks!


>       /*
>        * Remove sysfs first, so no one will perform a disksize
> -      * store while we destroy the devices
> +      * store while we destroy the devices. This also helps during
> +      * zram_remove() -- device_reset() is the last holder of
> +      * ->init_lock.
>        */
>       sysfs_remove_group(&disk_to_dev(zram->disk)->kobj,
>                       &zram_disk_attr_group);
>  
> +     /* Make sure all pending I/O is finished */
> +     fsync_bdev(bdev);
>       zram_reset_device(zram);
> +     mutex_unlock(&bdev->bd_mutex);
 -      mutex_unlock(&bdev->bd_mutex);

> +     pr_info("Removed device: %s\n", zram->disk->disk_name);
> +
>       idr_remove(&zram_index_idr, zram->disk->first_minor);
>       blk_cleanup_queue(zram->disk->queue);
>       del_gendisk(zram->disk);
>       put_disk(zram->disk);
>       kfree(zram);
> +
> +     return 0;
>  }
[..]

        -ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to