mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: ext Ken Sumrall <ksumrall@android.com>
Cc: 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 <e@mx-da02.nokia.com>
Subject: Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro
Date: Thu, 3 Mar 2011 17:52:49 +0200	[thread overview]
Message-ID: <20110303155248.GC4245@esdhcp04044.research.nokia.com> (raw)
In-Reply-To: <1299137483-10975-1-git-send-email-ksumrall@android.com>

On 02/03/11 23:31 -0800, ext Ken Sumrall wrote:
> Add 4 new commands to the reboot system call, that do the same thing as the
> RESTART, HALT, POWER_OFF, and RESTART2 commands, but also remount writable
> filesystems as read-only just before doing what the command normally does.
> Now that Android is using EXT4, and since we don't have a standard init
> setup to unmount filesystems before rebooting, this allows the system to
> reboot with clean filesystems, and also improves boot time as the journal
> does not need to be replayed when mounting the filesystem.
> 
> Signed-off-by: Ken Sumrall <ksumrall@android.com>
> ---
...
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 7f5a0cd..3f474e6 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -392,6 +392,9 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
>  	mutex_lock(&reboot_mutex);
>  	switch (cmd) {
>  	case LINUX_REBOOT_CMD_RESTART:
> +	case LINUX_REBOOT_CMD_RMNT_RESTART:
> +		if (cmd == LINUX_REBOOT_CMD_RMNT_RESTART)
> +			emergency_remount_synchronous();
>  		kernel_restart(NULL);
>  		break;

What happened to fall through cases?

 	switch (cmd) {
+	case LINUX_REBOOT_CMD_RMNT_RESTART:
+		emergency_remount_synchronous();
 	case LINUX_REBOOT_CMD_RESTART:
		kernel_restart(NULL);
 		break;

Ditto for the other related hunks. 

Then again, I agree with the other responders, in particular those about fixing 
problems with init in init itself.

Phil

  parent reply	other threads:[~2011-03-03 15:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03  7:31 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 [this message]
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
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=20110303155248.GC4245@esdhcp04044.research.nokia.com \
    --to=ext-phil.2.carmody@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=e@mx-da02.nokia.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=ksumrall@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --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

all inboxes | Powered by JetHome®