Config:
Kernel: 4.17.11-200.fc28.x86_64
OS: Fedora 28
ndctl version: 62
Issue
There's several scenarios that generate a cryptic 'Resource temporarily unavailable' (EAGAIN) message. Ideally ndctl should be able to distinguish between them and report the correct reason.
[Scenario 1] - If we successfully create a new namespace on a region to consume all available capacity:
# ndctl create-namespace -r region0
{
"dev":"namespace0.0",
"mode":"fsdax",
"map":"dev",
"size":"245.11 GiB (263.18 GB)",
"uuid":"91f66011-9d7d-4bbc-839a-2ec4697ab443",
"raw_uuid":"d90d5d45-7e73-4b0d-bb31-8365d9d8fca7",
"sector_size":512,
"blockdev":"pmem0",
"numa_node":0
}
Then re-run the same command again, we get a cryptic message:
# ndctl create-namespace -r region0
failed to create namespace: Resource temporarily unavailable
(In reality there would be a longer duration between creating the initial namespace and trying to create another one)
This occurs whether the namespace is enabled/active or disabled (as expected).
With a debug ndctl binary and -v we get a semi-useful message:
# ndctl create-namespace -r region0 -v
[...snip...]
namespace_create:772: region0: insufficient capacity size: 0 avail: 0
failed to create namespace: Resource temporarily unavailable
[Scenario 2] - If we have no current namespace AND the region is disabled, shown below:
# ndctl list -iNRD -r region0
{
"dimms":[
{
"dev":"nmem0",
"id":"8089-a1-1811-00000058",
"handle":1,
"phys_id":32
}
],
"regions":[
{
"dev":"region0",
"size":267361714176,
"available_size":267361714176,
"type":"pmem",
"iset_id":-5764607521557839872,
"mappings":[
{
"dimm":"nmem0",
"offset":268435456,
"length":267361714176,
"position":0
}
],
"state":"disabled",
"persistence_domain":"memory_controller"
}
]
}
Attempting to create a new namespace fails
# ndctl create-namespace -r region0
failed to create namespace: Resource temporarily unavailable
With -v we get a very useful 'region0: disabled, skipping...' message
# ndctl create-namespace -r region0 -v
[...snip...]
validate_namespace_options:473: region0: disabled, skipping...
failed to create namespace: Resource temporarily unavailable
Expected Result
It would be more useful to the user to receive a message along the following lines:
For scenario 1:
# ndctl create-namespace -r region0
failed to create namespace: A namespace already exists
-or-
failed to create namespace: No space left on device
-or-
failed to create namespace: One or more namespaces exist. No space left on device.
For scenario 2:
# ndctl create-namespace -r region0
failed to create namespace: region0 is disabled
-or-
failed to create namespace: region0: disabled, skipping...
Config:
Kernel: 4.17.11-200.fc28.x86_64
OS: Fedora 28
ndctl version: 62
Issue
There's several scenarios that generate a cryptic 'Resource temporarily unavailable' (EAGAIN) message. Ideally ndctl should be able to distinguish between them and report the correct reason.
[Scenario 1] - If we successfully create a new namespace on a region to consume all available capacity:
Then re-run the same command again, we get a cryptic message:
(In reality there would be a longer duration between creating the initial namespace and trying to create another one)
This occurs whether the namespace is enabled/active or disabled (as expected).
With a debug ndctl binary and
-vwe get a semi-useful message:[Scenario 2] - If we have no current namespace AND the region is disabled, shown below:
Attempting to create a new namespace fails
With
-vwe get a very useful 'region0: disabled, skipping...' messageExpected Result
It would be more useful to the user to receive a message along the following lines:
For scenario 1:
For scenario 2: