Re: [PATCH v3.4-rc5] block: iocontext->nr_tasks should beinitialized to one

From: Tejun Heo
Date: Tue May 01 2012 - 14:06:25 EST


On Tue, May 01, 2012 at 08:04:58PM +0200, Jens Axboe wrote:
> On 2012-05-01 18:17, Tejun Heo wrote:
> > create_task_io_context() left ioc->nr_tasks at zero; however, a newly
> > created ioc should have its nr_tasks initialized to one as it begins
> > attached to the task creating it.
> >
> > This affects only CLONE_IO which currently doesn't seem to have any
> > actual user. Sasha triggered WARN_ON_ONCE() in ioc_task_link() using
> > syscall fuzzer. Even when it happens, the failure mode isn't critical
> > (blk-cgroup may allow attaching a CLONE_IO'd task to a cgroup when it
> > shouldn't and blkcg limits may behave weirdly).
> >
> > Fix it by initializing it to one in create_task_io_context().
> >
> > Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> > Reported-by: Sasha Levin <levinsasha928@xxxxxxxxx>
> > LKML-Reference: <1335873936.16988.148.camel@lappy>
> > Cc: stable@xxxxxxxxxxxxxxx
>
> BTW, this only affects for-3.5/core, it's not a mainline bug. So I've
> dropped the stable CC.

Ah, sorry about that. Got confused which one got in when.

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/