Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758464Ab1CCSSY (ORCPT ); Thu, 3 Mar 2011 13:18:24 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:56777 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758536Ab1CCSSW (ORCPT ); Thu, 3 Mar 2011 13:18:22 -0500 MIME-Version: 1.0 In-Reply-To: References: <1299137483-10975-1-git-send-email-ksumrall@android.com> From: Linus Torvalds Date: Thu, 3 Mar 2011 10:17:32 -0800 Message-ID: Subject: Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro To: Ken Sumrall Cc: 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 Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 31 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. Linus -- 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/