Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp427764ybk; Wed, 13 May 2020 04:01:03 -0700 (PDT) X-Google-Smtp-Source: APiQypLle7RZCc8O/SrxBVuZAe9pvbP4bapyTdQhLgWBGrwUcewSBDSBq29G918+frgc2IZbvP7o X-Received: by 2002:aa7:dacc:: with SMTP id x12mr21976319eds.363.1589367662996; Wed, 13 May 2020 04:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589367662; cv=none; d=google.com; s=arc-20160816; b=exHbaLgo6+08mvr0WlfMxQ3o6lCbOyAxv1+hmzqMETCE+/WhC7Vz5UHDwBOJl/+dGJ g/rQR8HH2Gh9sPqhlQK3B9pbuII7ZIq2pDYWuSz1hvkW0U0zec0fO0bHDmYrLy9bedEp cd4+3uTX5h10GvQIxTJup6AmqD2AdHFKNUu0erucp9Z4zDU8vRFCjZJ5HT1tWgGTsNUo K9ZHsXhLos++9Vk2gNBM+eZX/K/BUfibGgCGTeueevD2A9X0PMboNzRB/SnvM6pVaUi7 sO1RovOHZL0h4YfTlSVZeWlCzIb+Sxogtlkar7dZOwg2aaECt82TVm6ZDBhTKuORcAeX xnkw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TWH0Q59/1HKSoYG76mGzvyGhb3nQ2UmiHRUceMfLk9g=; b=trT+vL/Kgsdp2ZRnTTn7KJZli9k42s/+qq5mIuiSvAfA2yHf8ZNwvovuPU43UUdg33 8wQNh6Ymj5opL+lUdhlVXOF2lsTkr7iOs7+YwzIzygjOmn3VntUmQiD3+dZeU6NqG8Bs dknhPhKR0CNgTF08jt9PvFQ5V3EB7r/+sL1i3bt1jD4FvzW0kxnTBo1D9tmXDwAhBrp0 vxgC2hTHoclRaGZvbo/BjUbN+BsRR/bCSqfcj8TmtZ3a4XhANJ5mQynHK+Fov3r3/BAa VF8QaMMmYA7kkOXprF5uBhIDum0uSsnxnh6AyzndY49JyMTpj7K+tBxjRohwWfk1K5CU n1Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EUObQxdC; 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 r21si7339540ejb.162.2020.05.13.04.00.39; Wed, 13 May 2020 04:01:02 -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=pass header.i=@kernel.org header.s=default header.b=EUObQxdC; 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 S1729836AbgEMGvg (ORCPT + 99 others); Wed, 13 May 2020 02:51:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729367AbgEMGvg (ORCPT ); Wed, 13 May 2020 02:51:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C200120708; Wed, 13 May 2020 06:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589352695; bh=1qCCaoL90dc2Pbll3pbUgayrYdx2p3xBrdsudFye97I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EUObQxdCqiKC50wbixd8dCuSEVwdylTYNMtCxinCVQJCukVAHoic+oS5YXnWAYnoC AY+ftw6Nt583iXFll4aTCRIQjp+3yfPSYlve5MQ5n+xRBF+gYurnu52FGB5/Ez/gky IJi3NqGiRY2Cs39SpeeHFF6tuWa2ruyVhg5iKYZ0= Date: Wed, 13 May 2020 08:51:33 +0200 From: Greg Kroah-Hartman To: Scott Branden Cc: Luis Chamberlain , Mimi Zohar , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross Subject: Re: [PATCH v5 1/7] fs: introduce kernel_pread_file* support Message-ID: <20200513065133.GB764247@kroah.com> References: <20200508002739.19360-1-scott.branden@broadcom.com> <20200508002739.19360-2-scott.branden@broadcom.com> <20200513002741.GG11244@42.do-not-panic.com> <2e4bc125-5fe5-e3e5-4881-29374da942aa@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e4bc125-5fe5-e3e5-4881-29374da942aa@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 11:23:27PM -0700, Scott Branden wrote: > Hi Luis, > > A few comments inline before I cleanup. > > On 2020-05-12 5:27 p.m., Luis Chamberlain wrote: > > On Thu, May 07, 2020 at 05:27:33PM -0700, Scott Branden wrote: > > > diff --git a/fs/exec.c b/fs/exec.c > > > index 06b4c550af5d..cfab212fab9d 100644 > > > --- a/fs/exec.c > > > +++ b/fs/exec.c > > > @@ -896,10 +896,14 @@ struct file *open_exec(const char *name) > > > } > > > EXPORT_SYMBOL(open_exec); > > > -int kernel_read_file(struct file *file, void **buf, loff_t *size, > > > - loff_t max_size, enum kernel_read_file_id id) > > > -{ > > > - loff_t i_size, pos; > > > +int kernel_pread_file(struct file *file, void **buf, loff_t *size, > > > + loff_t pos, loff_t max_size, unsigned int flags, > > You use int flags, but.. these are mutually exclusive operations, and > > so flags is a misnomer. Just use an enum instead of a define, that way > > we can use kdoc for documentation. > OK, flags could be used to expand with additional flag options in the future > (without change to function prototype, but will change to enum if that is > what is desired. > > > +EXPORT_SYMBOL_GPL(kernel_pread_file); > > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_path); > > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_path_initns); > > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_fd); > > If no one is using these don't export them. I think you only use one of > > these. In fact just remove the code from the ones which are not used. > I do not use them but added them to provide consistent api with > kernel_read_file_* functions.? That way someone can take advantage of the > _from_path and from_fd variants in the future if desired. But if you want > them removed it is simple to drop the EXPORT_SYMBOL_GPL and then add that > back when first driver that calls them needs them in the future. We do not export symbols when there are no in-kernel users. > Note: Existing kernel_read_file_from_path_initns is not used in the kernel.? > Should we delete that as well? Probably, yes. thanks, greg k-h