On 9/22/26 09:55, Huang Rui wrote: ... >> As far as I can see we have solved the problems at hand and the rules how to >> handle the user queues should be pretty clear by now. >> > > Assuming every kref_get() has a matching kref_put(), and the queue object > itself does not participate in a circular ownership chain, I don't > immediately see how taking a temporary queue reference would cause > correctness issues.
The reference on the user queue object is meant to keep it alive for the duration of IOCTLs, e.g. prevent concurrent destruction from the close IOCTL. It CAN'T be used to grab references from either atomic, interrupt or worker context since then you can't drop the reference any more without risking destruction from non IOCTL context which in turn causes tons of lifetime problems. This is just standard refcounting rules to keep objects alive during an IOCTL. > Could you please point us to the historical issue or the corresponding > commits that led to removing this approach previously? See Sunils original approach, he made exactly the same mistake and I already had to fix that back then. I don't remember if it was actually committed or if we only discussed that on the mailing list. Regards, Christian. > > Thanks, > Ray
