From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58BC5C433DF for ; Thu, 9 Jul 2020 18:12:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BAD2207DA for ; Thu, 9 Jul 2020 18:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgGISMa (ORCPT ); Thu, 9 Jul 2020 14:12:30 -0400 Received: from verein.lst.de ([213.95.11.211]:40401 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgGISMa (ORCPT ); Thu, 9 Jul 2020 14:12:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2CC2968AEF; Thu, 9 Jul 2020 20:12:28 +0200 (CEST) Date: Thu, 9 Jul 2020 20:12:27 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Christoph Hellwig , Linux Kernel Mailing List , "H. Peter Anvin" , Song Liu , Al Viro , linux-raid@vger.kernel.org, linux-fsdevel Subject: Re: [PATCH 15/17] initramfs: switch initramfs unpacking to struct file based APIs Message-ID: <20200709181227.GA20954@lst.de> References: <20200709151814.110422-1-hch@lst.de> <20200709151814.110422-16-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jul 09, 2020 at 11:07:08AM -0700, Linus Torvalds wrote: > On Thu, Jul 9, 2020 at 8:18 AM Christoph Hellwig wrote: > > > > There is no good reason to mess with file descriptors from in-kernel > > code, switch the initramfs unpacking to struct file based write > > instead. As we don't have nice helper for chmod or chown on a struct > > file or struct path use the pathname based ones instead there. This > > causes additional (cached) lookups, but keeps the code much simpler. > > This is the only one I'm not a huge fan of. > > I agree about moving to 'struct file'. But then you could just do the > chown/chmod using chown/chmod_common() on file->f_path. > > That would keep the same semantics, and it feels like a more > straightforward patch. > > It would still remove the nasty ksys_fchmod/fchmod, it would just > require our - already existing - *_common() functions to be non-static > (and maybe renamed to "vfs_chown/chmod()" instead, that "*_common()" > naming looks a bit odd compared to all our other "vfs_operation()" > helpers). Sure, we can do that. It requires a little more boilerplate that I thought we could just skip.