[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFLxGvyjLejD8LSGnrEaBHv8=XxD9HH7yeTYjO3Si8+WMCU2Nw@mail.gmail.com>
Date: Mon, 15 Feb 2021 14:43:15 +0100
From: Richard Weinberger <richard.weinberger@...il.com>
To: "Winkler, Tomas" <tomas.winkler@...el.com>
Cc: Richard Weinberger <richard@....at>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Vignesh Raghavendra <vigneshr@...com>,
linux-mtd <linux-mtd@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mtd: use refcount to prevent corruption
On Sat, Feb 13, 2021 at 6:12 PM Winkler, Tomas <tomas.winkler@...el.com> wrote:
> > Well, the trick in glubi (and other MTDs with "hotplug" support) is not to
> > reject removal of the sub-device. ->_put_device() is of return type void.
> > The key is grabbing a reference on the sub-device in ->_get_device() such
> > that the layer below doesn't even try to remove while the MTD is in use.
>
> I understand that. But in that case the kernel is in the mercy of user space to close the handle,
> the whole perception here is that of hotplug that the device is physically removed it cannot wait
> for the user space to complete. What's the fix is trying to do is to bail out gracefully.
>
> > > so we postpone the mtd unregister to mtd_info->_put_device() but it
> > > that state we have nothing to hold on as the device is gone in
> > > remove() User will fail anyway, as the underlying device is not
> > > functional in that state.
> > > Anyway I've tried your suggestion, the kernel is crashing, hope I
> > > haven't done some silly bug.
> >
> > Can you point us to the affected code?
> > This would help a lot to understand the issue better.
> > I'm sure we can find a solution.
>
> Got green light on releasing the patches will send soon.
I'm eager to see them. :-)
As said, I'm sure we can find a nice solution.
--
Thanks,
//richard
Powered by blists - more mailing lists