On Fri, Nov 16, 2018 at 03:49:06PM +0800, Ming Lei wrote:
On Fri, Nov 16, 2018 at 01:52:05AM -0500, Sasha Levin wrote:
On Fri, Nov 16, 2018 at 11:28:25AM +0800, Ming Lei wrote:
> Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime
> from block layer's view, actually they don't
On Fri, Nov 16, 2018 at 02:11:07PM +0800, jianchao.wang wrote:
>
>
> On 11/16/18 11:28 AM, Ming Lei wrote:
> ...
> >
> > +struct blk_mq_kobj {
> > + struct kobject kobj;
> > +};
> > +
> > static void blk_mq_sysfs_release(struct kobject *kobj)
> > {
> > + struct blk_mq_kobj *mq_kobj =
On Fri, Nov 16, 2018 at 01:52:05AM -0500, Sasha Levin wrote:
> On Fri, Nov 16, 2018 at 11:28:25AM +0800, Ming Lei wrote:
> > Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime
> > from block layer's view, actually they don't because userspace may
> > grab one kobject anytime via
On Fri, Nov 16, 2018 at 11:28:25AM +0800, Ming Lei wrote:
Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime
from block layer's view, actually they don't because userspace may
grab one kobject anytime via sysfs, so each kobject's lifetime has
to be independent, then the
On 11/16/18 11:28 AM, Ming Lei wrote:
...
>
> +struct blk_mq_kobj {
> + struct kobject kobj;
> +};
> +
> static void blk_mq_sysfs_release(struct kobject *kobj)
> {
> + struct blk_mq_kobj *mq_kobj = container_of(kobj, struct blk_mq_kobj,
> +
Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime
from block layer's view, actually they don't because userspace may
grab one kobject anytime via sysfs, so each kobject's lifetime has
to be independent, then the objects(mq_kobj, ctx) which hosts its
own kobject have to be allocated