mbox series

[ndctl,0/2] daxctl: Fix error handling and propagation in daxctl/device.c

Message ID 20240412-vv-daxctl-fixes-v1-0-6e808174e24f@intel.com (mailing list archive)
Headers show
Series daxctl: Fix error handling and propagation in daxctl/device.c | expand

Message

Verma, Vishal L April 12, 2024, 9:05 p.m. UTC
An intermittently failing daxctl-create.sh test revealed two things:
1/ The kernel handles the 0th DAX device under a region specially, and
refuses to delete it, returning an EBUSY. The daxctl-destroy-device
failed to account for this, even if other aspects of the destroy
operation succeeded (i.e. setting the size to zero). Patch 1 fixes this
by expecting the EBUSY on the 0th device, and not failing for it.

2/ When looping over multiple DAX devices, do_xaction_device() just
returned the status from the action on the last device. Since this order
can be effectively random, so would be the status returned. Patch 2
makes this behavior more consistent by saving any non-zero status from
the device iterations, and returning that instead of the last action's
status.

Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
Vishal Verma (2):
      daxctl/device.c: Handle special case of destroying daxX.0
      daxctl/device.c: Fix error propagation in do_xaction_device()

 daxctl/device.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
base-commit: e0d0680bd3e554bd5f211e989480c5a13a023b2d
change-id: 20240412-vv-daxctl-fixes-bd7992ea229d

Best regards,