Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758681Ab1CCS34 (ORCPT ); Thu, 3 Mar 2011 13:29:56 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183]:6339 "EHLO ironport2-out.pppoe.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751133Ab1CCS3z (ORCPT ); Thu, 3 Mar 2011 13:29:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIBAG9tb01Ld/sX/2dsb2JhbAAMhB3QdpEWgSeDRHYEhRo X-IronPort-AV: E=Sophos;i="4.62,259,1297054800"; d="scan'208";a="94288985" Message-ID: <4D6FDE21.7000303@teksavvy.com> Date: Thu, 03 Mar 2011 13:29:53 -0500 From: Mark Lord User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 MIME-Version: 1.0 To: Linus Torvalds CC: Ken Sumrall , linux-kernel@vger.kernel.org, Alexander Viro , Christoph Hellwig , Andrew Morton , Jan Kara , Jens Axboe , Matthew Wilcox , Eric Paris , Dave Young , Jiri Slaby , James Morris , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro References: <1299137483-10975-1-git-send-email-ksumrall@android.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1290 Lines: 38 On 11-03-03 01:17 PM, Linus Torvalds wrote: > On Thu, Mar 3, 2011 at 9:45 AM, Linus Torvalds > 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. This might be much less complex: #!/bin/sh echo s > /proc/sysrq-trigger echo u > /proc/sysrq-trigger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/