[PATCH 1/2] virSecurityManagerMetadataLock: Clarify directory locking comment

Michal Privoznik mprivozn at redhat.com
Fri Jul 10 09:29:52 UTC 2020


In the light of recent commit of 9d83281382 fix the comment that
says directories can't be locked. Well, in general they can, but
not in our case.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/security/security_manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index ad1938caeb..d26d3a0527 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -1353,7 +1353,8 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED,
             continue;
 
         if (S_ISDIR(sb.st_mode)) {
-            /* Directories can't be locked */
+            /* We need to open the path for writing because we need exclusive
+             * (write) lock. But directories can't be opened for writing. */
             continue;
         }
 
-- 
2.26.2




More information about the libvir-list mailing list