Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp721543ybg; Sun, 26 Jul 2020 19:47:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7mgKjLbJU31bUSvoM5eI/AkzB4A/TnpuQ0VQI7Q0m0xOrh11WTG+wzmNUZUESjYrccw/L X-Received: by 2002:aa7:ce84:: with SMTP id y4mr19576247edv.113.1595818046001; Sun, 26 Jul 2020 19:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595818045; cv=none; d=google.com; s=arc-20160816; b=rR1VRG0SqUeVhxx8U/FU/Bnh+/FtDkVBWFL98dVOr55zXbGtbd1CIToC5oc6m4te5c tO+H/xe2fg3jq25fvQxuokHxaJb3ThpEEDLvuP9gDTmeXOHtrfJkDBP/soKHPf2zVlBL 0JOs64LBA1E6YgtoGKWfNDpbBkbY4UxWvON21LvynzCOTxdU5UGGcYLXI1mlYS1cCM1L B7ePGYh5yhfANvpMV2/sh/yeYeZcJ7A7F2fsBss6fCkX17Fa3Ky0OuyRmJgiZrh3T99e 2qFkivo6vTit1d1L3ZI5W7Y9MnlEEBpva/JSUouZ90Z9sH4s6wi5sGKPAhli/DwbB+Ub NCyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZKcV0ox/lLpxIzJ0hzm2hE1hqEes29OdpJh8YDdSZ80=; b=lqMW/DE1aHSxzXLRH/5KnFqlcUAOEHUqBx2O1oZOeCtvytQa6mU/Rp/z/JfIx6iCAr v5aDPGB5y9islHgqAfUwtHES59V7hKymn7bYTzrgUTaNNrLv/qRn2XzqaSISqrw1BIy5 vWsLKuUACWyf1DsQZf2T69kCBPZtsk6zNhTNUhVB6bz9dMk3HBak2og08tcx+7QhlY1b koIx7+jzJNAJLK2xjsrbUuNJ5Rr4YeshP8b20OccTS6Nb7VwWuD27kcQA8ihPIOanfMt Vf9OrgNxnOOyUW22mDSegV//Nhn0ei7EzMUDk3ZOHkciO1ySI0BEGaifHAaEFNfsZmJt zphg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=eqN5Hme3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si4823210edt.433.2020.07.26.19.47.04; Sun, 26 Jul 2020 19:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=eqN5Hme3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbgG0Coj (ORCPT + 99 others); Sun, 26 Jul 2020 22:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgG0Coj (ORCPT ); Sun, 26 Jul 2020 22:44:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB83C0619D2; Sun, 26 Jul 2020 19:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZKcV0ox/lLpxIzJ0hzm2hE1hqEes29OdpJh8YDdSZ80=; b=eqN5Hme3pioJ8foIOvGn7kVn6s eagnHWU5NQgFh/tDKI7kGQ8FfaD4j6xUBjicP+0BJwRYRdqs1RBi5loQxdu990XSwXuVUPADi77Ju nZaBrCk2ozwbKEtKCT8Mn9wABN9zGzj+wo7ZletduXtL/O6yNnCUypSVvgMxVaO+5/knoRrAE4SDS MUUFrdTFDdCeNzJq0GvLN+DFzea/uC8Ih4aZFpwh5YDKIBQ7mveX7qw0KKwB1XsS9hX8iBXUoAfCQ JnGzXQvp37ahr0R3ZPa7QrMVqSc2UexLM3xG5+vU3AriSd/PqLR4y0cDrcm/FTmJyvs7ZDP+2tfUD 6E4m+eZA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzt7r-0004Tv-2P; Mon, 27 Jul 2020 02:44:27 +0000 Date: Mon, 27 Jul 2020 03:44:26 +0100 From: Matthew Wilcox To: Al Viro Cc: Christoph Hellwig , Lukasz Stelmach , Marek Szyprowski , linux-kernel@vger.kernel.org, "H. Peter Anvin" , Song Liu , Linus Torvalds , linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Shaohua Li Subject: Re: [PATCH 16/23] initramfs: simplify clean_rootfs Message-ID: <20200727024426.GI23808@casper.infradead.org> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-17-hch@lst.de> <7f37802c-d8d9-18cd-7394-df51fa785988@samsung.com> <20200718100035.GA8856@lst.de> <20200723092200.GA19922@lst.de> <20200723142734.GA11080@lst.de> <20200727024149.GB795125@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727024149.GB795125@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 . Cc'd... Shaohua is now at Facebook.