Skip to content

[create-namespace] "Resource temporarily unavailable" message could be more useful  #67

Description

@sscargal

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...

Activity

  1. djbw commented on Aug 9, 2019

    @djbw
    Member

    Hi Steve, it's been a while and some recent changes in ndctl v66 go after these concerns, in particular:

    4200803 ndctl/namespace: Report ENOSPC when regions are full
    bf1c7f0 ndctl/namespace: Continue region search on 'missing seed' event

    Scenario1 should be fixed the way you suggest. Scenario2 will now try to fall back instead of fail, but will ultimately report "No space left on device" which I think is ok for disabled region capacity.

    In any event give v66 a try and let me know if it works for you.

  2. sscargal commented on Aug 9, 2019

    @sscargal
    Author

    Thanks very much. I'll close this issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions