2004-11-19 09:01:19

by Kirill Korotaev

[permalink] [raw]
Subject: [BUG?] dev_close() is called with locks held

Hello,

looks like a bug in 2.4/2.6 kernels:

1. dev_close() function is blocking. it calls schedule() inside and
calls blocking dev_deactivate() function.

2. But... call chain
dev_ioctl() -> dev_ifsioc() -> dev_change_flags() calls dev_close()
under read_lock(&dev_base_lock)...

Bug?

Kirill


2004-11-19 09:40:59

by Patrick McHardy

[permalink] [raw]
Subject: Re: [BUG?] dev_close() is called with locks held

Kirill Korotaev wrote:

> Hello,
>
> looks like a bug in 2.4/2.6 kernels:
>
> 1. dev_close() function is blocking. it calls schedule() inside and
> calls blocking dev_deactivate() function.
>
> 2. But... call chain
> dev_ioctl() -> dev_ifsioc() -> dev_change_flags() calls dev_close()
> under read_lock(&dev_base_lock)...
>
> Bug?

dev_change_flags is only called for SIOCSIFFLAGS. dev_ioctl
takes the rtnl semaphore in this case, so no bug.

Regards
Patrick