All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: "J. R. Okajima" <hooanon05g@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kolyshkin@gmail.com
Subject: Re: [PATCH] concrete /proc/mounts
Date: Sun, 26 May 2019 13:07:19 +0100	[thread overview]
Message-ID: <20190526120719.GQ17978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <17910.1558861894@jrobl>

On Sun, May 26, 2019 at 06:11:34PM +0900, J. R. Okajima wrote:
> commit 1e83f8634c6efe7dd4e6036ee202ca10bdbca0b3
> Author: J. R. Okajima <hooanon05g@gmail.com>
> 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 <kolyshkin@gmail.com>
>     See-also: https://github.com/kolyshkin/procfs-test
>     Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>

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.

  reply	other threads:[~2019-05-26 12:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-26  9:11 [PATCH] concrete /proc/mounts J. R. Okajima
2019-05-26 12:07 ` Al Viro [this message]
2019-05-26 19:06   ` J. R. Okajima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190526120719.GQ17978@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hooanon05g@gmail.com \
    --cc=kolyshkin@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.