pmem / ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics.
Other
265 stars 136 forks source link

namespace reconfig issue #114

Open kin-cho opened 5 years ago

kin-cho commented 5 years ago

Environment:

OS/kernel: Oracle Linux ndctl version: 66 nvdimm FW version: 01.02.00.5375

namespace reconfig (create-namespace -e ) is not handling abnormal input properly. Specifically if a namespace which was previously disabled/deleted is reconfigured, the reconfigure command fails, but has a side-effect of assigning a uuid to the namespace, which in turn cause subsequent create-namespace in the region to fail.

Here's a sample command sequence:

// region3 initially has no active namespace # ndctl create-namespace -r region3 // namespace3.0 is created // now disable/destroy namespace3.0 # ndctl disable-namespace namespace3.0 # ndctl destroy-namespace namespace3.0 // now try to reconfig namespace3.0 // the following will fail: # ndctl create-namespace -e namespace3.0 -f -m fsdax // with this error: failed to reconfigure namespace: Invalid argument // however, uuid of namespace3.0 will be set, such as: "dev":"namespace3.0", .. "uuid":"be26ef46-3043-4e15-90d9-2c4d40f193db" // now create-namespace in the region will fail # ndctl create-namespace -r region3 // with this error: failed to create namespace: Device or resource busy

The root cause of this error condition is create-namespace -e namespace3.0 setting a uuid for namespace3.0, causing following create-namespace in that region to fail.

I've created pull request #113 as a simple fix to this issue. With this fix, create-namespace -e namespace3.0 will fail with: failed to reconfigure namespace: No such device or address

with no side-effect to namespace3.0, and below will succeed: # ndctl create-namespace -r region3

kin-cho commented 4 years ago

Hi, any updates or comments on this request?