Change in vdsm[master]: Add forceLink() which replaces a link if it already exists.

ewarszaw at redhat.com ewarszaw at redhat.com
Wed Jan 30 13:17:56 UTC 2013


Eduardo has posted comments on this change.

Change subject: Add forceLink() which replaces a link if it already exists.
......................................................................


Patch Set 2: (4 inline comments)

....................................................
Commit Message
Line 3: AuthorDate: 2013-01-27 13:15:49 +0200
Line 4: Commit:     Eduardo Warszawski <ewarszaw at redhat.com>
Line 5: CommitDate: 2013-01-28 10:33:40 +0200
Line 6: 
Line 7: Add forceLink() which replaces a link if it already exists.
In the same way that the actual code is.
But if two instances of this function are racing we will deduce it by from the logs.
The solution for this hipotetical race is to avoid two threads interacting with the same link. This seem to be the actual situation.
Line 8: 
Line 9: Reduce the number of fileUtils.safeUnlink() callers.
Line 10: 
Line 11: Change-Id: Idea4ab66cc2954fdb11606daa4a73ad3edb0c7ef


Line 5: CommitDate: 2013-01-28 10:33:40 +0200
Line 6: 
Line 7: Add forceLink() which replaces a link if it already exists.
Line 8: 
Line 9: Reduce the number of fileUtils.safeUnlink() callers.
In order to remove this function, unifiying all under rmFile().
Line 10: 
Line 11: Change-Id: Idea4ab66cc2954fdb11606daa4a73ad3edb0c7ef


....................................................
File vdsm/storage/fileVolume.py
Line 26: 
Line 27: from misc import deprecated
Line 28: from sdc import sdCache
Line 29: from threadLocal import vars
Line 30: import storage_exception as se
from precedes import.
general to particular.
Really this reordering is unncesessary to this patch but was too boring  to rewind.
Line 31: import outOfProcess as oop
Line 32: import volume
Line 33: import image
Line 34: import sd


....................................................
File vdsm/utils.py
Line 71:                           exc_info=True)
Line 72:             raise
Line 73: 
Line 74: 
Line 75: def forceLink(src, dst):
Because vdsm out of the storage may want to fiddle with links. And because rmFile is here. (Coherence)
Line 76:     """ Makes or replaces a hard link.
Line 77: 
Line 78:     Like os.link() but replaces the link if it exists.
Line 79:     """


--
To view, visit http://gerrit.ovirt.org/11423
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idea4ab66cc2954fdb11606daa4a73ad3edb0c7ef
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list