[dm-devel] [PATCH 2/2] dm-bdev-keep-bdev-always-referenced.patch

Jun'ichi Nomura j-nomura at ce.jp.nec.com
Tue May 12 08:32:23 UTC 2009


Mikulas Patocka wrote:
> @@ -1280,8 +1284,7 @@ static int __bind(struct mapped_device *
>  	if (size != get_capacity(md->disk))
>  		memset(&md->geometry, 0, sizeof(md->geometry));
>  
> -	if (md->bdev)
> -		__set_size(md, size);
> +	__set_size(md, size);
>  
>  	if (!size) {
>  		dm_table_destroy(t);
> @@ -1523,11 +1526,6 @@ int dm_swap_table(struct mapped_device *
>  	if (!dm_suspended(md))
>  		goto out;
>  
> -	/* without bdev, the device size cannot be changed */
> -	if (!md->bdev)
> -		if (get_capacity(md->disk) != dm_table_get_size(table))
> -			goto out;
> -
>  	__unbind(md);
>  	r = __bind(md, table);

When the device is suspended with noflush,
can __set_size() wait forever on i_mutex
if somebody is waiting for I/O flushing with i_mutex held (e.g. fsync)?

md->bdev was also used as a marker to tell whether the device was
suspended with noflush.
Sorry, the original comment in the code was perhaps not adequate.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation




More information about the dm-devel mailing list