On 11/9/05, Aritz Bastida <aritzbastida@xxxxxxxxx> wrote: > > Well, I hope my questions are clear, and someone can help me. I know, > I could just use test_bit() and forget about this. But, however, the > networking code uses flags the other way, for example in > dev_change_flags() [net/core/dev.c]. > > It acquires the rtnl semaphore (in function dev_ioctl) before changing > anything in dev->flags, so there is no more than one writer at a > certain time. But in dev_get_flags() [net/core/dev.c] it reads the > flags, without acquiring any lock for that purpose. > What I found in net/core/dev.c is dev_get_flags or dev_change_flags are both called from dev_ifsioc which is called from dev_ioctl 2 times with lock held, one time with read_lock on dev_base_lock and second time with rtnl lock held ! -- Fawad Lateef - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html