linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ken Sumrall <ksumrall@android.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Lord <kernel@teksavvy.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: Thu, 3 Mar 2011 18:00:45 -0800	[thread overview]
Message-ID: <AANLkTinQ30f-7bi8QSBjwcmHXH6aydqws1vrFMMaMCWc@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimXhGRsuL3Z51msS_YEtsa4UZuN9XW8Xb+hu_KN@mail.gmail.com>

Writing a single byte to /proc/sysrq-trigger is an asynchronous
operation, with no obvious way to be informed that it has completed
the remount.  I did actually try this at first, but the reboot
happened before the remount finished.  I could of course add a sleep
of a few seconds, but just how long to wait is not obvious, nor is it
a guarantee that the remount will always finish in the time chosen.
I'm heading down the path of reading /proc/mounts and remounting all
read-wirte filesystems backed by a block device as read-only.

___
Ken


On Thu, Mar 3, 2011 at 3:36 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Mar 3, 2011 at 10:28 AM, Mark Lord <kernel@teksavvy.com> wrote:
>> On 11-03-03 12:45 PM, Linus Torvalds wrote:
>>>
>>> If you can change whatever user-land process that does the reboot
>>> system call (and clearly you can, since you're adding new commands and
>>> using those), then why the heck don't you just do the remount-ro from
>>> that same user land?
>>
>> Is there a system call for emergency_remount_*() ?
>> I've been writing to /proc/proc/sysrq-trigger to accomplish this.
>
> So I don't know what this has to do with "emergency_remount()" - we're
> talking about a regular controlled shutdown/reset. The fact that the
> patch used the emergency_remount() code seems to be purely an
> implementation issue, nothing more.
>
> And while sysrq-trigger certainly works (when it's enabled, but that's
> true of /proc too, of course), I do think it's a rather odd way of
> solving the problem, when the simple "just remount read-only" is what
> the code actually _wants_ to do.
>
> But you're certainly right that it takes less code to open
> /proc/sysrq-trigger and writing a single byte to it than it does to do
> the straightforward "let's just do the normal mount thing".
>
>                             Linus
>

  reply	other threads:[~2011-03-04  2:00 UTC|newest]

Thread overview: 18+ 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 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
2011-03-03 18:28   ` Mark Lord
2011-03-03 23:36     ` Linus Torvalds
2011-03-04  2:00       ` Ken Sumrall [this message]
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=AANLkTinQ30f-7bi8QSBjwcmHXH6aydqws1vrFMMaMCWc@mail.gmail.com \
    --to=ksumrall@android.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=kernel@teksavvy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).