All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ken Sumrall <ksumrall@android.com>,
	linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Jens Axboe <axboe@kernel.dk>,
	Matthew Wilcox <matthew@wil.cx>, Eric Paris <eparis@redhat.com>,
	Dave Young <hidave.darkstar@gmail.com>,
	Jiri Slaby <jslaby@suse.cz>, James Morris <jmorris@namei.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro
Date: Mon, 7 Mar 2011 11:00:20 +0000	[thread overview]
Message-ID: <20110307110020.GA13712@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTi=z0gHbrGPUZ+vvNPGrOzGowBuWjMUEZpqS+ZCc@mail.gmail.com>

On Thu, Mar 03, 2011 at 10:17:32AM -0800, Linus Torvalds wrote:
> On Thu, Mar 3, 2011 at 9:45 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > How many mounted filesystems do you have that it's so hard to keep track of?
> 
> Btw, /proc/mounts will track them for you even if you don't have a
> 'mount' binary that does.
> 
> Parsing that is pretty trivial. If you have spaces or special
> characters in your pathnames (you may control the mount paths, you may
> not - I have no idea), you'll need to be able to handle the escape
> format (\oct). But other than that, it's literally just
> 
>  - read all of /proc/mounts into a buffer
> 
>  - for each line, split by space, and you'll have the directory name
> right there in the second field
> 
>  - do the unescaping ("\oct" -> character) if needed. It's good
> practice. Test it.
> 
>  - just do a read-only remount on it.
> 
> All done. No kernel changes necessary. It just works.

That or using setmntent() etc.

Thanks,
Dimitris

  parent reply	other threads:[~2011-03-07 11:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03  7:31 [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro Ken Sumrall
2011-03-03  8:18 ` Ingo Molnar
2011-03-03  8:46 ` Dave Young
2011-03-03  8:49   ` Dave Young
2011-03-03 14:00 ` Christoph Hellwig
2011-03-03 15:52 ` Phil Carmody
2011-03-03 17:45 ` Linus Torvalds
2011-03-03 18:17   ` Linus Torvalds
2011-03-03 18:29     ` Mark Lord
2011-03-03 23:23       ` Ken Sumrall
2011-03-07 11:00     ` Dimitris Papastamos [this message]
2011-03-03 18:28   ` Mark Lord
2011-03-03 23:36     ` Linus Torvalds
2011-03-04  2:00       ` Ken Sumrall
2011-03-04  2:33         ` Linus Torvalds
2011-03-04  2:48           ` Mark Lord
2011-03-04  2:55             ` Scott James Remnant
2011-03-05  2:45               ` Mark Lord
2011-03-04  6:55       ` Artem Bityutskiy

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=20110307110020.GA13712@opensource.wolfsonmicro.com \
    --to=dp@opensource.wolfsonmicro.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=eparis@redhat.com \
    --cc=hch@lst.de \
    --cc=hidave.darkstar@gmail.com \
    --cc=jack@suse.cz \
    --cc=jmorris@namei.org \
    --cc=jslaby@suse.cz \
    --cc=ksumrall@android.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.