]> git.baikalelectronics.ru Git - kernel.git/commit
fix race that can give duplicate host number
authorJoe Eykholt <jeykholt@cisco.com>
Tue, 16 Jun 2009 06:22:14 +0000 (23:22 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 21 Jun 2009 15:52:42 +0000 (10:52 -0500)
commit031a4d1b255ca3c0b47287cc5d5bfc0b11168c75
tree863c391cc13e13d005e55096ff3436e973c06453
parent1f31f840a5dc71736e43e37aa24bfd130bc8214d
fix race that can give duplicate host number

Just once, two fcoe instances got the same host number
from scsi_add_host().

Use atomic_t and atomic_inc_return() to get next host number.
Subtract 1, so that scsi_host still starts with 0.

[jejb: added comment about unusual subtraction]
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/hosts.c