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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88C14C433EF for ; Wed, 8 Jun 2022 03:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiFHDtr (ORCPT ); Tue, 7 Jun 2022 23:49:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbiFHDtI (ORCPT ); Tue, 7 Jun 2022 23:49:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66930231CFE for ; Tue, 7 Jun 2022 17:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654649863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vPTB/7bKS227d/qHuHLFt/85sZuUpC11PLW3IwyD5sM=; b=KfE3Cg+g650gp/xmL4hYUS+AgO9oEwsC2i89Xh7eEoOQDWadQFzw+d9la2A7I/oQtAaBtv ZC1ewi0Sal/iXo2+XngImThV7vivksWv+t4DSrXIpFy0mrk0GCzgXN0KEU+eJoBxp3wp4U jJUw4/RwnFRnPvpLs+qk9zoPup6auXI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-318-ctHPKVURO3qn2sO5bj8SKA-1; Tue, 07 Jun 2022 20:57:37 -0400 X-MC-Unique: ctHPKVURO3qn2sO5bj8SKA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D8C23C01D82; Wed, 8 Jun 2022 00:57:37 +0000 (UTC) Received: from localhost (ovpn-12-81.pek2.redhat.com [10.72.12.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F62C2166B26; Wed, 8 Jun 2022 00:57:36 +0000 (UTC) Date: Wed, 8 Jun 2022 08:57:33 +0800 From: Baoquan He To: Pasha Tatashin Cc: Sasha Levin , "Eric W. Biederman" , rburanyi@google.com, Greg Thelen , viro@zeniv.linux.org.uk, kexec mailing list , linux-fsdevel@vger.kernel.org, LKML Subject: Re: [PATCH v2 1/2] fs/kernel_read_file: Allow to read files up-to ssize_t Message-ID: References: <20220527025535.3953665-1-pasha.tatashin@soleen.com> <20220527025535.3953665-2-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/22 at 11:52am, Pasha Tatashin wrote: > On Sun, Jun 5, 2022 at 10:45 PM Baoquan He wrote: > > > > On 05/27/22 at 02:55am, Pasha Tatashin wrote: > > > Currently, the maximum file size that is supported is 2G. This may be > > > too small in some cases. For example, kexec_file_load() system call > > > loads initramfs. In some netboot cases initramfs can be rather large. > > > > > > Allow to use up-to ssize_t bytes. The callers still can limit the > > > maximum file size via buf_size. > > > > If we really met initramfs bigger than 2G, it's reasonable to increase > > the limit. While wondering why we should take sszie_t, but not size_t. > > ssize_t instead of size_t so we can return errors as negative values. Makes sense. Thanks.