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

Jun'ichi Nomura j-nomura at ce.jp.nec.com
Thu Jul 23 08:52:42 UTC 2009


Hi Alasdair, Mikulas,

I found 2.6.31-rc includes the following commit:
  commit 32a926da5a16c01a8213331e5764472ce2f14a8d
  Author: Mikulas Patocka <mpatocka at redhat.com>
  Date:   Mon Jun 22 10:12:17 2009 +0100

which will introduce a deadlock problem described here:
https://www.redhat.com/archives/dm-devel/2009-May/msg00097.html
(or see below)

Was the problem fixed/worked around somehow?

Jun'ichi Nomura wrote:
> 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