[PATCH v2] nvmet: protect sqhd update by a lock

James Smart jsmart2021 at gmail.com
Wed Oct 18 09:45:42 PDT 2017


On 10/18/2017 12:23 AM, Christoph Hellwig wrote:
> do {
> 		old_sqhd = req->sq->sqhd;
> 		new_sqhd = (old + 1) % req->sq->size;
> 	} while (cmpxchg(&req->sq->sqhd, old_sqhd, new_sqhd) != old_sqhd);

sweet. does look good.

I'll repost as v3, but with an ammended title

-- james




More information about the Linux-nvme mailing list