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:
parent
de196f4b60
commit
f7f08ba881
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user