[lvm-devel] [PATCH 06/24] lv_info handle udev_sync

Zdenek Kabelac zkabelac at redhat.com
Sun Jan 30 20:23:28 UTC 2011


Dne 30.1.2011 21:17, Milan Broz napsal(a):
> On 01/30/2011 01:57 PM, Zdenek Kabelac wrote:
> 
>> NoteII: locking_is_clustered() is needed to detect in which context
>> lv_info() is called as we cannot use sync_local_dev_names() when
>> locking is not defined.
> 
> hmmmm. I probably confused you here:)
> 
> I don't think locking_is_clustered() can be used insinde clvmd
> (it is "locking implementation" itself).
> 
> Or you mean it that in clvmd should run fs_unlock() and in local
> code (lvm command) should run sync_local_dev_names(cmd) (with cluster locking)?

Yes - that's the intention

In clvmd - locking is not initilized - so sync_local_dev_names() cannot be used.


> 
>> +	/*
>> +	 * If open_count info is requested and we have to be sure our own udev
>> +	 * transactions are finished
>> +	 * For non-clustered locking type we are only interested for non-delete operation
>> +	 * in progress - as only those could lead to opened files
>> +	 */
>> +	if (with_open_count) {
>> +		if (locking_is_clustered())
>> +			sync_local_dev_names(cmd); /* Wait to have udev in sync */
>> +		else if (fs_has_non_delete_ops())
>> +			fs_unlock(); /* For non clustered - wait if there are non-delete ops */
>> +	}
> 
> this is really ugly...

Yes I know - plan for the future would be to hide this logic directly to
sync_local_dev_names() -  so only sync_local_dev_name() would stay there.

Zdenek




More information about the lvm-devel mailing list