]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.20.16/revert-scsi-libfc-add-warn_on-when-deleting-rports.patch
Linux 4.14.106
[thirdparty/kernel/stable-queue.git] / releases / 4.20.16 / revert-scsi-libfc-add-warn_on-when-deleting-rports.patch
1 From f2b6b12d14f6f514fce44cb3148e6edb4d27bb8c Mon Sep 17 00:00:00 2001
2 From: Ross Lagerwall <ross.lagerwall@citrix.com>
3 Date: Fri, 1 Feb 2019 14:42:28 +0000
4 Subject: Revert "scsi: libfc: Add WARN_ON() when deleting rports"
5
6 [ Upstream commit d8f6382a7d026989029e2e50c515df954488459b ]
7
8 This reverts commit bbc0f8bd88abefb0f27998f40a073634a3a2db89.
9
10 It added a warning whose intent was to check whether the rport was still
11 linked into the peer list. It doesn't work as intended and gives false
12 positive warnings for two reasons:
13
14 1) If the rport is never linked into the peer list it will not be
15 considered empty since the list_head is never initialized.
16
17 2) If the rport is deleted from the peer list using list_del_rcu(), then
18 the list_head is in an undefined state and it is not considered empty.
19
20 Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
21 Reviewed-by: Hannes Reinecke <hare@suse.com>
22 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
23 Signed-off-by: Sasha Levin <sashal@kernel.org>
24 ---
25 drivers/scsi/libfc/fc_rport.c | 1 -
26 1 file changed, 1 deletion(-)
27
28 diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
29 index 1e1c0f1b9e69..8ed2113f5a1e 100644
30 --- a/drivers/scsi/libfc/fc_rport.c
31 +++ b/drivers/scsi/libfc/fc_rport.c
32 @@ -184,7 +184,6 @@ void fc_rport_destroy(struct kref *kref)
33 struct fc_rport_priv *rdata;
34
35 rdata = container_of(kref, struct fc_rport_priv, kref);
36 - WARN_ON(!list_empty(&rdata->peers));
37 kfree_rcu(rdata, rcu);
38 }
39 EXPORT_SYMBOL(fc_rport_destroy);
40 --
41 2.19.1
42