提交 29f7b376 编写于 作者: R Ross Lagerwall 提交者: Greg Kroah-Hartman

Revert "scsi: libfc: Add WARN_ON() when deleting rports"

[ Upstream commit d8f6382a7d026989029e2e50c515df954488459b ]

This reverts commit bbc0f8bd.

It added a warning whose intent was to check whether the rport was still
linked into the peer list. It doesn't work as intended and gives false
positive warnings for two reasons:

1) If the rport is never linked into the peer list it will not be
considered empty since the list_head is never initialized.

2) If the rport is deleted from the peer list using list_del_rcu(), then
the list_head is in an undefined state and it is not considered empty.
Signed-off-by: NRoss Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 cd8520a2
...@@ -184,7 +184,6 @@ void fc_rport_destroy(struct kref *kref) ...@@ -184,7 +184,6 @@ void fc_rport_destroy(struct kref *kref)
struct fc_rport_priv *rdata; struct fc_rport_priv *rdata;
rdata = container_of(kref, struct fc_rport_priv, kref); rdata = container_of(kref, struct fc_rport_priv, kref);
WARN_ON(!list_empty(&rdata->peers));
kfree_rcu(rdata, rcu); kfree_rcu(rdata, rcu);
} }
EXPORT_SYMBOL(fc_rport_destroy); EXPORT_SYMBOL(fc_rport_destroy);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册