]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: libfc: Revisit kref handling
authorHannes Reinecke <hare@suse.de>
Fri, 30 Sep 2016 09:01:14 +0000 (11:01 +0200)
committerBrian Maly <brian.maly@oracle.com>
Mon, 21 May 2018 21:57:51 +0000 (17:57 -0400)
commit1d83f3c7c158a3d19bfb04d2f6efa2d24aa72389
treeca485f19f5b2a8b81651d74b73206f0d9998bb49
parenteeb41c6bd2d2b9f7bd41aeee8aa615babc635759
scsi: libfc: Revisit kref handling

The kref handling in fc_rport is a mess. This patch updates
the kref handling according to the following rules:

- Take a reference whenever scheduling a workqueue
- Take a reference whenever an ELS command is send
- Drop the reference at the end of the workqueue function
- Drop the reference at the end of handling ELS replies
- Take a reference when allocating an rport
- Drop the reference when removing an rport

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
OraBug: 27363267
(cherry picked from commit 4d2095cc42a2d8062590891f929d9d694cbd927f)
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Fred Herard <fred.herard@oracle.com>
Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/libfc/fc_rport.c