Commit 6f6544f2 authored by Vishal Verma's avatar Vishal Verma Committed by Andrew Morton
Browse files

dax/bus.c: fix locking for unregister_dax_dev / unregister_dax_mapping paths

Commit c05ae9d8 ("dax/bus.c: replace driver-core lock usage by a local
rwsem") aimed to undo device_lock() abuses for protecting changes to
dax-driver internal data-structures like the dax_region resource tree to
device-dax-instance range structures.  However, the device_lock() was
legitimately enforcing that devices to be deleted were not current
actively attached to any driver nor assigned any capacity from the region.

As a result of the device_lock restoration in delete_store(), the
conditional locking in unregister_dev_dax() and unregister_dax_mapping()
can be removed.

Link: https://lkml.kernel.org/r/20240430-vv-dax_abi_fixes-v3-2-e3dcd755774c@intel.com


Fixes: c05ae9d8 ("dax/bus.c: replace driver-core lock usage by a local rwsem")
Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c14c647b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment