struct devlink *priv_to_devlink(void *priv) diff --git
I'm worried about priv_to_devlink(), if someone passes the result of 
devlink_priv(shared_dl) as priv,
container_of computes garbage - because the pointer came from shd->priv, NOT from 
&devlink->priv.


There's no good way to detect that inside the priv_to_devlink either,
since it can't know which private pointer it is looking at. Hmm.

We could achieve that by adding a marker prior to priv data, in the same
layout for both structs. I have code handy, will post v3 later to don't
spam too much (and hopefully resolve discussion on the other patch)

@Jiri, I will not add your RB, as this would be significant change

thanks a lot for reviewing so far to all of you

Reply via email to