nvmet: synchronize sqhd update
authorJames Smart <jsmart2021@gmail.com>
Wed, 18 Oct 2017 21:33:59 +0000 (14:33 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 19 Oct 2017 07:16:12 +0000 (09:16 +0200)
commitf9cf2a64912d67c9cf49c316a0a0ada0ea7ed1da
treeda4512b8c99a0924534dacbf9706aac0b501609a
parent17c4dc6eb7e1b2fb1ce6a52467e3be635224606e
nvmet: synchronize sqhd update

In testing target io in read write mix, we did indeed get into cases where
sqhd didn't update properly and slowly missed enough updates to shutdown
the queue.

Protect the updating sqhd by using cmpxchg, and for that turn the sqhd
field into a u32 so that cmpxchg works on it for all architectures.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c
drivers/nvme/target/nvmet.h