Re: [PATCH RFC] sysfs: fix the race of "parent deleted before child added"

From: Dan Williams
Date: Fri Aug 01 2014 - 12:54:23 EST


On Fri, Aug 1, 2014 at 4:18 AM, Jianyu Zhan <nasa4836@xxxxxxxxx> wrote:
> From: Jianyu Zhan <Jianyu.Zhan@xxxxxxx>
>
> I've met such a race conditon the same as what commit 3a198886
> ("sysfs: handle 'parent deleted before child added'") tackled.
>
> The senario got triggered under a torturing test of quick disk
> removal and plugging.
>
> The forementioned commit 3a198886 didn't really fix this race,
> it just narrows down the racy window.

You misread the changelog. It was never meant to be a fix, its there
to prevent abuses from crashing this system and rather return an
error.

The commit that fixed the race I was seeing is here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3b661a92

Perhaps you have found another occasion where a device is being
device_del()'d right before a device_add() attempt?
--
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/