srp_transport: Fix attribute registration
authorBart Van Assche <bvanassche@acm.org>
Fri, 21 Oct 2011 17:31:07 +0000 (19:31 +0200)
committerRoland Dreier <roland@purestorage.com>
Sat, 1 Dec 2012 01:40:33 +0000 (17:40 -0800)
commitac9be30e91cffe07f762bd91ca40de065bf257d7
tree94f6a1ced9a91c53d3c626ab81929d25fea2caa3
parenta4605a93696ee0768e55e4bce1ff7f0ee39bcf79
srp_transport: Fix attribute registration

Register transport attributes after the attribute array has been set
up instead of before.  The current code can trigger a race condition
because the code reading the attribute array can run on another thread
than the code that initialized that array.  Make sure that any code
reading the attribute array will see all values written into that
array.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Acked-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/scsi/scsi_transport_srp.c