Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3325173ybt; Sat, 4 Jul 2020 13:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzBXhD1jODw/cCQQQxLUeOA3+DXlniW4ATY6ocmdO4REyRgjmVuPPThhBnYb70+tM6TTKu X-Received: by 2002:a17:906:57c5:: with SMTP id u5mr21625826ejr.311.1593893576296; Sat, 04 Jul 2020 13:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593893576; cv=none; d=google.com; s=arc-20160816; b=kHpHm2tWEqMr6zWv6YPn2NJ7ff90ARE5A356U/+a8niiITYcE8jL4yHzxA15tY4O8P rODgJ3QugVPrHPN9F7QhXGvtSKTAsV+um7Wxr8i92QCOEyR/XEWyy9DszT+VMCU6GF2v uo/AUMlTn62vRTR5da7UCv9zwMOPUZxDzYG+hkCWgTf5XqvNYLbkbB/Yh2fihxKrRJYN nHhiggRmbyzH5tbTvxg3xBL4joP8RaUKP+i62R9bMsE9lniYmIT2Mt6m9kEzkKhCLGmn NwSr3EY7EZ/Or6P+RTznu2Ztm1oR+7zpydtwLHSSBgjANBQVhjma8m7yxAy8YuKFTFee 3yag== 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; bh=mSM1KfKnsmyP1Xtdidycj9BBItD2z15lItDW1fnAA4s=; b=J0FrnOrBZXpTz+GlMOgkVzuTrVSyh6JcdHRdXPaRI4OXQt/my8SWQeQUZej6WYvpVS DoJbIY7gGLraln02lKbUsHCGVs3ZgDc61sDwXegvkeTIR2BgMaUqNyKHNh0/+jbGJgih a9qwJr/IP6VqLttx4ge4MaarFvUaxs/2ZTaMEL7EOFM/W+cXlFR3dVcoO+dO9aXTyLYf aWJYgegQkj8Ce0kPCI3sMIfMEVEuDYh2xbgpvF0rlrf2W1xEhx77mNwP4vQNECDIMAW2 lE0n1ItaB2VWi7L7oqzNV/f4rUqBd6RocLnRthFgYFrj3LuBOUPtaf7nmfjP6ZbNh6ha 6Gmw== ARC-Authentication-Results: i=1; mx.google.com; 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 s2si9460638ejx.162.2020.07.04.13.12.33; Sat, 04 Jul 2020 13:12:56 -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; 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 S1727871AbgGDUMV (ORCPT + 99 others); Sat, 4 Jul 2020 16:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbgGDUMV (ORCPT ); Sat, 4 Jul 2020 16:12:21 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EF3DC061794; Sat, 4 Jul 2020 13:12:21 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jroW6-005OXK-Sw; Sat, 04 Jul 2020 20:12:07 +0000 Date: Sat, 4 Jul 2020 21:12:06 +0100 From: Al Viro To: Miklos Szeredi Cc: Greg Kroah-Hartman , Michael Kerrisk , shuah@kernel.org, Linux API , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-man , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/3] readfile: implement readfile syscall Message-ID: <20200704201206.GD2786714@ZenIV.linux.org.uk> References: <20200704140250.423345-1-gregkh@linuxfoundation.org> <20200704140250.423345-2-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 04, 2020 at 09:41:09PM +0200, Miklos Szeredi wrote: > And "If the size of file is smaller than the value provided in count > then the whole file will be copied into buf", which is simply a lie; > for example seq_file will happily return a smaller-than-PAGE_SIZE > chunk if at least one record fits in there. You'll have a very hard > time explaining that in the man page. So I think there are two > possible ways forward: > > 1) just leave the first explanation (it's an open + read + close > equivalent) and leave out the rest > > 2) add a loop around the vfs_read() in the code. 3) don't bother with the entire thing, until somebody manages to demonstrate a setup where it does make a real difference (compared to than the obvious sequence of syscalls, that is). At which point we'll need to figure out what's going on and deal with the underlying problem of that setup.