Re: [PATCH] md linear: Protecting mddev with rcu locks to avoid races

Neil Brown
2009-06-17T23:38:29Z

On Wednesday June 17, sandeepksinha@gmail.com wrote:
> Hi Neil,
>
> I am attaching the patch file as I am seeing some issues with
> copy-paste into the mail.
>

Thanks. Much better.

I possibly didn't explain myself properly when saying that the
rcu_read_lock needed to be taken out side of the call to which_dev.
The reason was that it returns a pointer which still needs to be
protected. I possibly didn't for the code as it stood, but I wanted
to use call_rcu to free the old conf, so it makes sense to protect the
whole usage of the structure.

So I made that little change. Then added a patch to free the old conf
with call_rcu.

It is all now pushed out and you can see the final version of this
patch at

http://neil.brown.name/git?p=md;a=commitdiff;h=af11c397fd8835c70ec0bb777104e4ab98b2d660

Thanks,
NeilBrown