1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-03 17:50:03 +03:00

libdm: clean up udev sync semaphore on fail path during its creation

Clean up udev sync semaphore on fail path during its creation, otherwise
the caller will have no handle returned to clean it up itself and the
semaphore will keep staying in the system. The only way to clean it up
would be to call `dmsetup udevcomplete_all` which would destroy all
udev sync semaphores, not just the failed one, which we don't want.
This commit is contained in:
Peter Rajnoha 2024-08-12 14:16:32 +02:00
parent de196f4b60
commit f7f08ba881
No known key found for this signature in database
GPG Key ID: E776664036DF84AB
2 changed files with 2 additions and 0 deletions

View File

@ -2574,6 +2574,7 @@ static int _udev_notify_sem_create(uint32_t *cookie, int *semid)
log_error("cookie create: semid %d: sem_ctl GETVAL failed for "
"cookie 0x%" PRIx32 ": %s",
gen_semid, gen_cookie, strerror(errno));
(void) _udev_notify_sem_destroy(gen_cookie, gen_semid);
goto bad;
}

View File

@ -2573,6 +2573,7 @@ static int _udev_notify_sem_create(uint32_t *cookie, int *semid)
log_error("cookie create: semid %d: sem_ctl GETVAL failed for "
"cookie 0x%" PRIx32 ": %s",
gen_semid, gen_cookie, strerror(errno));
(void) _udev_notify_sem_destroy(gen_cookie, gen_semid);
goto bad;
}