-
Bug
-
Resolution: Won't Do
-
Normal
-
None
-
rhel-10.2
-
None
-
None
-
None
-
rhel-storage-management
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
What were you trying to do that didn't work?
What is the impact of this issue to you?
Please provide the package NVR for which the bug is seen:
How reproducible is this bug?:
Steps to reproduce
Expected results
Should return `NULL` (None in Python) or raise a `GError` because:
- Empty string is not a valid DM map name
- There is no DM device with an empty name
- "mapper" is not a valid DM node name for an empty map
Actual results
Returns `"mapper"`, which is:
- Incorrect - there is no DM node named "mapper"
- Misleading - suggests empty string is a valid map name
- Derived from the `/dev/mapper` directory path, not a real device
The function `bd_dm_node_from_name()` returns the string `"mapper"` when called with an empty string `""` as the map name, instead of returning `NULL` or raising an error. This violates the API contract and can lead to incorrect behavior in calling code.
```python
import gi
gi.require_version("BlockDev", "3.0")
from gi.repository import BlockDev as bdbd.init(None, None)# Call with empty string
result = bd.dm_node_from_name("")print(f"Result: {repr(result)}") # Prints: "mapper" (incorrect!)
```
libblockdev-3.4.0-2.el10.x86_64