Re: [PATCH 16/23] initramfs: simplify clean_rootfs

Matthew Wilcox
2020-07-27T02:44:40Z

On Mon, Jul 27, 2020 at 03:41:49AM +0100, Al Viro wrote:
> On Thu, Jul 23, 2020 at 04:27:34PM +0200, Christoph Hellwig wrote:
> > On Thu, Jul 23, 2020 at 04:25:34PM +0200, Lukasz Stelmach wrote:
> > > >> Can you comment out the call to d_genocide? It seems like for your
> > > >> the fact that clean_rootfs didn't actually clean up was a feature and
> > > >> not a bug.
> > > >>
> > > >> I guess the old, pre-2008 code also wouldn't have worked for you in
> > > >> that case.
> > > >
> > > > Did you get a chance to try this?
> > >
> > > Indeed, commenting out d_genocide() helps.
> >
> > So given that people have relied on at least the basic device nodes
> > like /dev/console to not go away since 2008, I wonder if we should just
> > remove clean_rootfs entirely
> >
> > Linus, Al?
>
> First of all, d_genocide() is simply wrong here from VFS point of view. _IF_
> you want recursive removal, you need simple_recursive_remove(path.dentry, NULL).
> And it's a userland-visible change of behaviour.
>
> As for removal of clean_rootfs()... FWIW, the odds of an image that would
> eventually fail accidentally getting past the signature mismatch check are
> fairly low. I've no idea what scenario the author of that thing used to have;
> that would be Shaohua Li <shaohua.li@intel.com>. Cc'd...

Shaohua is now at Facebook.