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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 DDC31C433E0 for ; Thu, 9 Jul 2020 18:07:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAE4D20767 for ; Thu, 9 Jul 2020 18:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594318052; bh=cIbGdnO1e+K2HlFT+xNczbx3DeDi+F1gQnDljE0aD4Y=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=DKGpbXXjuhfq8C3dXZuxag2XC+SBw8AvWuHkRIZrtdNRE6VxQmrQQe51E0GTFZOZ7 B//0kKvlwbQ15XmA3I3yK/v7QRfwJjcMt2YYSi9UaZ9mxThRwjEsI8EWfnfJvYeeGe 6c+KRA3pN71gJzmIf3ufsb0rCSiJ687lO2fzdeS4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726759AbgGISH2 (ORCPT ); Thu, 9 Jul 2020 14:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbgGISH2 (ORCPT ); Thu, 9 Jul 2020 14:07:28 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B1E4C08C5DC for ; Thu, 9 Jul 2020 11:07:28 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id d17so3457422ljl.3 for ; Thu, 09 Jul 2020 11:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tGB1Ppz9iVx4FA/xnoM13tjpRPi/F5lN29F79qSyClI=; b=XlUxRvTGYZccRYMrKRoB6EWa71eHhhv7TO7Vq+BYwEosgfG77FRVMUrnAizkb/+sIJ rFcH3zyCOVKPaTjKMFymNQmA2ANoiIU33O3g7HgDp0mdHKMUF/14/BxYkEd+THUBakSJ LuCHx3jBsBS0QnYep3fFl0iBrz4LUkE9/SE2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tGB1Ppz9iVx4FA/xnoM13tjpRPi/F5lN29F79qSyClI=; b=gkh8caWZDvJW4y5g+ctwUOaT/JYqB/AAuuzv+1+ClzTjICuBsN/MaoJ2KF9aptY3NV Y7pi/F259Fxy3AEv1OPNlPKPwkylVAgO9pnFUSWOt74UBuyvQTVjxY3FdjemRa4ZUIlQ UrhHNTiFNMyjqPNYOnX6+qheliW0uZ4haKxqRVnxnXfEgX4ieZSWgti5o/LAzotYe9LW u4NoRivIIquKCO08bkLro4YpILbuKarm+kPrNSwcQ/96STj/OfbksD3jTorZoxGkwY05 Uk1Vkd5eStplgKi9oix4FRT95/mLSzGJPxpXZ6wFtZa2C6ml562MmnqvhlSFikigB0sf ILyA== X-Gm-Message-State: AOAM531qrA7p8aksYdp1RYJnGs7sx/i8z2LXcTtQS0gqU8oCDTa40sJ0 AmZB+ROQn5uqZtibF4qCzZdq1pNum6Y= X-Google-Smtp-Source: ABdhPJwgxyzz06ww+NvDNux3IvkPmp2WJIs4nxIKpd4zgnE8ai9goe+mGrlirHfUceFkbJPZ2vzdww== X-Received: by 2002:a2e:89ca:: with SMTP id c10mr27224812ljk.407.1594318046004; Thu, 09 Jul 2020 11:07:26 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id k11sm1039529ljg.37.2020.07.09.11.07.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2020 11:07:24 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id h22so3431312lji.9 for ; Thu, 09 Jul 2020 11:07:24 -0700 (PDT) X-Received: by 2002:a2e:9b42:: with SMTP id o2mr36559372ljj.102.1594318044230; Thu, 09 Jul 2020 11:07:24 -0700 (PDT) MIME-Version: 1.0 References: <20200709151814.110422-1-hch@lst.de> <20200709151814.110422-16-hch@lst.de> In-Reply-To: <20200709151814.110422-16-hch@lst.de> From: Linus Torvalds Date: Thu, 9 Jul 2020 11:07:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 15/17] initramfs: switch initramfs unpacking to struct file based APIs To: Christoph Hellwig Cc: Linux Kernel Mailing List , "H. Peter Anvin" , Song Liu , Al Viro , linux-raid@vger.kernel.org, linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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). Linus