]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sg: protect accesses to 'reserved' page array
authorHannes Reinecke <hare@suse.de>
Fri, 7 Apr 2017 07:34:14 +0000 (09:34 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2017 00:55:20 +0000 (20:55 -0400)
commit63157c1f95e1654b71f4f4e7912ec2099d327688
treef72fe80c00543cbce217db3bc95555fa34b2a09d
parenta66f9f79c87867e9961812b02c00a0b3706d32d5
scsi: sg: protect accesses to 'reserved' page array

The 'reserved' page array is used as a short-cut for mapping data,
saving us to allocate pages per request. However, the 'reserved' array
is only capable of holding one request, so this patch introduces a mutex
for protect 'sg_fd' against concurrent accesses.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Tested-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sg.c