dax/bus.c: use the right locking mode (read vs write) in size_show
authorVishal Verma <vishal.l.verma@intel.com>
Tue, 30 Apr 2024 17:44:26 +0000 (11:44 -0600)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 7 May 2024 17:37:01 +0000 (10:37 -0700)
commit2acf04532d6d655d8c3b2ee4ddeb320107043086
tree65a9637e7ca07490d33b656ee3bd5f8f767cdc90
parente39dbcfba714c4c2e924e96fc8fdde1080a5a737
dax/bus.c: use the right locking mode (read vs write) in size_show

In size_show(), the dax_dev_rwsem only needs a read lock, but was
acquiring a write lock.  Change it to down_read_interruptible() so it
doesn't unnecessarily hold a write lock.

Link: https://lkml.kernel.org/r/20240430-vv-dax_abi_fixes-v3-4-e3dcd755774c@intel.com
Fixes: c05ae9d85b47 ("dax/bus.c: replace driver-core lock usage by a local rwsem")
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/dax/bus.c