Subject: inet_csk_get_port lock imbalance?

From: Jiri Slaby <[email-masked]>
Date: Thu, 18 Jun 2009 15:55:54 +0200

Hi,

we've found a weird locking discipline in inet_csk_get_port. Who is
supposed to unlock the spin lock in the place marked in the code below?

do {
        head = &hashinfo->bhash[inet_bhashfn(net, rover,
                        hashinfo->bhash_size)];
        spin_lock(&head->lock);
        inet_bind_bucket_for_each(tb, node, &head->chain)
                if (ib_net(tb) == net && tb->port == rover) {
...
		}
        break;  ////////// here
next:
        spin_unlock(&head->lock);
        if (++rover > high)
                rover = low;
} while (--remaining > 0);

Thanks.