]> git.baikalelectronics.ru Git - kernel.git/commit
NVMe: IOCTL path RCU protect queue access
authorKeith Busch <keith.busch@intel.com>
Mon, 3 Mar 2014 23:39:13 +0000 (16:39 -0700)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Mon, 24 Mar 2014 12:54:40 +0000 (08:54 -0400)
commitb3104dc57bd1d03c354faa9fc13d74cf069981b4
treef0dc2bc897e723037ae63a5f7f41bb3bff710399
parentc1dee4a360c45c2072b9a099361a2f1d94feb785
NVMe: IOCTL path RCU protect queue access

This adds rcu protected access to a queue in the nvme IOCTL path
to fix potential races between a surprise removal and queue usage in
nvme_submit_sync_cmd. The fix holds the rcu_read_lock() here to prevent
the nvme_queue from freeing while this path is executing so it can't
sleep, and so this path will no longer wait for a available command
id should they all be in use at the time a passthrough IOCTL request
is received.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme-core.c
drivers/block/nvme-scsi.c
include/linux/nvme.h