From: Katy Feng Date: Tue, 22 Aug 2023 18:11:41 +0000 (-0700) Subject: Change to common source file not applicable to open-vm-tools. X-Git-Tag: stable-12.3.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2793302b6d4bcd427a6e4b70263b4ce8069fdd00;p=thirdparty%2Fopen-vm-tools.git Change to common source file not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index a805ad1f0..78b4a42c8 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -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,