summaryrefslogtreecommitdiffstats
path: root/fs/nsfs.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-10-01 17:38:19 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-10-04 20:54:22 +0200
commitaa116b810ac9077a263ed8679fb4d595f180e0eb (patch)
tree0e00e8d84c48e8ce53d2035207be218238e1ebf1 /fs/nsfs.c
parentRDMA/odp: Lift umem_mutex out of ib_umem_odp_unmap_dma_pages() (diff)
downloadlinux-aa116b810ac9077a263ed8679fb4d595f180e0eb.tar.xz
linux-aa116b810ac9077a263ed8679fb4d595f180e0eb.zip
RDMA/mlx5: Order num_pending_prefetch properly with synchronize_srcu
During destroy setting live = 0 and then synchronize_srcu() prevents num_pending_prefetch from incrementing, and also, ensures that all work holding that count is queued on the WQ. Testing before causes races of the form: CPU0 CPU1 dereg_mr() mlx5_ib_advise_mr_prefetch() srcu_read_lock() num_pending_prefetch_inc() if (!live) live = 0 atomic_read() == 0 // skip flush_workqueue() atomic_inc() queue_work(); srcu_read_unlock() WARN_ON(atomic_read()) // Fails Swap the order so that the synchronize_srcu() prevents this. Fixes: a6bc3875f176 ("IB/mlx5: Protect against prefetch of invalid MR") Link: https://lore.kernel.org/r/20191001153821.23621-5-jgg@ziepe.ca Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'fs/nsfs.c')
0 files changed, 0 insertions, 0 deletions