Re: [PATCH 8/19]: SCST SYSFS interface implementation

From: Vladislav Bolkhovitin
Date: Tue Nov 16 2010 - 08:13:48 EST


Dmitry Torokhov, on 11/16/2010 12:14 AM wrote:
>> Could you be more specific and point out on exact ways for that? From my
>> quite deep SYSFS source code study I see such cases should not exist.
>
> While I do not know offhand I am sure there are such scenarios. Isn't
> there any way for the users that you are waiting on descend back into
> your module that is waiting for kobject removal and get stuck on some
> resource?

No, I don't see any, because SYSFS implements atomic "all or nothing"
behavior on destroy, which is pretty bulletproof.

> Even if it isn't possible now the scheme is quite fragile. Kobjects are
> refcounted so work with them appropriately (rely on refcount, do not
> wait, etc).

The same is true for other SCST objects. For instance, a target can't be
destroyed until there are commands from it being processed. So, kobjects
are only one of the objects we wait for all their ref counters reach
zero, hence addition of kobjects to SCST objects changed nothing in this
area.

Vlad


--
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/