Re: [PATCH] USB: serial: fix sysfs-attribute removal deadlock

From: Tejun Heo
Date: Fri May 02 2014 - 11:20:51 EST


On Mon, Apr 28, 2014 at 08:39:47AM +0800, Li Zhong wrote:
> Yes, maybe try to get the module reference is not bad before writing to
> driver attributes, as it doesn't make much sense to really call the
> callbacks for the driver attribute if the driver is being unload.

Please don't do that spuriously. Active protection is the primary
mechanism for that sort of protection and adding spurious things just
make them confusing.

> And after we get the reference, it is safe for us to break the active.
> But if we don't have such real cases(lockdep warnings), we actually
> don't need to break it.

Yeah, for cases where active protection should be broken, other
measures should be taken to prevent the underlying data structure /
code from going away.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/