Bug 1480006
| Summary: | noisy "remove ioctl failed" messages when attempting to luksClose a still mounted device | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | cryptsetup | Assignee: | Ondrej Kozina <okozina> |
| Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | agk, mbroz, okozina, prajnoha |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | cryptsetup-1.7.4-4.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 16:38:50 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Corey Marthaler
2017-08-09 22:18:47 UTC
> /dev/mapper/virt2_luksvolume is active and is in use.
If you see "in use" in this status, it means that device-mapper open count is not zero. So something still keeps it open (mapped device, filesystem)...
Please paste lsblk -f or similar command that shows what it is...
Cryptsetup cannot remove open devices, messages are just consequence of repeated tries to remove the device (and these are kernel messages - not sure why we print them in fact, should'n be be debug only?...)
This bug is only about removing those ioctl errors when still in use. The "Device virt2_luksvolume is still in use." should be all that needs to be printed. Ah, ok. This is actually error message (error level) from device mapper library. You can get exactly the same errors when running dmsetup remove --retry virt2_luksvolume I am not sure if I should hide these messages in cryptsetup. I would prefer libdevmapper to print them in debug level (not _LOG_ERR) with the last unsuccessful message in error level. lvm2 detects in-use device. See lvm2 source code function lib/activate/actviate.c lv_check_not_in_use() for full details to avoid trying to remove device in-use (and print nice messages instead). It does call 2 libdm API calls: dm_device_has_holders() dm_device_has_mounted_fs() so in the end this 'retry' is ONLY used when there is some kind of very unlikely race with udev WATCH rule. Fix verified in the latest build. cryptsetup-1.7.4-4.el7.x86_64 Built: Thu 19 Oct 2017 08:44:30 AM CDT [root@host-005 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/raid_luksvolume 5.9G 5.9G 0 100% /mnt/open_LUKS_fsadm_resize [root@host-005 ~]# cryptsetup -v status raid_luksvolume /dev/mapper/raid_luksvolume is active and is in use. type: LUKS1 cipher: aes-xts-plain64 keysize: 256 bits device: /dev/mapper/raid_sanity-open_LUKS_fsadm_resize offset: 4096 sectors size: 12578816 sectors mode: read/write Command successful. [root@host-005 ~]# cryptsetup luksClose raid_luksvolume Device raid_luksvolume is still in use. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0915 |