提交 2e2cdace 编写于 作者: M Matan Barak 提交者: Doug Ledford

IB/core: Eliminate sparse false context imbalance warning

When write_gid function needs to do a sleep-able operation, it unlocks
table->rwlock and then relocks it. Sparse complains about context
imbalance.

This is safe as write_gid is always called with table->rwlock.
write_gid protects from simultaneous writes to this GID entry
by setting the GID_TABLE_ENTRY_INVALID flag.

Fixes: 9c584f04 ('IB/core: Change per-entry lock in RoCE GID table to
		     one lock')
Signed-off-by: NMatan Barak <matanb@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 6e2a51a0
......@@ -174,6 +174,7 @@ static int write_gid(struct ib_device *ib_dev, u8 port,
const struct ib_gid_attr *attr,
enum gid_table_write_action action,
bool default_gid)
__releases(&table->rwlock) __acquires(&table->rwlock)
{
int ret = 0;
struct net_device *old_net_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册