Re: Lockdep false positive in sysfs

From: Tejun Heo
Date: Mon May 07 2012 - 15:47:03 EST


Hello, Alan.

On Fri, May 04, 2012 at 03:08:53PM -0400, Alan Stern wrote:
> @@ -588,10 +591,15 @@ static ssize_t usb_dev_authorized_store(
> result = sscanf(buf, "%u\n", &val);
> if (result != 1)
> result = -EINVAL;
> - else if (val == 0)
> + else if (val == 0) {
> + void *cookie;
> +
> + cookie = device_start_attribute_infanticide(dev, attr, NULL);
> result = usb_deauthorize_device(usb_dev);
> - else
> + device_end_attribute_infanticide(cookie);
> + } else {
> result = usb_authorize_device(usb_dev);
> + }

I *think* it looks way too huge as lockdep workaround. We're adding a
whole separate lookup interface for this. If looking up afterwards is
difficult, can't we get away with adding a field in struct attribute?

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/