Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2642956ybi; Sun, 26 May 2019 05:08:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnQYjmRKve/7zVayxcroahahlLrHNAm0nvjJ8ujcVmH5sVPQe+uxdKNPyXYKDwNC/QRvMU X-Received: by 2002:a17:902:7615:: with SMTP id k21mr72420569pll.253.1558872529113; Sun, 26 May 2019 05:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558872529; cv=none; d=google.com; s=arc-20160816; b=UiQzvyLQ9BDOBV+A9Wxn+EOp13tWFaN+V36XBPRtXhK5nCrDL/LJMMGIo0uE4z+I8a NC7p/sE0xVB7bQswyXfxcme7zEcc5U1SJb0Xl8cvb9BuqpGVQ9WS8j7OG5BS8NFMbBbT di+dnoEfhuphu+R/VylaGTBXsj71hrDcBYeM+zAnjKKWZCZ8Qn+QVlUpVhZbhy1YI6TE X7guJWGgknfYUn4Pzue4Gb/9fxsb11TUjkkkz35eQUvPDef25s8wH0u6jJKhLDUdJZkU j+kiqDnNGCQpqtIxAfFH80dWqxrM26wOBLWT1cliQAsmfS8vY1MOR9WVZg7sakwWkKVb n/AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1NbMOaN5gWtSVYBYVSRkcdVOHQbF/gDpKUZ+gSUz89U=; b=cm8RCDVpw1wfLZaf197nkDKS0NqaMjSuXjGI2ziUUNK/mOlRzdwDPTZczHotfcETkU R4wiQLXTxBc+/hE2kKGqTWQZ69jE3xPiuzT/k7KouX5Fz4aSxT9AVCyZ2mVf+LtZgc5H dRr+QTSRUAH+tc5yu0mOn46Ro8SgPnynPICAROi350Hl3xIlv3Zg09P5zC0JXQNEffmt ikaTsHKKKXoQ3dhKPPpClkWj6bx4Wa7dB6WSGlxOqqjkEU1VJ4aQ5/Sg3GLf3F8n0J49 DIwRCAe4wxGSQxFoKHCf+j72xLGW/V7gmCUWqdJ0o21V30Ax9ISrGKt8iZ3wYxn6vsNA K91g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13si13475610pjn.50.2019.05.26.05.08.31; Sun, 26 May 2019 05:08:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbfEZMHV (ORCPT + 99 others); Sun, 26 May 2019 08:07:21 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:42272 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbfEZMHV (ORCPT ); Sun, 26 May 2019 08:07:21 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hUrvr-0008Af-Cx; Sun, 26 May 2019 12:07:19 +0000 Date: Sun, 26 May 2019 13:07:19 +0100 From: Al Viro To: "J. R. Okajima" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kolyshkin@gmail.com Subject: Re: [PATCH] concrete /proc/mounts Message-ID: <20190526120719.GQ17978@ZenIV.linux.org.uk> References: <17910.1558861894@jrobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17910.1558861894@jrobl> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 26, 2019 at 06:11:34PM +0900, J. R. Okajima wrote: > commit 1e83f8634c6efe7dd4e6036ee202ca10bdbca0b3 > Author: J. R. Okajima > Date: Sat May 25 18:35:13 2019 +0900 > > concrete /proc/mounts > > When the size of /proc/mounts exceeds PAGE_SIZE, seq_read() has to > release namespace_sem via mounts_op.m_stop(). It means if someone else > issues mount(2) or umount(2) and the mounts list got changed, then the > continuous getmntent(3) calls show the incomplete mounts list and some > entries may not appear in it. > > This patch generates the full mounts list when mounts_op.m_start() is > called, and keep it in the seq_file buffer until the file is closed. > The size of the buffer increases if necessary. Other operations m_next, > m_stop, m_show become meaningless, but still necessary for the seq_file > manner. > > I don't think the size of the buffer matters because many /proc entries > already keep the similar PAGE_SIZE buffer. Increasing /proc/mounts > buffer is to keep the correctness of the mount list. > > Reported-by: Kirill Kolyshkin > See-also: https://github.com/kolyshkin/procfs-test > Signed-off-by: J. R. Okajima Translation: let's generate the entire contents on the first read() and keep it until the sucker's closed; that way userland wont' see anything changing under it. Oh, wait... NAK.