]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common source file not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Tue, 22 Aug 2023 18:11:41 +0000 (11:11 -0700)
committerKaty Feng <fkaty@vmware.com>
Tue, 22 Aug 2023 18:11:41 +0000 (11:11 -0700)
open-vm-tools/lib/file/filePosix.c

index a805ad1f0bf304a29738046656fafde5ffa2cc1f..78b4a42c8887e09193ed0242120b6c6fde5093c6 100644 (file)
@@ -1627,15 +1627,16 @@ File_GetVMFSLockInfo(const char *path,         // IN
           * This is a non-exclusive lock. Thus it can have multiple holders.
           * For now, return only the first.
           */
-         if (diskLock->numHolders == 0 ||
-             diskLock->numHolders > FS3_MAX_LOCK_HOLDERS) {
+         if (diskLock->numHolders > FS3_MAX_LOCK_HOLDERS) {
             Log(LGPFX" %s: Corrupt VMFS disk lock found for file \"%s\", "
                 "invalid number of holders %u.\n", __FUNCTION__, path,
                 diskLock->numHolders);
             goto exit;
          }
+
          *outVMFSMacAddr = Str_SafeAsprintf(NULL, FS_UUID_FMTSTR,
-            FS_UUID_VAARGS(&diskLock->holders[0].uid));
+               FS_UUID_VAARGS(diskLock->numHolders == 0 ?
+               &diskLock->owner : &diskLock->holders[0].uid));
       } else {
          /* Exclusive lock, so there is only one owner. */
          *outVMFSMacAddr = Str_SafeAsprintf(NULL, FS_UUID_FMTSTR,