Re: [PATCH] mtd: use refcount to prevent corruption

From: Richard Weinberger
Date: Wed Jan 27 2021 - 15:47:36 EST


Tomas,

----- Ursprüngliche Mail -----
> Von: "Tomas Winkler" <tomas.winkler@xxxxxxxxx>
> An: "Miquel Raynal" <miquel.raynal@xxxxxxxxxxx>, "richard" <richard@xxxxxx>, "Vignesh Raghavendra" <vigneshr@xxxxxx>,
> "linux-mtd" <linux-mtd@xxxxxxxxxxxxxxxxxxx>, "linux-kernel" <linux-kernel@xxxxxxxxxxxxxxx>
> CC: "Tomas Winkler" <tomas.winkler@xxxxxxxxx>
> Gesendet: Mittwoch, 27. Januar 2021 21:03:19
> Betreff: [PATCH] mtd: use refcount to prevent corruption

> When underlying device is removed mtd core will crash
> in case user space is still holding an open handle to a mtd device node.
> A proper refcounting is needed so device is release only when a
> partition has no active users. The current simple counter is not
> sufficient.

Can you please explain a little more what devices are involved?
Does it implement _get_device() and _put_device()?

Thanks,
//richard