[linux-lvm] Re: [patch] make device mapper compile on 2.5.4x

Alexander Viro viro at math.psu.edu
Mon Nov 11 17:23:02 UTC 2002


On Mon, 11 Nov 2002, Bernd Eckenfels wrote:

> -	set_device_ro(dm_kdev(md), 0/*(param->flags & DM_READONLY_FLAG)*/);
> +	bdev = bdget(kdev_t_to_nr(dm_kdev(md)));
> +	if (!bdev)
> +		return -ENXIO;
> +	set_device_ro(bdev, (param->flags & DM_READONLY_FLAG));
> +	bdput(bdev);

That is simply wrong.  set_device_ro() works only on opened block_device.
Correct fix is to use set_disk_ro() and it's already in the tree (1.830
on bkbits).





More information about the linux-lvm mailing list